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

41 lines
761 B
Plaintext
Executable File

/*!
* code-points | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/code-points.js
*/
function codePoints(str, option) {
'use strict';
option = option || {unique: false};
if (typeof str !== 'string') {
throw new TypeError(
str +
' is not a string. First argument to code-points must be a string.'
);
}
var result = [];
var index = 0;
while (index < str.length) {
var point = codePoint(str.charAt(index) + str.charAt(index + 1));
if (point > 0xffff) {
index += 2;
} else {
index += 1;
}
if (option.unique && result.indexOf(point) !== -1) {
continue;
}
result.push(point);
}
return result;
}
var codePoint = require('code-point');
module.exports = codePoints;