mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 21:52:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
10
web/node_modules/es5-ext/string/#/@@iterator/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/@@iterator/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, require("es6-symbol").iterator, {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
5
web/node_modules/es5-ext/string/#/@@iterator/index.js
generated
vendored
Normal file
5
web/node_modules/es5-ext/string/#/@@iterator/index.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")()
|
||||
? String.prototype[require("es6-symbol").iterator]
|
||||
: require("./shim");
|
16
web/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
generated
vendored
Normal file
16
web/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
var iteratorSymbol = require("es6-symbol").iterator;
|
||||
|
||||
module.exports = function () {
|
||||
var str = "🙈f", iterator, result;
|
||||
if (typeof str[iteratorSymbol] !== "function") return false;
|
||||
iterator = str[iteratorSymbol]();
|
||||
if (!iterator) return false;
|
||||
if (typeof iterator.next !== "function") return false;
|
||||
result = iterator.next();
|
||||
if (!result) return false;
|
||||
if (result.value !== "🙈") return false;
|
||||
if (result.done !== false) return false;
|
||||
return true;
|
||||
};
|
6
web/node_modules/es5-ext/string/#/@@iterator/shim.js
generated
vendored
Normal file
6
web/node_modules/es5-ext/string/#/@@iterator/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var StringIterator = require("es6-iterator/string")
|
||||
, value = require("../../../object/valid-value");
|
||||
|
||||
module.exports = function () { return new StringIterator(value(this)); };
|
35
web/node_modules/es5-ext/string/#/at.js
generated
vendored
Normal file
35
web/node_modules/es5-ext/string/#/at.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Based on: https://github.com/mathiasbynens/String.prototype.at
|
||||
// Thanks @mathiasbynens !
|
||||
|
||||
"use strict";
|
||||
|
||||
var toInteger = require("../../number/to-integer")
|
||||
, validValue = require("../../object/valid-value");
|
||||
|
||||
module.exports = function (pos) {
|
||||
var str = String(validValue(this)), size = str.length, cuFirst, cuSecond, nextPos, len;
|
||||
pos = toInteger(pos);
|
||||
|
||||
// Account for out-of-bounds indices
|
||||
// The odd lower bound is because the ToInteger operation is
|
||||
// going to round `n` to `0` for `-1 < n <= 0`.
|
||||
if (pos <= -1 || pos >= size) return "";
|
||||
|
||||
// Second half of `ToInteger`
|
||||
// eslint-disable-next-line no-bitwise
|
||||
pos |= 0;
|
||||
// Get the first code unit and code unit value
|
||||
cuFirst = str.charCodeAt(pos);
|
||||
nextPos = pos + 1;
|
||||
len = 1;
|
||||
if (
|
||||
// Check if it’s the start of a surrogate pair
|
||||
cuFirst >= 0xd800 &&
|
||||
cuFirst <= 0xdbff && // High surrogate
|
||||
size > nextPos // There is a next code unit
|
||||
) {
|
||||
cuSecond = str.charCodeAt(nextPos);
|
||||
if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff) len = 2; // Low surrogate
|
||||
}
|
||||
return str.slice(pos, pos + len);
|
||||
};
|
9
web/node_modules/es5-ext/string/#/camel-to-hyphen.js
generated
vendored
Normal file
9
web/node_modules/es5-ext/string/#/camel-to-hyphen.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
"use strict";
|
||||
|
||||
var replace = String.prototype.replace, re = /([A-Z])/g;
|
||||
|
||||
module.exports = function () {
|
||||
var str = replace.call(this, re, "-$1").toLowerCase();
|
||||
if (str[0] === "-") str = str.slice(1);
|
||||
return str;
|
||||
};
|
8
web/node_modules/es5-ext/string/#/capitalize.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/capitalize.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var value = require("../../object/valid-value");
|
||||
|
||||
module.exports = function () {
|
||||
var str = String(value(this));
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
};
|
7
web/node_modules/es5-ext/string/#/case-insensitive-compare.js
generated
vendored
Normal file
7
web/node_modules/es5-ext/string/#/case-insensitive-compare.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
var toLowerCase = String.prototype.toLowerCase;
|
||||
|
||||
module.exports = function (other) {
|
||||
return toLowerCase.call(this).localeCompare(toLowerCase.call(String(other)));
|
||||
};
|
10
web/node_modules/es5-ext/string/#/code-point-at/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/code-point-at/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, "codePointAt", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/string/#/code-point-at/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/string/#/code-point-at/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.codePointAt : require("./shim");
|
8
web/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var str = "abc\uD834\uDF06def";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.codePointAt !== "function") return false;
|
||||
return str.codePointAt(3) === 0x1d306;
|
||||
};
|
26
web/node_modules/es5-ext/string/#/code-point-at/shim.js
generated
vendored
Normal file
26
web/node_modules/es5-ext/string/#/code-point-at/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Based on: https://github.com/mathiasbynens/String.prototype.codePointAt
|
||||
// Thanks @mathiasbynens !
|
||||
|
||||
"use strict";
|
||||
|
||||
var toInteger = require("../../../number/to-integer")
|
||||
, validValue = require("../../../object/valid-value");
|
||||
|
||||
module.exports = function (pos) {
|
||||
var str = String(validValue(this)), length = str.length, first, second;
|
||||
pos = toInteger(pos);
|
||||
|
||||
// Account for out-of-bounds indices:
|
||||
if (pos < 0 || pos >= length) return undefined;
|
||||
|
||||
// Get the first code unit
|
||||
first = str.charCodeAt(pos);
|
||||
if (first >= 0xd800 && first <= 0xdbff && length > pos + 1) {
|
||||
second = str.charCodeAt(pos + 1);
|
||||
if (second >= 0xdc00 && second <= 0xdfff) {
|
||||
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000;
|
||||
}
|
||||
}
|
||||
return first;
|
||||
};
|
10
web/node_modules/es5-ext/string/#/contains/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/contains/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, "contains", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/string/#/contains/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/string/#/contains/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.contains : require("./shim");
|
8
web/node_modules/es5-ext/string/#/contains/is-implemented.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/contains/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var str = "razdwatrzy";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.contains !== "function") return false;
|
||||
return str.contains("dwa") === true && str.contains("foo") === false;
|
||||
};
|
7
web/node_modules/es5-ext/string/#/contains/shim.js
generated
vendored
Normal file
7
web/node_modules/es5-ext/string/#/contains/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
var indexOf = String.prototype.indexOf;
|
||||
|
||||
module.exports = function (searchString/*, position*/) {
|
||||
return indexOf.call(this, searchString, arguments[1]) > -1;
|
||||
};
|
15
web/node_modules/es5-ext/string/#/count.js
generated
vendored
Normal file
15
web/node_modules/es5-ext/string/#/count.js
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
|
||||
var ensureString = require("../../object/validate-stringifiable-value");
|
||||
|
||||
module.exports = function (search) {
|
||||
var string = ensureString(this), count = 0, index = 0;
|
||||
|
||||
search = ensureString(search);
|
||||
if (!search) throw new TypeError("Search string cannot be empty");
|
||||
while ((index = string.indexOf(search, index)) !== -1) {
|
||||
++count;
|
||||
index += search.length;
|
||||
}
|
||||
return count;
|
||||
};
|
10
web/node_modules/es5-ext/string/#/ends-with/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/ends-with/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, "endsWith", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/string/#/ends-with/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/string/#/ends-with/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.endsWith : require("./shim");
|
8
web/node_modules/es5-ext/string/#/ends-with/is-implemented.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/ends-with/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var str = "razdwatrzy";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.endsWith !== "function") return false;
|
||||
return str.endsWith("trzy") === true && str.endsWith("raz") === false;
|
||||
};
|
18
web/node_modules/es5-ext/string/#/ends-with/shim.js
generated
vendored
Normal file
18
web/node_modules/es5-ext/string/#/ends-with/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
"use strict";
|
||||
|
||||
var toInteger = require("../../../number/to-integer")
|
||||
, value = require("../../../object/valid-value")
|
||||
, isValue = require("../../../object/is-value")
|
||||
, min = Math.min
|
||||
, max = Math.max;
|
||||
|
||||
module.exports = function (searchString/*, endPosition*/) {
|
||||
var self, start, endPos;
|
||||
self = String(value(this));
|
||||
searchString = String(searchString);
|
||||
endPos = arguments[1];
|
||||
start =
|
||||
(isValue(endPos) ? min(max(toInteger(endPos), 0), self.length) : self.length) -
|
||||
searchString.length;
|
||||
return start < 0 ? false : self.indexOf(searchString, start) === start;
|
||||
};
|
6
web/node_modules/es5-ext/string/#/hyphen-to-camel.js
generated
vendored
Normal file
6
web/node_modules/es5-ext/string/#/hyphen-to-camel.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var replace = String.prototype.replace, re = /-([a-z0-9])/g;
|
||||
var toUpperCase = function (ignored, a) { return a.toUpperCase(); };
|
||||
|
||||
module.exports = function () { return replace.call(this, re, toUpperCase); };
|
12
web/node_modules/es5-ext/string/#/indent.js
generated
vendored
Normal file
12
web/node_modules/es5-ext/string/#/indent.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
|
||||
var isValue = require("../../object/is-value")
|
||||
, repeat = require("./repeat")
|
||||
, replace = String.prototype.replace
|
||||
, re = /(\r\n|[\n\r\u2028\u2029])([\u0000-\u0009\u000b-\uffff]+)/g;
|
||||
|
||||
module.exports = function (indent/*, count*/) {
|
||||
var count = arguments[1];
|
||||
indent = repeat.call(String(indent), isValue(count) ? count : 1);
|
||||
return indent + replace.call(this, re, "$1" + indent + "$2");
|
||||
};
|
23
web/node_modules/es5-ext/string/#/index.js
generated
vendored
Normal file
23
web/node_modules/es5-ext/string/#/index.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"@@iterator": require("./@@iterator"),
|
||||
"at": require("./at"),
|
||||
"count": require("./count"),
|
||||
"camelToHyphen": require("./camel-to-hyphen"),
|
||||
"capitalize": require("./capitalize"),
|
||||
"caseInsensitiveCompare": require("./case-insensitive-compare"),
|
||||
"codePointAt": require("./code-point-at"),
|
||||
"contains": require("./contains"),
|
||||
"hyphenToCamel": require("./hyphen-to-camel"),
|
||||
"endsWith": require("./ends-with"),
|
||||
"indent": require("./indent"),
|
||||
"last": require("./last"),
|
||||
"normalize": require("./normalize"),
|
||||
"pad": require("./pad"),
|
||||
"plainReplace": require("./plain-replace"),
|
||||
"plainReplaceAll": require("./plain-replace-all"),
|
||||
"repeat": require("./repeat"),
|
||||
"startsWith": require("./starts-with"),
|
||||
"uncapitalize": require("./uncapitalize")
|
||||
};
|
8
web/node_modules/es5-ext/string/#/last.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/last.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var value = require("../../object/valid-value");
|
||||
|
||||
module.exports = function () {
|
||||
var self = String(value(this)), length = self.length;
|
||||
return length ? self[length - 1] : null;
|
||||
};
|
6988
web/node_modules/es5-ext/string/#/normalize/_data.js
generated
vendored
Normal file
6988
web/node_modules/es5-ext/string/#/normalize/_data.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
10
web/node_modules/es5-ext/string/#/normalize/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/normalize/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, "normalize", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/string/#/normalize/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/string/#/normalize/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.normalize : require("./shim");
|
8
web/node_modules/es5-ext/string/#/normalize/is-implemented.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/normalize/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var str = "æøåäüö";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.normalize !== "function") return false;
|
||||
return str.normalize("NFKD") === "æøåäüö";
|
||||
};
|
309
web/node_modules/es5-ext/string/#/normalize/shim.js
generated
vendored
Normal file
309
web/node_modules/es5-ext/string/#/normalize/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,309 @@
|
|||
/* eslint no-bitwise: "off", max-statements: "off", max-lines: "off" */
|
||||
|
||||
// Taken from: https://github.com/walling/unorm/blob/master/lib/unorm.js
|
||||
|
||||
/*
|
||||
* UnicodeNormalizer 1.0.0
|
||||
* Copyright (c) 2008 Matsuza
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt) and
|
||||
* GPL (GPL-LICENSE.txt) licenses.
|
||||
* $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $
|
||||
* $Rev: 13309 $
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
var primitiveSet = require("../../../object/primitive-set")
|
||||
, validValue = require("../../../object/valid-value")
|
||||
, data = require("./_data");
|
||||
|
||||
var floor = Math.floor
|
||||
, forms = primitiveSet("NFC", "NFD", "NFKC", "NFKD")
|
||||
, DEFAULT_FEATURE = [null, 0, {}]
|
||||
, CACHE_THRESHOLD = 10
|
||||
, SBase = 0xac00
|
||||
, LBase = 0x1100
|
||||
, VBase = 0x1161
|
||||
, TBase = 0x11a7
|
||||
, LCount = 19
|
||||
, VCount = 21
|
||||
, TCount = 28
|
||||
, NCount = VCount * TCount
|
||||
, SCount = LCount * NCount
|
||||
, UChar
|
||||
, cache = {}
|
||||
, cacheCounter = []
|
||||
, fromCache
|
||||
, fromData
|
||||
, fromCpOnly
|
||||
, fromRuleBasedJamo
|
||||
, fromCpFilter
|
||||
, strategies
|
||||
, UCharIterator
|
||||
, RecursDecompIterator
|
||||
, DecompIterator
|
||||
, CompIterator
|
||||
, createIterator
|
||||
, normalize;
|
||||
|
||||
UChar = function (cp, feature) {
|
||||
this.codepoint = cp;
|
||||
this.feature = feature;
|
||||
};
|
||||
|
||||
// Strategies
|
||||
(function () { for (var i = 0; i <= 0xff; ++i) cacheCounter[i] = 0; })();
|
||||
|
||||
fromCache = function (nextStep, cp, needFeature) {
|
||||
var ret = cache[cp];
|
||||
if (!ret) {
|
||||
ret = nextStep(cp, needFeature);
|
||||
if (Boolean(ret.feature) && ++cacheCounter[(cp >> 8) & 0xff] > CACHE_THRESHOLD) {
|
||||
cache[cp] = ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
fromData = function (next, cp) {
|
||||
var hash = cp & 0xff00, dunit = UChar.udata[hash] || {}, feature = dunit[cp];
|
||||
return feature ? new UChar(cp, feature) : new UChar(cp, DEFAULT_FEATURE);
|
||||
};
|
||||
fromCpOnly = function (next, cp, needFeature) {
|
||||
return needFeature ? next(cp, needFeature) : new UChar(cp, null);
|
||||
};
|
||||
|
||||
fromRuleBasedJamo = function (next, cp, needFeature) {
|
||||
var char, base, i, arr, SIndex, TIndex, feature, j;
|
||||
if (cp < LBase || (LBase + LCount <= cp && cp < SBase) || SBase + SCount < cp) {
|
||||
return next(cp, needFeature);
|
||||
}
|
||||
if (LBase <= cp && cp < LBase + LCount) {
|
||||
char = {};
|
||||
base = (cp - LBase) * VCount;
|
||||
for (i = 0; i < VCount; ++i) {
|
||||
char[VBase + i] = SBase + TCount * (i + base);
|
||||
}
|
||||
arr = new Array(3);
|
||||
arr[2] = char;
|
||||
return new UChar(cp, arr);
|
||||
}
|
||||
|
||||
SIndex = cp - SBase;
|
||||
TIndex = SIndex % TCount;
|
||||
feature = [];
|
||||
if (TIndex === 0) {
|
||||
feature[0] = [LBase + floor(SIndex / NCount), VBase + floor((SIndex % NCount) / TCount)];
|
||||
feature[2] = {};
|
||||
for (j = 1; j < TCount; ++j) {
|
||||
feature[2][TBase + j] = cp + j;
|
||||
}
|
||||
} else {
|
||||
feature[0] = [SBase + SIndex - TIndex, TBase + TIndex];
|
||||
}
|
||||
return new UChar(cp, feature);
|
||||
};
|
||||
|
||||
fromCpFilter = function (next, cp, needFeature) {
|
||||
return cp < 60 || (cp > 13311 && cp < 42607)
|
||||
? new UChar(cp, DEFAULT_FEATURE)
|
||||
: next(cp, needFeature);
|
||||
};
|
||||
|
||||
strategies = [fromCpFilter, fromCache, fromCpOnly, fromRuleBasedJamo, fromData];
|
||||
|
||||
UChar.fromCharCode = strategies.reduceRight(function (next, strategy) {
|
||||
return function (cp, needFeature) { return strategy(next, cp, needFeature); };
|
||||
}, null);
|
||||
|
||||
UChar.isHighSurrogate = function (cp) { return cp >= 0xd800 && cp <= 0xdbff; };
|
||||
UChar.isLowSurrogate = function (cp) { return cp >= 0xdc00 && cp <= 0xdfff; };
|
||||
|
||||
UChar.prototype.prepFeature = function () {
|
||||
if (!this.feature) {
|
||||
this.feature = UChar.fromCharCode(this.codepoint, true).feature;
|
||||
}
|
||||
};
|
||||
|
||||
UChar.prototype.toString = function () {
|
||||
var num;
|
||||
if (this.codepoint < 0x10000) return String.fromCharCode(this.codepoint);
|
||||
num = this.codepoint - 0x10000;
|
||||
return String.fromCharCode(floor(num / 0x400) + 0xd800, (num % 0x400) + 0xdc00);
|
||||
};
|
||||
|
||||
UChar.prototype.getDecomp = function () {
|
||||
this.prepFeature();
|
||||
return this.feature[0] || null;
|
||||
};
|
||||
|
||||
UChar.prototype.isCompatibility = function () {
|
||||
this.prepFeature();
|
||||
return Boolean(this.feature[1]) && this.feature[1] & (1 << 8);
|
||||
};
|
||||
UChar.prototype.isExclude = function () {
|
||||
this.prepFeature();
|
||||
return Boolean(this.feature[1]) && this.feature[1] & (1 << 9);
|
||||
};
|
||||
UChar.prototype.getCanonicalClass = function () {
|
||||
this.prepFeature();
|
||||
return this.feature[1] ? this.feature[1] & 0xff : 0;
|
||||
};
|
||||
UChar.prototype.getComposite = function (following) {
|
||||
var cp;
|
||||
this.prepFeature();
|
||||
if (!this.feature[2]) return null;
|
||||
cp = this.feature[2][following.codepoint];
|
||||
return cp ? UChar.fromCharCode(cp) : null;
|
||||
};
|
||||
|
||||
UCharIterator = function (str) {
|
||||
this.str = str;
|
||||
this.cursor = 0;
|
||||
};
|
||||
UCharIterator.prototype.next = function () {
|
||||
if (Boolean(this.str) && this.cursor < this.str.length) {
|
||||
var cp = this.str.charCodeAt(this.cursor++), d;
|
||||
if (
|
||||
UChar.isHighSurrogate(cp) &&
|
||||
this.cursor < this.str.length &&
|
||||
UChar.isLowSurrogate((d = this.str.charCodeAt(this.cursor)))
|
||||
) {
|
||||
cp = (cp - 0xd800) * 0x400 + (d - 0xdc00) + 0x10000;
|
||||
++this.cursor;
|
||||
}
|
||||
return UChar.fromCharCode(cp);
|
||||
}
|
||||
this.str = null;
|
||||
return null;
|
||||
};
|
||||
|
||||
RecursDecompIterator = function (it, cano) {
|
||||
this.it = it;
|
||||
this.canonical = cano;
|
||||
this.resBuf = [];
|
||||
};
|
||||
|
||||
RecursDecompIterator.prototype.next = function () {
|
||||
var recursiveDecomp, uchar;
|
||||
recursiveDecomp = function (cano, ucharLoc) {
|
||||
var decomp = ucharLoc.getDecomp(), ret, i, a, j;
|
||||
if (Boolean(decomp) && !(cano && ucharLoc.isCompatibility())) {
|
||||
ret = [];
|
||||
for (i = 0; i < decomp.length; ++i) {
|
||||
a = recursiveDecomp(cano, UChar.fromCharCode(decomp[i]));
|
||||
// Ret.concat(a); //<-why does not this work?
|
||||
// following block is a workaround.
|
||||
for (j = 0; j < a.length; ++j) ret.push(a[j]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return [ucharLoc];
|
||||
};
|
||||
if (this.resBuf.length === 0) {
|
||||
uchar = this.it.next();
|
||||
if (!uchar) return null;
|
||||
this.resBuf = recursiveDecomp(this.canonical, uchar);
|
||||
}
|
||||
return this.resBuf.shift();
|
||||
};
|
||||
|
||||
DecompIterator = function (it) {
|
||||
this.it = it;
|
||||
this.resBuf = [];
|
||||
};
|
||||
|
||||
DecompIterator.prototype.next = function () {
|
||||
var cc, uchar, inspt, uchar2, cc2;
|
||||
if (this.resBuf.length === 0) {
|
||||
do {
|
||||
uchar = this.it.next();
|
||||
if (!uchar) break;
|
||||
cc = uchar.getCanonicalClass();
|
||||
inspt = this.resBuf.length;
|
||||
if (cc !== 0) {
|
||||
for (inspt; inspt > 0; --inspt) {
|
||||
uchar2 = this.resBuf[inspt - 1];
|
||||
cc2 = uchar2.getCanonicalClass();
|
||||
// eslint-disable-next-line max-depth
|
||||
if (cc2 <= cc) break;
|
||||
}
|
||||
}
|
||||
this.resBuf.splice(inspt, 0, uchar);
|
||||
} while (cc !== 0);
|
||||
}
|
||||
return this.resBuf.shift();
|
||||
};
|
||||
|
||||
CompIterator = function (it) {
|
||||
this.it = it;
|
||||
this.procBuf = [];
|
||||
this.resBuf = [];
|
||||
this.lastClass = null;
|
||||
};
|
||||
|
||||
CompIterator.prototype.next = function () {
|
||||
var uchar, starter, composite, cc;
|
||||
while (this.resBuf.length === 0) {
|
||||
uchar = this.it.next();
|
||||
if (!uchar) {
|
||||
this.resBuf = this.procBuf;
|
||||
this.procBuf = [];
|
||||
break;
|
||||
}
|
||||
if (this.procBuf.length === 0) {
|
||||
this.lastClass = uchar.getCanonicalClass();
|
||||
this.procBuf.push(uchar);
|
||||
} else {
|
||||
starter = this.procBuf[0];
|
||||
composite = starter.getComposite(uchar);
|
||||
cc = uchar.getCanonicalClass();
|
||||
if (Boolean(composite) && (this.lastClass < cc || this.lastClass === 0)) {
|
||||
this.procBuf[0] = composite;
|
||||
} else {
|
||||
if (cc === 0) {
|
||||
this.resBuf = this.procBuf;
|
||||
this.procBuf = [];
|
||||
}
|
||||
this.lastClass = cc;
|
||||
this.procBuf.push(uchar);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.resBuf.shift();
|
||||
};
|
||||
|
||||
createIterator = function (mode, str) {
|
||||
switch (mode) {
|
||||
case "NFD":
|
||||
return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true));
|
||||
case "NFKD":
|
||||
return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false));
|
||||
case "NFC":
|
||||
return new CompIterator(
|
||||
new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true))
|
||||
);
|
||||
case "NFKC":
|
||||
return new CompIterator(
|
||||
new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false))
|
||||
);
|
||||
default:
|
||||
throw new Error(mode + " is invalid");
|
||||
}
|
||||
};
|
||||
normalize = function (mode, str) {
|
||||
var it = createIterator(mode, str), ret = "", uchar;
|
||||
while ((uchar = it.next())) ret += uchar.toString();
|
||||
return ret;
|
||||
};
|
||||
|
||||
/* Unicode data */
|
||||
UChar.udata = data;
|
||||
|
||||
module.exports = function (/* Form*/) {
|
||||
var str = String(validValue(this)), form = arguments[0];
|
||||
if (form === undefined) form = "NFC";
|
||||
else form = String(form);
|
||||
if (!forms[form]) throw new RangeError("Invalid normalization form: " + form);
|
||||
return normalize(form, str);
|
||||
};
|
16
web/node_modules/es5-ext/string/#/pad.js
generated
vendored
Normal file
16
web/node_modules/es5-ext/string/#/pad.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
var toInteger = require("../../number/to-integer")
|
||||
, value = require("../../object/valid-value")
|
||||
, repeat = require("./repeat")
|
||||
, abs = Math.abs
|
||||
, max = Math.max;
|
||||
|
||||
module.exports = function (fill/*, length*/) {
|
||||
var self = String(value(this)), sLength = self.length, length = arguments[1];
|
||||
|
||||
length = isNaN(length) ? 1 : toInteger(length);
|
||||
fill = repeat.call(String(fill), abs(length));
|
||||
if (length >= 0) return fill.slice(0, max(0, length - sLength)) + self;
|
||||
return self + (sLength + length >= 0 ? "" : fill.slice(length + sLength));
|
||||
};
|
16
web/node_modules/es5-ext/string/#/plain-replace-all.js
generated
vendored
Normal file
16
web/node_modules/es5-ext/string/#/plain-replace-all.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
var value = require("../../object/valid-value");
|
||||
|
||||
module.exports = function (search, replace) {
|
||||
var index, pos = 0, str = String(value(this)), sl, rl;
|
||||
search = String(search);
|
||||
replace = String(replace);
|
||||
sl = search.length;
|
||||
rl = replace.length;
|
||||
while ((index = str.indexOf(search, pos)) !== -1) {
|
||||
str = str.slice(0, index) + replace + str.slice(index + sl);
|
||||
pos = index + rl;
|
||||
}
|
||||
return str;
|
||||
};
|
9
web/node_modules/es5-ext/string/#/plain-replace.js
generated
vendored
Normal file
9
web/node_modules/es5-ext/string/#/plain-replace.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
"use strict";
|
||||
|
||||
var indexOf = String.prototype.indexOf, slice = String.prototype.slice;
|
||||
|
||||
module.exports = function (search, replace) {
|
||||
var index = indexOf.call(this, search);
|
||||
if (index === -1) return String(this);
|
||||
return slice.call(this, 0, index) + replace + slice.call(this, index + String(search).length);
|
||||
};
|
10
web/node_modules/es5-ext/string/#/repeat/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/repeat/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, "repeat", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/string/#/repeat/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/string/#/repeat/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.repeat : require("./shim");
|
8
web/node_modules/es5-ext/string/#/repeat/is-implemented.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/repeat/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var str = "foo";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.repeat !== "function") return false;
|
||||
return str.repeat(2) === "foofoo";
|
||||
};
|
24
web/node_modules/es5-ext/string/#/repeat/shim.js
generated
vendored
Normal file
24
web/node_modules/es5-ext/string/#/repeat/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Thanks
|
||||
// @rauchma http://www.2ality.com/2014/01/efficient-string-repeat.html
|
||||
// @mathiasbynens https://github.com/mathiasbynens/String.prototype.repeat/blob/4a4b567def/repeat.js
|
||||
|
||||
"use strict";
|
||||
|
||||
var value = require("../../../object/valid-value")
|
||||
, toInteger = require("../../../number/to-integer");
|
||||
|
||||
module.exports = function (count) {
|
||||
var str = String(value(this)), result;
|
||||
count = toInteger(count);
|
||||
if (count < 0) throw new RangeError("Count must be >= 0");
|
||||
if (!isFinite(count)) throw new RangeError("Count must be < ∞");
|
||||
|
||||
result = "";
|
||||
while (count) {
|
||||
if (count % 2) result += str;
|
||||
if (count > 1) str += str;
|
||||
// eslint-disable-next-line no-bitwise
|
||||
count >>= 1;
|
||||
}
|
||||
return result;
|
||||
};
|
10
web/node_modules/es5-ext/string/#/starts-with/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/string/#/starts-with/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(String.prototype, "startsWith", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/string/#/starts-with/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/string/#/starts-with/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.startsWith : require("./shim");
|
8
web/node_modules/es5-ext/string/#/starts-with/is-implemented.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/starts-with/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var str = "razdwatrzy";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.startsWith !== "function") return false;
|
||||
return str.startsWith("trzy") === false && str.startsWith("raz") === true;
|
||||
};
|
12
web/node_modules/es5-ext/string/#/starts-with/shim.js
generated
vendored
Normal file
12
web/node_modules/es5-ext/string/#/starts-with/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
|
||||
var value = require("../../../object/valid-value")
|
||||
, toInteger = require("../../../number/to-integer")
|
||||
, max = Math.max
|
||||
, min = Math.min;
|
||||
|
||||
module.exports = function (searchString/*, position*/) {
|
||||
var start, self = String(value(this));
|
||||
start = min(max(toInteger(arguments[1]), 0), self.length);
|
||||
return self.indexOf(searchString, start) === start;
|
||||
};
|
8
web/node_modules/es5-ext/string/#/uncapitalize.js
generated
vendored
Normal file
8
web/node_modules/es5-ext/string/#/uncapitalize.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
var ensureStringifiable = require("../../object/validate-stringifiable-value");
|
||||
|
||||
module.exports = function () {
|
||||
var str = ensureStringifiable(this);
|
||||
return str.charAt(0).toLowerCase() + str.slice(1);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue