main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
'use strict';
require('./shim')();

View File

@@ -0,0 +1,32 @@
'use strict';
var $TypeError = require('es-errors/type');
var GetIteratorFlattenable = require('../aos/GetIteratorFlattenable');
var OrdinaryHasInstance = require('es-abstract/2024/OrdinaryHasInstance');
var OrdinaryObjectCreate = require('es-abstract/2024/OrdinaryObjectCreate');
var $Iterator = require('../Iterator/polyfill')();
var $WrapForValidIteratorPrototype = require('../WrapForValidIteratorPrototype');
var SLOT = require('internal-slot');
module.exports = function from(O) {
if (this instanceof from) {
throw new $TypeError('`Iterator.from` is not a constructor');
}
var iteratorRecord = GetIteratorFlattenable(O, 'iterate-strings'); // step 1
var hasInstance = OrdinaryHasInstance($Iterator, iteratorRecord['[[Iterator]]']); // step 2
if (hasInstance) { // step 3
return iteratorRecord['[[Iterator]]']; // step 3.a
}
var wrapper = OrdinaryObjectCreate($WrapForValidIteratorPrototype); // , ['[[Iterated]]']); // step 4
SLOT.set(wrapper, '[[Iterated]]', iteratorRecord); // step 5
return wrapper; // step 6
};

View File

@@ -0,0 +1,18 @@
'use strict';
var callBind = require('call-bind');
var define = require('define-properties');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var bound = callBind(getPolyfill(), null);
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;

View File

@@ -0,0 +1,9 @@
'use strict';
var implementation = require('./implementation');
var $Iterator = require('../Iterator');
module.exports = function getPolyfill() {
return typeof $Iterator.from === 'function' ? $Iterator.from : implementation;
};

18
node_modules/es-iterator-helpers/Iterator.from/shim.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
var getPolyfill = require('./polyfill');
var define = require('define-properties');
var getIteratorPolyfill = require('../Iterator/polyfill');
module.exports = function shimIteratorFrom() {
var $Iterator = getIteratorPolyfill();
var polyfill = getPolyfill();
define(
$Iterator,
{ from: polyfill },
{ from: function () { return $Iterator.from !== polyfill; } }
);
return polyfill;
};