Files
NapCatQQ/.pnpm-store/v3/files/1c/b5896cabcadb83fee513e5e1f8a190c5dc48c5c00d3a6fca770448df05e643c5600dc3afe2f67c14c3da4a881bc640169aff5fc55f55c9486f40f4bb5d5af3
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
592 B
Plaintext

'use strict';
var $TypeError = require('es-errors/type');
var CodePointAt = require('./CodePointAt');
// https://262.ecma-international.org/11.0/#sec-utf16decodestring
module.exports = function UTF16DecodeString(string) {
if (typeof 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);
codePoints[codePoints.length] = cp['[[CodePoint]]'];
position += cp['[[CodeUnitCount]]'];
}
return codePoints;
};