source: frontend/node_modules/es-abstract/2025/StringToCodePoints.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 594 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var CodePointAt = require('./CodePointAt');
6
7// https://262.ecma-international.org/12.0/#sec-stringtocodepoints
8
9module.exports = function StringToCodePoints(string) {
10 if (typeof string !== 'string') {
11 throw new $TypeError('Assertion failed: `string` must be a String');
12 }
13 var codePoints = [];
14 var size = string.length;
15 var position = 0;
16 while (position < size) {
17 var cp = CodePointAt(string, position);
18 codePoints[codePoints.length] = cp['[[CodePoint]]'];
19 position += cp['[[CodeUnitCount]]'];
20 }
21 return codePoints;
22};
Note: See TracBrowser for help on using the repository browser.