mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
16 lines
668 B
JavaScript
16 lines
668 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.fromCodePoint = String.fromCodePoint || function (astralCodePoint) {
|
|
return String.fromCharCode(Math.floor((astralCodePoint - 0x10000) / 0x400) + 0xD800, (astralCodePoint - 0x10000) % 0x400 + 0xDC00);
|
|
};
|
|
exports.getCodePoint = String.prototype.codePointAt ?
|
|
function (input, position) {
|
|
return input.codePointAt(position);
|
|
} :
|
|
function (input, position) {
|
|
return (input.charCodeAt(position) - 0xD800) * 0x400
|
|
+ input.charCodeAt(position + 1) - 0xDC00 + 0x10000;
|
|
};
|
|
exports.highSurrogateFrom = 0xD800;
|
|
exports.highSurrogateTo = 0xDBFF;
|