mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
6
node_modules/es5-ext/string/#/@@iterator/implement.js
generated
vendored
Normal file
6
node_modules/es5-ext/string/#/@@iterator/implement.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, require('es6-symbol').iterator,
|
||||
{ value: require('./shim'), configurable: true, enumerable: false, writable: true });
|
||||
}
|
||||
4
node_modules/es5-ext/string/#/@@iterator/index.js
generated
vendored
Normal file
4
node_modules/es5-ext/string/#/@@iterator/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype[require('es6-symbol').iterator] : require('./shim');
|
||||
16
node_modules/es5-ext/string/#/@@iterator/is-implemented.js
generated
vendored
Normal file
16
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
node_modules/es5-ext/string/#/@@iterator/shim.js
generated
vendored
Normal file
6
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)); };
|
||||
33
node_modules/es5-ext/string/#/at.js
generated
vendored
Normal file
33
node_modules/es5-ext/string/#/at.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// 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`
|
||||
pos = 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);
|
||||
};
|
||||
10
node_modules/es5-ext/string/#/camel-to-hyphen.js
generated
vendored
Normal file
10
node_modules/es5-ext/string/#/camel-to-hyphen.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'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
node_modules/es5-ext/string/#/capitalize.js
generated
vendored
Normal file
8
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
node_modules/es5-ext/string/#/case-insensitive-compare.js
generated
vendored
Normal file
7
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)));
|
||||
};
|
||||
7
node_modules/es5-ext/string/#/code-point-at/implement.js
generated
vendored
Normal file
7
node_modules/es5-ext/string/#/code-point-at/implement.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, 'codePointAt',
|
||||
{ value: require('./shim'), configurable: true, enumerable: false,
|
||||
writable: true });
|
||||
}
|
||||
5
node_modules/es5-ext/string/#/code-point-at/index.js
generated
vendored
Normal file
5
node_modules/es5-ext/string/#/code-point-at/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype.codePointAt
|
||||
: require('./shim');
|
||||
8
node_modules/es5-ext/string/#/code-point-at/is-implemented.js
generated
vendored
Normal file
8
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
node_modules/es5-ext/string/#/code-point-at/shim.js
generated
vendored
Normal file
26
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)), l = str.length, first, second;
|
||||
pos = toInteger(pos);
|
||||
|
||||
// Account for out-of-bounds indices:
|
||||
if (pos < 0 || pos >= l) return undefined;
|
||||
|
||||
// Get the first code unit
|
||||
first = str.charCodeAt(pos);
|
||||
if ((first >= 0xD800) && (first <= 0xDBFF) && (l > 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;
|
||||
};
|
||||
7
node_modules/es5-ext/string/#/contains/implement.js
generated
vendored
Normal file
7
node_modules/es5-ext/string/#/contains/implement.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, 'contains',
|
||||
{ value: require('./shim'), configurable: true, enumerable: false,
|
||||
writable: true });
|
||||
}
|
||||
5
node_modules/es5-ext/string/#/contains/index.js
generated
vendored
Normal file
5
node_modules/es5-ext/string/#/contains/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype.contains
|
||||
: require('./shim');
|
||||
8
node_modules/es5-ext/string/#/contains/is-implemented.js
generated
vendored
Normal file
8
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
node_modules/es5-ext/string/#/contains/shim.js
generated
vendored
Normal file
7
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;
|
||||
};
|
||||
7
node_modules/es5-ext/string/#/ends-with/implement.js
generated
vendored
Normal file
7
node_modules/es5-ext/string/#/ends-with/implement.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, 'endsWith',
|
||||
{ value: require('./shim'), configurable: true, enumerable: false,
|
||||
writable: true });
|
||||
}
|
||||
5
node_modules/es5-ext/string/#/ends-with/index.js
generated
vendored
Normal file
5
node_modules/es5-ext/string/#/ends-with/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype.endsWith
|
||||
: require('./shim');
|
||||
8
node_modules/es5-ext/string/#/ends-with/is-implemented.js
generated
vendored
Normal file
8
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));
|
||||
};
|
||||
16
node_modules/es5-ext/string/#/ends-with/shim.js
generated
vendored
Normal file
16
node_modules/es5-ext/string/#/ends-with/shim.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var toInteger = require('../../../number/to-integer')
|
||||
, value = require('../../../object/valid-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 = ((endPos == null) ? self.length :
|
||||
min(max(toInteger(endPos), 0), self.length)) - searchString.length;
|
||||
return (start < 0) ? false : (self.indexOf(searchString, start) === start);
|
||||
};
|
||||
8
node_modules/es5-ext/string/#/hyphen-to-camel.js
generated
vendored
Normal file
8
node_modules/es5-ext/string/#/hyphen-to-camel.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var replace = String.prototype.replace
|
||||
|
||||
, re = /-([a-z0-9])/g
|
||||
, toUpperCase = function (m, a) { return a.toUpperCase(); };
|
||||
|
||||
module.exports = function () { return replace.call(this, re, toUpperCase); };
|
||||
12
node_modules/es5-ext/string/#/indent.js
generated
vendored
Normal file
12
node_modules/es5-ext/string/#/indent.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var 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), (count == null) ? 1 : count);
|
||||
return indent + replace.call(this, re, '$1' + indent + '$2');
|
||||
};
|
||||
22
node_modules/es5-ext/string/#/index.js
generated
vendored
Normal file
22
node_modules/es5-ext/string/#/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
'@@iterator': require('./@@iterator'),
|
||||
at: require('./at'),
|
||||
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
node_modules/es5-ext/string/#/last.js
generated
vendored
Normal file
8
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)), l = self.length;
|
||||
return l ? self[l - 1] : null;
|
||||
};
|
||||
69
node_modules/es5-ext/string/#/normalize/_data.js
generated
vendored
Normal file
69
node_modules/es5-ext/string/#/normalize/_data.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/es5-ext/string/#/normalize/implement.js
generated
vendored
Normal file
7
node_modules/es5-ext/string/#/normalize/implement.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, 'normalize',
|
||||
{ value: require('./shim'), configurable: true, enumerable: false,
|
||||
writable: true });
|
||||
}
|
||||
5
node_modules/es5-ext/string/#/normalize/index.js
generated
vendored
Normal file
5
node_modules/es5-ext/string/#/normalize/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype.normalize
|
||||
: require('./shim');
|
||||
8
node_modules/es5-ext/string/#/normalize/is-implemented.js
generated
vendored
Normal file
8
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') === 'æøåäüö';
|
||||
};
|
||||
289
node_modules/es5-ext/string/#/normalize/shim.js
generated
vendored
Normal file
289
node_modules/es5-ext/string/#/normalize/shim.js
generated
vendored
Normal file
@@ -0,0 +1,289 @@
|
||||
// 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')
|
||||
|
||||
, 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 = [], i, fromCache, fromData, fromCpOnly
|
||||
, fromRuleBasedJamo, fromCpFilter, strategies, UCharIterator
|
||||
, RecursDecompIterator, DecompIterator, CompIterator, createIterator
|
||||
, normalize;
|
||||
|
||||
UChar = function (cp, feature) {
|
||||
this.codepoint = cp;
|
||||
this.feature = feature;
|
||||
};
|
||||
|
||||
// Strategies
|
||||
for (i = 0; i <= 0xFF; ++i) cacheCounter[i] = 0;
|
||||
|
||||
fromCache = function (next, cp, needFeature) {
|
||||
var ret = cache[cp];
|
||||
if (!ret) {
|
||||
ret = next(cp, needFeature);
|
||||
if (!!ret.feature && ++cacheCounter[(cp >> 8) & 0xFF] > CACHE_THRESHOLD) {
|
||||
cache[cp] = ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
fromData = function (next, cp, needFeature) {
|
||||
var hash = cp & 0xFF00, dunit = UChar.udata[hash] || {}, f = dunit[cp];
|
||||
return f ? new UChar(cp, f) : 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 c, 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) {
|
||||
c = {};
|
||||
base = (cp - LBase) * VCount;
|
||||
for (i = 0; i < VCount; ++i) {
|
||||
c[VBase + i] = SBase + TCount * (i + base);
|
||||
}
|
||||
arr = new Array(3);
|
||||
arr[2] = c;
|
||||
return new UChar(cp, arr);
|
||||
}
|
||||
|
||||
SIndex = cp - SBase;
|
||||
TIndex = SIndex % TCount;
|
||||
feature = [];
|
||||
if (TIndex !== 0) {
|
||||
feature[0] = [SBase + SIndex - TIndex, TBase + TIndex];
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
return new UChar(cp, feature);
|
||||
};
|
||||
|
||||
fromCpFilter = function (next, cp, needFeature) {
|
||||
return (cp < 60) || ((13311 < cp) && (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 x;
|
||||
if (this.codepoint < 0x10000) return String.fromCharCode(this.codepoint);
|
||||
x = this.codepoint - 0x10000;
|
||||
return String.fromCharCode(floor(x / 0x400) + 0xD800, x % 0x400 + 0xDC00);
|
||||
};
|
||||
|
||||
UChar.prototype.getDecomp = function () {
|
||||
this.prepFeature();
|
||||
return this.feature[0] || null;
|
||||
};
|
||||
|
||||
UChar.prototype.isCompatibility = function () {
|
||||
this.prepFeature();
|
||||
return !!this.feature[1] && (this.feature[1] & (1 << 8));
|
||||
};
|
||||
UChar.prototype.isExclude = function () {
|
||||
this.prepFeature();
|
||||
return !!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 (!!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, uchar) {
|
||||
var decomp = uchar.getDecomp(), ret, i, a, j;
|
||||
if (!!decomp && !(cano && uchar.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 [uchar];
|
||||
};
|
||||
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();
|
||||
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 (!!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)
|
||||
));
|
||||
}
|
||||
throw 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);
|
||||
};
|
||||
18
node_modules/es5-ext/string/#/pad.js
generated
vendored
Normal file
18
node_modules/es5-ext/string/#/pad.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'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
node_modules/es5-ext/string/#/plain-replace-all.js
generated
vendored
Normal file
16
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;
|
||||
};
|
||||
10
node_modules/es5-ext/string/#/plain-replace.js
generated
vendored
Normal file
10
node_modules/es5-ext/string/#/plain-replace.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'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);
|
||||
};
|
||||
7
node_modules/es5-ext/string/#/repeat/implement.js
generated
vendored
Normal file
7
node_modules/es5-ext/string/#/repeat/implement.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, 'repeat',
|
||||
{ value: require('./shim'), configurable: true, enumerable: false,
|
||||
writable: true });
|
||||
}
|
||||
5
node_modules/es5-ext/string/#/repeat/index.js
generated
vendored
Normal file
5
node_modules/es5-ext/string/#/repeat/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype.repeat
|
||||
: require('./shim');
|
||||
8
node_modules/es5-ext/string/#/repeat/is-implemented.js
generated
vendored
Normal file
8
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');
|
||||
};
|
||||
22
node_modules/es5-ext/string/#/repeat/shim.js
generated
vendored
Normal file
22
node_modules/es5-ext/string/#/repeat/shim.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Thanks: http://www.2ality.com/2014/01/efficient-string-repeat.html
|
||||
|
||||
'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 = '';
|
||||
if (!count) return result;
|
||||
while (true) {
|
||||
if (count & 1) result += str;
|
||||
count >>>= 1;
|
||||
if (count <= 0) break;
|
||||
str += str;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
7
node_modules/es5-ext/string/#/starts-with/implement.js
generated
vendored
Normal file
7
node_modules/es5-ext/string/#/starts-with/implement.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (!require('./is-implemented')()) {
|
||||
Object.defineProperty(String.prototype, 'startsWith',
|
||||
{ value: require('./shim'), configurable: true, enumerable: false,
|
||||
writable: true });
|
||||
}
|
||||
5
node_modules/es5-ext/string/#/starts-with/index.js
generated
vendored
Normal file
5
node_modules/es5-ext/string/#/starts-with/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./is-implemented')()
|
||||
? String.prototype.startsWith
|
||||
: require('./shim');
|
||||
9
node_modules/es5-ext/string/#/starts-with/is-implemented.js
generated
vendored
Normal file
9
node_modules/es5-ext/string/#/starts-with/is-implemented.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'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
node_modules/es5-ext/string/#/starts-with/shim.js
generated
vendored
Normal file
12
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
node_modules/es5-ext/string/#/uncapitalize.js
generated
vendored
Normal file
8
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);
|
||||
};
|
||||
Reference in New Issue
Block a user