0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/@@iterator/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,9 @@
"use strict";
module.exports = function (t, a) {
var it = t.call("r💩z");
a.deep(it.next(), { done: false, value: "r" }, "#1");
a.deep(it.next(), { done: false, value: "💩" }, "#2");
a.deep(it.next(), { done: false, value: "z" }, "#3");
a.deep(it.next(), { done: true, value: undefined }, "End");
};

97
web/node_modules/es5-ext/test/string/#/at.js generated vendored Normal file
View file

@ -0,0 +1,97 @@
/* eslint no-useless-call: "off" */
// See tests at https://github.com/mathiasbynens/String.prototype.at
"use strict";
module.exports = function (t, a) {
a(t.length, 1, "Length");
a.h1("BMP");
a(t.call("abc\uD834\uDF06def", -Infinity), "", "-Infinity");
a(t.call("abc\uD834\uDF06def", -1), "", "-1");
a(t.call("abc\uD834\uDF06def", -0), "a", "-0");
a(t.call("abc\uD834\uDF06def", +0), "a", "+0");
a(t.call("abc\uD834\uDF06def", 1), "b", "1");
a(t.call("abc\uD834\uDF06def", 3), "\uD834\uDF06", "3");
a(t.call("abc\uD834\uDF06def", 4), "\uDF06", "4");
a(t.call("abc\uD834\uDF06def", 5), "d", "5");
a(t.call("abc\uD834\uDF06def", 42), "", "42");
a(t.call("abc\uD834\uDF06def", Number(Infinity)), "", "+Infinity");
a(t.call("abc\uD834\uDF06def", null), "a", "null");
a(t.call("abc\uD834\uDF06def", undefined), "a", "undefined");
a(t.call("abc\uD834\uDF06def"), "a", "No argument");
a(t.call("abc\uD834\uDF06def", false), "a", "false");
a(t.call("abc\uD834\uDF06def", NaN), "a", "NaN");
a(t.call("abc\uD834\uDF06def", ""), "a", "Empty string");
a(t.call("abc\uD834\uDF06def", "_"), "a", "_");
a(t.call("abc\uD834\uDF06def", "1"), "b", "'1'");
a(t.call("abc\uD834\uDF06def", []), "a", "[]");
a(t.call("abc\uD834\uDF06def", {}), "a", "{}");
a(t.call("abc\uD834\uDF06def", -0.9), "a", "-0.9");
a(t.call("abc\uD834\uDF06def", 1.9), "b", "1.9");
a(t.call("abc\uD834\uDF06def", 7.9), "f", "7.9");
a(t.call("abc\uD834\uDF06def", Math.pow(2, 32)), "", "Big number");
a.h1("Astral symbol");
a(t.call("\uD834\uDF06def", -Infinity), "", "-Infinity");
a(t.call("\uD834\uDF06def", -1), "", "-1");
a(t.call("\uD834\uDF06def", -0), "\uD834\uDF06", "-0");
a(t.call("\uD834\uDF06def", +0), "\uD834\uDF06", "+0");
a(t.call("\uD834\uDF06def", 1), "\uDF06", "1");
a(t.call("\uD834\uDF06def", 2), "d", "2");
a(t.call("\uD834\uDF06def", 3), "e", "3");
a(t.call("\uD834\uDF06def", 4), "f", "4");
a(t.call("\uD834\uDF06def", 42), "", "42");
a(t.call("\uD834\uDF06def", Number(Infinity)), "", "+Infinity");
a(t.call("\uD834\uDF06def", null), "\uD834\uDF06", "null");
a(t.call("\uD834\uDF06def", undefined), "\uD834\uDF06", "undefined");
a(t.call("\uD834\uDF06def"), "\uD834\uDF06", "No arguments");
a(t.call("\uD834\uDF06def", false), "\uD834\uDF06", "false");
a(t.call("\uD834\uDF06def", NaN), "\uD834\uDF06", "NaN");
a(t.call("\uD834\uDF06def", ""), "\uD834\uDF06", "Empty string");
a(t.call("\uD834\uDF06def", "_"), "\uD834\uDF06", "_");
a(t.call("\uD834\uDF06def", "1"), "\uDF06", "'1'");
a.h1("Lone high surrogates");
a(t.call("\uD834abc", -Infinity), "", "-Infinity");
a(t.call("\uD834abc", -1), "", "-1");
a(t.call("\uD834abc", -0), "\uD834", "-0");
a(t.call("\uD834abc", +0), "\uD834", "+0");
a(t.call("\uD834abc", 1), "a", "1");
a(t.call("\uD834abc", 42), "", "42");
a(t.call("\uD834abc", Number(Infinity)), "", "Infinity");
a(t.call("\uD834abc", null), "\uD834", "null");
a(t.call("\uD834abc", undefined), "\uD834", "undefined");
a(t.call("\uD834abc"), "\uD834", "No arguments");
a(t.call("\uD834abc", false), "\uD834", "false");
a(t.call("\uD834abc", NaN), "\uD834", "NaN");
a(t.call("\uD834abc", ""), "\uD834", "Empty string");
a(t.call("\uD834abc", "_"), "\uD834", "_");
a(t.call("\uD834abc", "1"), "a", "'a'");
a.h1("Lone low surrogates");
a(t.call("\uDF06abc", -Infinity), "", "-Infinity");
a(t.call("\uDF06abc", -1), "", "-1");
a(t.call("\uDF06abc", -0), "\uDF06", "-0");
a(t.call("\uDF06abc", +0), "\uDF06", "+0");
a(t.call("\uDF06abc", 1), "a", "1");
a(t.call("\uDF06abc", 42), "", "42");
a(t.call("\uDF06abc", Number(Infinity)), "", "+Infinity");
a(t.call("\uDF06abc", null), "\uDF06", "null");
a(t.call("\uDF06abc", undefined), "\uDF06", "undefined");
a(t.call("\uDF06abc"), "\uDF06", "No arguments");
a(t.call("\uDF06abc", false), "\uDF06", "false");
a(t.call("\uDF06abc", NaN), "\uDF06", "NaN");
a(t.call("\uDF06abc", ""), "\uDF06", "Empty string");
a(t.call("\uDF06abc", "_"), "\uDF06", "_");
a(t.call("\uDF06abc", "1"), "a", "'1'");
a.h1("Context");
a.throws(function () { t.call(undefined); }, TypeError, "Undefined");
a.throws(function () { t.call(undefined, 4); }, TypeError, "Undefined + argument");
a.throws(function () { t.call(null); }, TypeError, "Null");
a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument");
a(t.call(42, 0), "4", "Number #1");
a(t.call(42, 1), "2", "Number #2");
a(t.call({ toString: function () { return "abc"; } }, 2), "c", "Object");
};

View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
a(t.call("razDwaTRzy4yFoo45My"), "raz-dwa-t-rzy4y-foo45-my");
a(t.call("razDwaTRzy4yFoo45My-"), "raz-dwa-t-rzy4y-foo45-my-");
a(t.call("razDwaTRzy4yFoo45My--"), "raz-dwa-t-rzy4y-foo45-my--");
};

9
web/node_modules/es5-ext/test/string/#/capitalize.js generated vendored Normal file
View file

@ -0,0 +1,9 @@
"use strict";
module.exports = function (t, a) {
a(t.call("raz"), "Raz", "Word");
a(t.call("BLA"), "BLA", "Uppercase");
a(t.call(""), "", "Empty");
a(t.call("a"), "A", "One letter");
a(t.call("this is a test"), "This is a test", "Sentence");
};

View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
a(t.call("AA", "aa"), 0, "Same");
a.ok(t.call("Amber", "zebra") < 0, "Less");
a.ok(t.call("Zebra", "amber") > 0, "Greater");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/code-point-at/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,83 @@
/* eslint no-useless-call: "off" */
// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt
// /blob/master/tests/tests.js
"use strict";
module.exports = function (t, a) {
a(t.length, 1, "Length");
// String that starts with a BMP symbol
a(t.call("abc\uD834\uDF06def", ""), 0x61);
a(t.call("abc\uD834\uDF06def", "_"), 0x61);
a(t.call("abc\uD834\uDF06def"), 0x61);
a(t.call("abc\uD834\uDF06def", -Infinity), undefined);
a(t.call("abc\uD834\uDF06def", -1), undefined);
a(t.call("abc\uD834\uDF06def", -0), 0x61);
a(t.call("abc\uD834\uDF06def", 0), 0x61);
a(t.call("abc\uD834\uDF06def", 3), 0x1d306);
a(t.call("abc\uD834\uDF06def", 4), 0xdf06);
a(t.call("abc\uD834\uDF06def", 5), 0x64);
a(t.call("abc\uD834\uDF06def", 42), undefined);
a(t.call("abc\uD834\uDF06def", Infinity), undefined);
a(t.call("abc\uD834\uDF06def", Infinity), undefined);
a(t.call("abc\uD834\uDF06def", NaN), 0x61);
a(t.call("abc\uD834\uDF06def", false), 0x61);
a(t.call("abc\uD834\uDF06def", null), 0x61);
a(t.call("abc\uD834\uDF06def", undefined), 0x61);
// String that starts with an astral symbol
a(t.call("\uD834\uDF06def", ""), 0x1d306);
a(t.call("\uD834\uDF06def", "1"), 0xdf06);
a(t.call("\uD834\uDF06def", "_"), 0x1d306);
a(t.call("\uD834\uDF06def"), 0x1d306);
a(t.call("\uD834\uDF06def", -1), undefined);
a(t.call("\uD834\uDF06def", -0), 0x1d306);
a(t.call("\uD834\uDF06def", 0), 0x1d306);
a(t.call("\uD834\uDF06def", 1), 0xdf06);
a(t.call("\uD834\uDF06def", 42), undefined);
a(t.call("\uD834\uDF06def", false), 0x1d306);
a(t.call("\uD834\uDF06def", null), 0x1d306);
a(t.call("\uD834\uDF06def", undefined), 0x1d306);
// Lone high surrogates
a(t.call("\uD834abc", ""), 0xd834);
a(t.call("\uD834abc", "_"), 0xd834);
a(t.call("\uD834abc"), 0xd834);
a(t.call("\uD834abc", -1), undefined);
a(t.call("\uD834abc", -0), 0xd834);
a(t.call("\uD834abc", 0), 0xd834);
a(t.call("\uD834abc", false), 0xd834);
a(t.call("\uD834abc", NaN), 0xd834);
a(t.call("\uD834abc", null), 0xd834);
a(t.call("\uD834abc", undefined), 0xd834);
// Lone low surrogates
a(t.call("\uDF06abc", ""), 0xdf06);
a(t.call("\uDF06abc", "_"), 0xdf06);
a(t.call("\uDF06abc"), 0xdf06);
a(t.call("\uDF06abc", -1), undefined);
a(t.call("\uDF06abc", -0), 0xdf06);
a(t.call("\uDF06abc", 0), 0xdf06);
a(t.call("\uDF06abc", false), 0xdf06);
a(t.call("\uDF06abc", NaN), 0xdf06);
a(t.call("\uDF06abc", null), 0xdf06);
a(t.call("\uDF06abc", undefined), 0xdf06);
a.throws(function () { t.call(undefined); }, TypeError);
a.throws(function () { t.call(undefined, 4); }, TypeError);
a.throws(function () { t.call(null); }, TypeError);
a.throws(function () { t.call(null, 4); }, TypeError);
a(t.call(42, 0), 0x34);
a(t.call(42, 1), 0x32);
a(t.call({ toString: function () { return "abc"; } }, 2), 0x63);
a.throws(function () { t.apply(undefined); }, TypeError);
a.throws(function () { t.apply(undefined, [4]); }, TypeError);
a.throws(function () { t.apply(null); }, TypeError);
a.throws(function () { t.apply(null, [4]); }, TypeError);
a(t.apply(42, [0]), 0x34);
a(t.apply(42, [1]), 0x32);
a(t.apply({ toString: function () { return "abc"; } }, [2]), 0x63);
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/contains/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,14 @@
"use strict";
module.exports = function (t, a) {
a(t.call("raz", ""), true, "Empty");
a(t.call("", ""), true, "Both Empty");
a(t.call("raz", "raz"), true, "Same");
a(t.call("razdwa", "raz"), true, "Starts with");
a(t.call("razdwa", "dwa"), true, "Ends with");
a(t.call("razdwa", "zdw"), true, "In middle");
a(t.call("", "raz"), false, "Something in empty");
a(t.call("az", "raz"), false, "Longer");
a(t.call("azasdfasdf", "azff"), false, "Not found");
a(t.call("razdwa", "raz", 1), false, "Position");
};

12
web/node_modules/es5-ext/test/string/#/count.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
module.exports = function (t, a) {
a.throws(function () { t.call("", ""); });
a(t.call("x", "x"), 1);
a(t.call("xx", "x"), 2);
a(t.call("xxx", "xx"), 1);
a(t.call("xxxx", "xx"), 2);
a(t.call("xx", "xxx"), 0);
a(t.call("", "elo"), 0);
a(t.call("fooo", "foofooo"), 0);
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/ends-with/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,16 @@
// In some parts copied from:
// http://closure-library.googlecode.com/svn/trunk/closure/goog/
// string/string_test.html
"use strict";
module.exports = function (t, a) {
a(t.call("abc", ""), true, "Empty needle");
a(t.call("abcd", "cd"), true, "Ends with needle");
a(t.call("abcd", "abcd"), true, "Needle equals haystack");
a(t.call("abcd", "ab"), false, "Doesn't end with needle");
a(t.call("abc", "defg"), false, "Length trick");
a(t.call("razdwa", "zd", 3), false, "Position: false");
a(t.call("razdwa", "zd", 4), true, "Position: true");
a(t.call("razdwa", "zd", 5), false, "Position: false #2");
};

View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa"), "razDwaTRzy4yRtr4Tiu45Pa");
a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-"), "razDwaTRzy4yRtr4Tiu45Pa-");
a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--"), "razDwaTRzy4yRtr4Tiu45Pa--");
};

8
web/node_modules/es5-ext/test/string/#/indent.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
"use strict";
module.exports = function (t, a) {
a(t.call("ra\nzz", ""), "ra\nzz", "Empty");
a(t.call("ra\nzz", "\t", 3), "\t\t\tra\n\t\t\tzz", "String repeat");
a(t.call("ra\nzz\nsss\nfff\n", "\t"), "\tra\n\tzz\n\tsss\n\tfff\n", "Multi-line");
a(t.call("ra\n\nzz\n", "\t"), "\tra\n\n\tzz\n", "Don't touch empty lines");
};

6
web/node_modules/es5-ext/test/string/#/last.js generated vendored Normal file
View file

@ -0,0 +1,6 @@
"use strict";
module.exports = function (t, a) {
a(t.call(""), null, "Null");
a(t.call("abcdef"), "f", "String");
};

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t[0], "object"); };

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/normalize/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,13 @@
// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js
"use strict";
var str = "äiti";
module.exports = function (t, a) {
a(t.call(str), "\u00e4iti");
a(t.call(str, "NFC"), "\u00e4iti");
a(t.call(str, "NFD"), "a\u0308iti");
a(t.call(str, "NFKC"), "\u00e4iti");
a(t.call(str, "NFKD"), "a\u0308iti");
};

24
web/node_modules/es5-ext/test/string/#/pad.js generated vendored Normal file
View file

@ -0,0 +1,24 @@
"use strict";
var partial = require("../../../function/#/partial");
module.exports = {
Left: function (t, a) {
t = partial.call(t, "x", 5);
a(t.call("yy"), "xxxyy");
a(t.call(""), "xxxxx", "Empty string");
a(t.call("yyyyy"), "yyyyy", "Equal length");
a(t.call("yyyyyyy"), "yyyyyyy", "Longer");
},
Right: function (t, a) {
t = partial.call(t, "x", -5);
a(t.call("yy"), "yyxxx");
a(t.call(""), "xxxxx", "Empty string");
a(t.call("yyyyy"), "yyyyy", "Equal length");
a(t.call("yyyyyyy"), "yyyyyyy", "Longer");
}
};

View file

@ -0,0 +1,10 @@
"use strict";
module.exports = function (t, a) {
a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic");
a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts");
a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace");
a(t.call("$raz$$dwa$trzy$", "$", "&&"), "&&raz&&&&dwa&&trzy&&", "Multi");
a(t.call("$raz$$dwa$$$$trzy$", "$$", "&"), "$raz&dwa&&trzy$", "Multi many chars");
};

View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic");
a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts");
a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/repeat/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

12
web/node_modules/es5-ext/test/string/#/repeat/shim.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
module.exports = function (t, a) {
a(t.call("a", 0), "", "Empty");
a(t.call("a", 1), "a", "1");
a(t.call("a", 2), "aa", "2");
a(t.call("\t", 5), "\t\t\t\t\t", "Whitespace");
a(t.call("raz", 3), "razrazraz", "Many chars");
a(t.call("raz", 3), "razrazraz", "Many chars");
a(t.call("razfoobar", 5), "razfoobarrazfoobarrazfoobarrazfoobarrazfoobar", "Many chars");
a(t.call("a", 300).length, 300);
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../string/#/starts-with/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,14 @@
// Inspired and in some parts copied from:
// http://closure-library.googlecode.com/svn/trunk/closure/goog
// /string/string_test.html
"use strict";
module.exports = function (t, a) {
a(t.call("abc", ""), true, "Empty needle");
a(t.call("abcd", "ab"), true, "Starts with needle");
a(t.call("abcd", "abcd"), true, "Needle equals haystack");
a(t.call("abcd", "bcde", 1), false, "Needle larger than haystack");
a(!t.call("abcd", "cd"), true, "Doesn't start with needle");
a(t.call("abcd", "bc", 1), true, "Position");
};

10
web/node_modules/es5-ext/test/string/#/uncapitalize.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
"use strict";
module.exports = function (t, a) {
a(t.call("raz"), "raz", "Word");
a(t.call("BLA"), "bLA", "Uppercase");
a(t.call(""), "", "Empty");
a(t.call("a"), "a", "One letter");
a(t.call("this is a test"), "this is a test", "Sentence");
a(t.call("This is a test"), "this is a test", "Capitalized sentence");
};