X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Finternals%2Fstring-multibyte.js;h=3dd8da8159d30f419c0234a90956a2973ed26855;hb=3be0a9efc698a9570a44456009afc6014812625a;hp=c0cf086294ba62ddb87b29d71d7774aa41bdc00d;hpb=3aba54c891969552833dbc350b3139e944e17a97;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/string-multibyte.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/string-multibyte.js index c0cf0862..3dd8da81 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/string-multibyte.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/string-multibyte.js @@ -1,25 +1,34 @@ -var toInteger = require('../internals/to-integer'); +var uncurryThis = require('../internals/function-uncurry-this'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); -// `String.prototype.{ codePointAt, at }` methods implementation +var charAt = uncurryThis(''.charAt); +var charCodeAt = uncurryThis(''.charCodeAt); +var stringSlice = uncurryThis(''.slice); + var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { - var S = String(requireObjectCoercible($this)); - var position = toInteger(pos); + var S = toString(requireObjectCoercible($this)); + var position = toIntegerOrInfinity(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; - first = S.charCodeAt(position); + first = charCodeAt(S, position); return first < 0xD800 || first > 0xDBFF || position + 1 === size - || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF - ? CONVERT_TO_STRING ? S.charAt(position) : first - : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF + ? CONVERT_TO_STRING + ? charAt(S, position) + : first + : CONVERT_TO_STRING + ? stringSlice(S, position, position + 2) + : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { // `String.prototype.codePointAt` method - // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + // https://tc39.es/ecma262/#sec-string.prototype.codepointat codeAt: createMethod(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at