mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-24 21:11:23 +01:00
merge completed... now to fix all the bugs...
This commit is contained in:
commit
87c4d80fbc
3472 changed files with 466748 additions and 6517 deletions
29
node_modules/es-abstract/2021/StringToCodePoints.js
generated
vendored
Normal file
29
node_modules/es-abstract/2021/StringToCodePoints.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $push = callBound('Array.prototype.push');
|
||||
|
||||
var CodePointAt = require('./CodePointAt');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/12.0/#sec-stringtocodepoints
|
||||
|
||||
module.exports = function StringToCodePoints(string) {
|
||||
if (Type(string) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `string` must be a String');
|
||||
}
|
||||
var codePoints = [];
|
||||
var size = string.length;
|
||||
var position = 0;
|
||||
while (position < size) {
|
||||
var cp = CodePointAt(string, position);
|
||||
$push(codePoints, cp['[[CodePoint]]']);
|
||||
position += cp['[[CodeUnitCount]]'];
|
||||
}
|
||||
return codePoints;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue