Set up comprehensive frontend testing infrastructure
- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
14
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.d.ts
generated
vendored
Normal file
14
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
declare global {
|
||||
class Set<T> {
|
||||
constructor(items?: T[]);
|
||||
add(value: T): this;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: unknown): void;
|
||||
has(value: T): boolean;
|
||||
readonly size: number;
|
||||
}
|
||||
}
|
||||
declare const _default: typeof Set;
|
||||
export default _default;
|
||||
//# sourceMappingURL=SetLike.d.ts.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.d.ts.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SetLike.d.ts","sourceRoot":"","sources":["../../sources/polyfills/SetLike.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACd,MAAM,GAAG,CAAC,CAAC;oBAEE,KAAK,CAAC,EAAE,CAAC,EAAE;QACvB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;QACnB,KAAK,IAAI,IAAI;QACb,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;QACzB,OAAO,CACN,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EACtD,OAAO,CAAC,EAAE,OAAO,GACf,IAAI;QACP,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KAItB;CACD;;AAuCD,wBAA0D"}
|
||||
65
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.js
generated
vendored
Normal file
65
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
// for environments without Set we fallback to arrays with unique members
|
||||
var SetLike = /*#__PURE__*/function () {
|
||||
function SetLike() {
|
||||
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
_classCallCheck(this, SetLike);
|
||||
_defineProperty(this, "items", void 0);
|
||||
this.items = items;
|
||||
}
|
||||
_createClass(SetLike, [{
|
||||
key: "add",
|
||||
value: function add(value) {
|
||||
if (this.has(value) === false) {
|
||||
this.items.push(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "clear",
|
||||
value: function clear() {
|
||||
this.items = [];
|
||||
}
|
||||
}, {
|
||||
key: "delete",
|
||||
value: function _delete(value) {
|
||||
var previousLength = this.items.length;
|
||||
this.items = this.items.filter(function (item) {
|
||||
return item !== value;
|
||||
});
|
||||
return previousLength !== this.items.length;
|
||||
}
|
||||
}, {
|
||||
key: "forEach",
|
||||
value: function forEach(callbackfn) {
|
||||
var _this = this;
|
||||
this.items.forEach(function (item) {
|
||||
callbackfn(item, item, _this);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "has",
|
||||
value: function has(value) {
|
||||
return this.items.indexOf(value) !== -1;
|
||||
}
|
||||
}, {
|
||||
key: "size",
|
||||
get: function get() {
|
||||
return this.items.length;
|
||||
}
|
||||
}]);
|
||||
return SetLike;
|
||||
}();
|
||||
var _default = typeof Set === "undefined" ? Set : SetLike;
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=SetLike.js.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.js.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SetLike.js","names":["SetLike","items","value","has","push","previousLength","length","filter","item","callbackfn","forEach","indexOf","Set"],"sources":["../../sources/polyfills/SetLike.ts"],"sourcesContent":["declare global {\n\tclass Set<T> {\n\t\t// es2015.collection.d.ts\n\t\tconstructor(items?: T[]);\n\t\tadd(value: T): this;\n\t\tclear(): void;\n\t\tdelete(value: T): boolean;\n\t\tforEach(\n\t\t\tcallbackfn: (value: T, value2: T, set: Set<T>) => void,\n\t\t\tthisArg?: unknown\n\t\t): void;\n\t\thas(value: T): boolean;\n\t\treadonly size: number;\n\n\t\t// es2015.iterable.d.ts\n\t\t// no implemennted\n\t}\n}\n\n// for environments without Set we fallback to arrays with unique members\nclass SetLike<T> implements Set<T> {\n\tprivate items: T[];\n\n\tconstructor(items: T[] = []) {\n\t\tthis.items = items;\n\t}\n\n\tadd(value: T): this {\n\t\tif (this.has(value) === false) {\n\t\t\tthis.items.push(value);\n\t\t}\n\t\treturn this;\n\t}\n\tclear(): void {\n\t\tthis.items = [];\n\t}\n\tdelete(value: T): boolean {\n\t\tconst previousLength = this.items.length;\n\t\tthis.items = this.items.filter((item) => item !== value);\n\n\t\treturn previousLength !== this.items.length;\n\t}\n\tforEach(callbackfn: (value: T, value2: T, set: Set<T>) => void): void {\n\t\tthis.items.forEach((item) => {\n\t\t\tcallbackfn(item, item, this);\n\t\t});\n\t}\n\thas(value: T): boolean {\n\t\treturn this.items.indexOf(value) !== -1;\n\t}\n\n\tget size(): number {\n\t\treturn this.items.length;\n\t}\n}\n\nexport default typeof Set === \"undefined\" ? Set : SetLike;\n"],"mappings":";;;;;;;;;;;AAmBA;AAAA,IACMA,OAAO;EAGZ,mBAA6B;IAAA,IAAjBC,KAAU,uEAAG,EAAE;IAAA;IAAA;IAC1B,IAAI,CAACA,KAAK,GAAGA,KAAK;EACnB;EAAC;IAAA;IAAA,OAED,aAAIC,KAAQ,EAAQ;MACnB,IAAI,IAAI,CAACC,GAAG,CAACD,KAAK,CAAC,KAAK,KAAK,EAAE;QAC9B,IAAI,CAACD,KAAK,CAACG,IAAI,CAACF,KAAK,CAAC;MACvB;MACA,OAAO,IAAI;IACZ;EAAC;IAAA;IAAA,OACD,iBAAc;MACb,IAAI,CAACD,KAAK,GAAG,EAAE;IAChB;EAAC;IAAA;IAAA,OACD,iBAAOC,KAAQ,EAAW;MACzB,IAAMG,cAAc,GAAG,IAAI,CAACJ,KAAK,CAACK,MAAM;MACxC,IAAI,CAACL,KAAK,GAAG,IAAI,CAACA,KAAK,CAACM,MAAM,CAAC,UAACC,IAAI;QAAA,OAAKA,IAAI,KAAKN,KAAK;MAAA,EAAC;MAExD,OAAOG,cAAc,KAAK,IAAI,CAACJ,KAAK,CAACK,MAAM;IAC5C;EAAC;IAAA;IAAA,OACD,iBAAQG,UAAsD,EAAQ;MAAA;MACrE,IAAI,CAACR,KAAK,CAACS,OAAO,CAAC,UAACF,IAAI,EAAK;QAC5BC,UAAU,CAACD,IAAI,EAAEA,IAAI,EAAE,KAAI,CAAC;MAC7B,CAAC,CAAC;IACH;EAAC;IAAA;IAAA,OACD,aAAIN,KAAQ,EAAW;MACtB,OAAO,IAAI,CAACD,KAAK,CAACU,OAAO,CAACT,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC;EAAC;IAAA;IAAA,KAED,eAAmB;MAClB,OAAO,IAAI,CAACD,KAAK,CAACK,MAAM;IACzB;EAAC;EAAA;AAAA;AAAA,eAGa,OAAOM,GAAG,KAAK,WAAW,GAAGA,GAAG,GAAGZ,OAAO;AAAA"}
|
||||
60
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.mjs
generated
vendored
Normal file
60
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.mjs
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
// for environments without Set we fallback to arrays with unique members
|
||||
var SetLike = /*#__PURE__*/function () {
|
||||
function SetLike() {
|
||||
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
_classCallCheck(this, SetLike);
|
||||
_defineProperty(this, "items", void 0);
|
||||
this.items = items;
|
||||
}
|
||||
_createClass(SetLike, [{
|
||||
key: "add",
|
||||
value: function add(value) {
|
||||
if (this.has(value) === false) {
|
||||
this.items.push(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "clear",
|
||||
value: function clear() {
|
||||
this.items = [];
|
||||
}
|
||||
}, {
|
||||
key: "delete",
|
||||
value: function _delete(value) {
|
||||
var previousLength = this.items.length;
|
||||
this.items = this.items.filter(function (item) {
|
||||
return item !== value;
|
||||
});
|
||||
return previousLength !== this.items.length;
|
||||
}
|
||||
}, {
|
||||
key: "forEach",
|
||||
value: function forEach(callbackfn) {
|
||||
var _this = this;
|
||||
this.items.forEach(function (item) {
|
||||
callbackfn(item, item, _this);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "has",
|
||||
value: function has(value) {
|
||||
return this.items.indexOf(value) !== -1;
|
||||
}
|
||||
}, {
|
||||
key: "size",
|
||||
get: function get() {
|
||||
return this.items.length;
|
||||
}
|
||||
}]);
|
||||
return SetLike;
|
||||
}();
|
||||
export default typeof Set === "undefined" ? Set : SetLike;
|
||||
//# sourceMappingURL=SetLike.mjs.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/SetLike.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SetLike.mjs","names":["SetLike","items","value","has","push","previousLength","length","filter","item","callbackfn","forEach","indexOf","Set"],"sources":["../../sources/polyfills/SetLike.ts"],"sourcesContent":["declare global {\n\tclass Set<T> {\n\t\t// es2015.collection.d.ts\n\t\tconstructor(items?: T[]);\n\t\tadd(value: T): this;\n\t\tclear(): void;\n\t\tdelete(value: T): boolean;\n\t\tforEach(\n\t\t\tcallbackfn: (value: T, value2: T, set: Set<T>) => void,\n\t\t\tthisArg?: unknown\n\t\t): void;\n\t\thas(value: T): boolean;\n\t\treadonly size: number;\n\n\t\t// es2015.iterable.d.ts\n\t\t// no implemennted\n\t}\n}\n\n// for environments without Set we fallback to arrays with unique members\nclass SetLike<T> implements Set<T> {\n\tprivate items: T[];\n\n\tconstructor(items: T[] = []) {\n\t\tthis.items = items;\n\t}\n\n\tadd(value: T): this {\n\t\tif (this.has(value) === false) {\n\t\t\tthis.items.push(value);\n\t\t}\n\t\treturn this;\n\t}\n\tclear(): void {\n\t\tthis.items = [];\n\t}\n\tdelete(value: T): boolean {\n\t\tconst previousLength = this.items.length;\n\t\tthis.items = this.items.filter((item) => item !== value);\n\n\t\treturn previousLength !== this.items.length;\n\t}\n\tforEach(callbackfn: (value: T, value2: T, set: Set<T>) => void): void {\n\t\tthis.items.forEach((item) => {\n\t\t\tcallbackfn(item, item, this);\n\t\t});\n\t}\n\thas(value: T): boolean {\n\t\treturn this.items.indexOf(value) !== -1;\n\t}\n\n\tget size(): number {\n\t\treturn this.items.length;\n\t}\n}\n\nexport default typeof Set === \"undefined\" ? Set : SetLike;\n"],"mappings":";;;;;;;AAmBA;AAAA,IACMA,OAAO;EAGZ,mBAA6B;IAAA,IAAjBC,KAAU,uEAAG,EAAE;IAAA;IAAA;IAC1B,IAAI,CAACA,KAAK,GAAGA,KAAK;EACnB;EAAC;IAAA;IAAA,OAED,aAAIC,KAAQ,EAAQ;MACnB,IAAI,IAAI,CAACC,GAAG,CAACD,KAAK,CAAC,KAAK,KAAK,EAAE;QAC9B,IAAI,CAACD,KAAK,CAACG,IAAI,CAACF,KAAK,CAAC;MACvB;MACA,OAAO,IAAI;IACZ;EAAC;IAAA;IAAA,OACD,iBAAc;MACb,IAAI,CAACD,KAAK,GAAG,EAAE;IAChB;EAAC;IAAA;IAAA,OACD,iBAAOC,KAAQ,EAAW;MACzB,IAAMG,cAAc,GAAG,IAAI,CAACJ,KAAK,CAACK,MAAM;MACxC,IAAI,CAACL,KAAK,GAAG,IAAI,CAACA,KAAK,CAACM,MAAM,CAAC,UAACC,IAAI;QAAA,OAAKA,IAAI,KAAKN,KAAK;MAAA,EAAC;MAExD,OAAOG,cAAc,KAAK,IAAI,CAACJ,KAAK,CAACK,MAAM;IAC5C;EAAC;IAAA;IAAA,OACD,iBAAQG,UAAsD,EAAQ;MAAA;MACrE,IAAI,CAACR,KAAK,CAACS,OAAO,CAAC,UAACF,IAAI,EAAK;QAC5BC,UAAU,CAACD,IAAI,EAAEA,IAAI,EAAE,KAAI,CAAC;MAC7B,CAAC,CAAC;IACH;EAAC;IAAA;IAAA,OACD,aAAIN,KAAQ,EAAW;MACtB,OAAO,IAAI,CAACD,KAAK,CAACU,OAAO,CAACT,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC;EAAC;IAAA;IAAA,KAED,eAAmB;MAClB,OAAO,IAAI,CAACD,KAAK,CAACK,MAAM;IACzB;EAAC;EAAA;AAAA;AAGF,eAAe,OAAOM,GAAG,KAAK,WAAW,GAAGA,GAAG,GAAGZ,OAAO"}
|
||||
6
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.d.ts
generated
vendored
Normal file
6
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
*/
|
||||
export default function arrayFrom<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
||||
//# sourceMappingURL=array.from.d.ts.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.d.ts.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"array.from.d.ts","sourceRoot":"","sources":["../../sources/polyfills/array.from.ts"],"names":[],"mappings":"AAuBA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC"}
|
||||
91
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.js
generated
vendored
Normal file
91
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = arrayFrom;
|
||||
/**
|
||||
* @source {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill}
|
||||
* but without thisArg (too hard to type, no need to `this`)
|
||||
*/
|
||||
var toStr = Object.prototype.toString;
|
||||
function isCallable(fn) {
|
||||
return typeof fn === "function" || toStr.call(fn) === "[object Function]";
|
||||
}
|
||||
function toInteger(value) {
|
||||
var number = Number(value);
|
||||
if (isNaN(number)) {
|
||||
return 0;
|
||||
}
|
||||
if (number === 0 || !isFinite(number)) {
|
||||
return number;
|
||||
}
|
||||
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
|
||||
}
|
||||
var maxSafeInteger = Math.pow(2, 53) - 1;
|
||||
function toLength(value) {
|
||||
var len = toInteger(value);
|
||||
return Math.min(Math.max(len, 0), maxSafeInteger);
|
||||
}
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
function arrayFrom(arrayLike, mapFn) {
|
||||
// 1. Let C be the this value.
|
||||
// edit(@eps1lon): we're not calling it as Array.from
|
||||
var C = Array;
|
||||
|
||||
// 2. Let items be ToObject(arrayLike).
|
||||
var items = Object(arrayLike);
|
||||
|
||||
// 3. ReturnIfAbrupt(items).
|
||||
if (arrayLike == null) {
|
||||
throw new TypeError("Array.from requires an array-like object - not null or undefined");
|
||||
}
|
||||
|
||||
// 4. If mapfn is undefined, then let mapping be false.
|
||||
// const mapFn = arguments.length > 1 ? arguments[1] : void undefined;
|
||||
|
||||
if (typeof mapFn !== "undefined") {
|
||||
// 5. else
|
||||
// 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
|
||||
if (!isCallable(mapFn)) {
|
||||
throw new TypeError("Array.from: when provided, the second argument must be a function");
|
||||
}
|
||||
}
|
||||
|
||||
// 10. Let lenValue be Get(items, "length").
|
||||
// 11. Let len be ToLength(lenValue).
|
||||
var len = toLength(items.length);
|
||||
|
||||
// 13. If IsConstructor(C) is true, then
|
||||
// 13. a. Let A be the result of calling the [[Construct]] internal method
|
||||
// of C with an argument list containing the single item len.
|
||||
// 14. a. Else, Let A be ArrayCreate(len).
|
||||
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
|
||||
|
||||
// 16. Let k be 0.
|
||||
var k = 0;
|
||||
// 17. Repeat, while k < len… (also steps a - h)
|
||||
var kValue;
|
||||
while (k < len) {
|
||||
kValue = items[k];
|
||||
if (mapFn) {
|
||||
A[k] = mapFn(kValue, k);
|
||||
} else {
|
||||
A[k] = kValue;
|
||||
}
|
||||
k += 1;
|
||||
}
|
||||
// 18. Let putStatus be Put(A, "length", len, true).
|
||||
A.length = len;
|
||||
// 20. Return A.
|
||||
return A;
|
||||
}
|
||||
//# sourceMappingURL=array.from.js.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.js.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
87
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs
generated
vendored
Normal file
87
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* @source {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill}
|
||||
* but without thisArg (too hard to type, no need to `this`)
|
||||
*/
|
||||
var toStr = Object.prototype.toString;
|
||||
function isCallable(fn) {
|
||||
return typeof fn === "function" || toStr.call(fn) === "[object Function]";
|
||||
}
|
||||
function toInteger(value) {
|
||||
var number = Number(value);
|
||||
if (isNaN(number)) {
|
||||
return 0;
|
||||
}
|
||||
if (number === 0 || !isFinite(number)) {
|
||||
return number;
|
||||
}
|
||||
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
|
||||
}
|
||||
var maxSafeInteger = Math.pow(2, 53) - 1;
|
||||
function toLength(value) {
|
||||
var len = toInteger(value);
|
||||
return Math.min(Math.max(len, 0), maxSafeInteger);
|
||||
}
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
export default function arrayFrom(arrayLike, mapFn) {
|
||||
// 1. Let C be the this value.
|
||||
// edit(@eps1lon): we're not calling it as Array.from
|
||||
var C = Array;
|
||||
|
||||
// 2. Let items be ToObject(arrayLike).
|
||||
var items = Object(arrayLike);
|
||||
|
||||
// 3. ReturnIfAbrupt(items).
|
||||
if (arrayLike == null) {
|
||||
throw new TypeError("Array.from requires an array-like object - not null or undefined");
|
||||
}
|
||||
|
||||
// 4. If mapfn is undefined, then let mapping be false.
|
||||
// const mapFn = arguments.length > 1 ? arguments[1] : void undefined;
|
||||
|
||||
if (typeof mapFn !== "undefined") {
|
||||
// 5. else
|
||||
// 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
|
||||
if (!isCallable(mapFn)) {
|
||||
throw new TypeError("Array.from: when provided, the second argument must be a function");
|
||||
}
|
||||
}
|
||||
|
||||
// 10. Let lenValue be Get(items, "length").
|
||||
// 11. Let len be ToLength(lenValue).
|
||||
var len = toLength(items.length);
|
||||
|
||||
// 13. If IsConstructor(C) is true, then
|
||||
// 13. a. Let A be the result of calling the [[Construct]] internal method
|
||||
// of C with an argument list containing the single item len.
|
||||
// 14. a. Else, Let A be ArrayCreate(len).
|
||||
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
|
||||
|
||||
// 16. Let k be 0.
|
||||
var k = 0;
|
||||
// 17. Repeat, while k < len… (also steps a - h)
|
||||
var kValue;
|
||||
while (k < len) {
|
||||
kValue = items[k];
|
||||
if (mapFn) {
|
||||
A[k] = mapFn(kValue, k);
|
||||
} else {
|
||||
A[k] = kValue;
|
||||
}
|
||||
k += 1;
|
||||
}
|
||||
// 18. Let putStatus be Put(A, "length", len, true).
|
||||
A.length = len;
|
||||
// 20. Return A.
|
||||
return A;
|
||||
}
|
||||
//# sourceMappingURL=array.from.mjs.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.js
generated
vendored
Normal file
2
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=iterator.d.js.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.js.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"iterator.d.js","names":[],"sources":["../../sources/polyfills/iterator.d.ts"],"sourcesContent":["// copied from https://github.com/microsoft/TypeScript/blob/eaeee9cc31bdc3a16f982a2e7b784573c977fdfa/lib/\n// but with `unknown` instead of `any`\ninterface IteratorYieldResult<TYield> {\n\tdone?: false;\n\tvalue: TYield;\n}\n\ninterface IteratorReturnResult<TReturn> {\n\tdone: true;\n\tvalue: TReturn;\n}\n\ntype IteratorResult<T, TReturn = unknown> =\n\t| IteratorYieldResult<T>\n\t| IteratorReturnResult<TReturn>;\n\ninterface Iterator<T, TReturn = unknown, TNext = undefined> {\n\t// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.\n\tnext(...args: [] | [TNext]): IteratorResult<T, TReturn>;\n\treturn?(value?: TReturn): IteratorResult<T, TReturn>;\n\tthrow?(e?: unknown): IteratorResult<T, TReturn>;\n}\n\ninterface Iterable<T> {\n\t[Symbol.iterator](): Iterator<T>;\n}\n\ninterface IterableIterator<T> extends Iterator<T> {\n\t[Symbol.iterator](): IterableIterator<T>;\n}\ninterface SymbolConstructor {\n\t/**\n\t * A method that returns the default iterator for an object. Called by the semantics of the\n\t * for-of statement.\n\t */\n\treadonly iterator: symbol;\n}\n\ndeclare const Symbol: SymbolConstructor;\n"],"mappings":""}
|
||||
2
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.mjs
generated
vendored
Normal file
2
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
//# sourceMappingURL=iterator.d.mjs.map
|
||||
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/dom-accessibility-api/dist/polyfills/iterator.d.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"iterator.d.mjs","names":[],"sources":["../../sources/polyfills/iterator.d.ts"],"sourcesContent":["// copied from https://github.com/microsoft/TypeScript/blob/eaeee9cc31bdc3a16f982a2e7b784573c977fdfa/lib/\n// but with `unknown` instead of `any`\ninterface IteratorYieldResult<TYield> {\n\tdone?: false;\n\tvalue: TYield;\n}\n\ninterface IteratorReturnResult<TReturn> {\n\tdone: true;\n\tvalue: TReturn;\n}\n\ntype IteratorResult<T, TReturn = unknown> =\n\t| IteratorYieldResult<T>\n\t| IteratorReturnResult<TReturn>;\n\ninterface Iterator<T, TReturn = unknown, TNext = undefined> {\n\t// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.\n\tnext(...args: [] | [TNext]): IteratorResult<T, TReturn>;\n\treturn?(value?: TReturn): IteratorResult<T, TReturn>;\n\tthrow?(e?: unknown): IteratorResult<T, TReturn>;\n}\n\ninterface Iterable<T> {\n\t[Symbol.iterator](): Iterator<T>;\n}\n\ninterface IterableIterator<T> extends Iterator<T> {\n\t[Symbol.iterator](): IterableIterator<T>;\n}\ninterface SymbolConstructor {\n\t/**\n\t * A method that returns the default iterator for an object. Called by the semantics of the\n\t * for-of statement.\n\t */\n\treadonly iterator: symbol;\n}\n\ndeclare const Symbol: SymbolConstructor;\n"],"mappings":""}
|
||||
Reference in New Issue
Block a user