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

6
node_modules/string.prototype.includes/.editorconfig generated vendored Normal file
View File

@@ -0,0 +1,6 @@
root = true
[*]
indent_style = tab
end_of_line = lf
insert_final_newline = true

View File

@@ -0,0 +1,2 @@
# Automatically normalize line endings for all text-based files
* text=auto

7
node_modules/string.prototype.includes/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,7 @@
version: ~> 1.0
language: node_js
os:
- linux
import:
- ljharb/travis-ci:node/all.yml
- ljharb/travis-ci:node/pretest.yml

20
node_modules/string.prototype.includes/LICENSE-MIT.txt generated vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright Mathias Bynens <https://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

48
node_modules/string.prototype.includes/README.md generated vendored Normal file
View File

@@ -0,0 +1,48 @@
# ES6 `String.prototype.includes` polyfill [![Build status](https://travis-ci.org/mathiasbynens/String.prototype.includes.svg?branch=master)](https://travis-ci.org/mathiasbynens/String.prototype.includes)
A robust & optimized polyfill for [the `String.prototype.includes` method (previously known as `String.prototype.contains`) in ECMAScript 6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.includes).
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-string.prototype.includes).
Other polyfills for `String.prototype.includes` are available:
* <https://github.com/paulmillr/es6-shim/blob/d8c4ec246a15e7df55da60b7f9b745af84ca9021/es6-shim.js#L186-L190> by [Paul Miller](http://paulmillr.com/) (~~[fails some tests](https://github.com/paulmillr/es6-shim/issues/175)~~ passes all tests)
* <https://github.com/google/traceur-compiler/blob/315bdad05d41de46d25337422d66686d63100d7a/src/runtime/polyfills/String.js#L68-L86> by Google (~~[fails a lot of tests](https://github.com/google/traceur-compiler/pull/556)~~ now uses this polyfill and passes all tests)
## Installation
Via [npm](http://npmjs.org/):
```bash
npm install string.prototype.includes
```
Then, in [Node.js](http://nodejs.org/):
```js
var includes = require('string.prototype.includes');
```
In a browser:
```html
<script src="https://bundle.run/string.prototype.includes"></script>
```
> **NOTE**: It's recommended that you install this module using a package manager
> such as `npm`, because loading multiple polyfills from a CDN (such as `bundle.run`)
> will lead to duplicated code.
## Notes
Polyfills + test suites for [`String.prototype.startsWith`](https://mths.be/startswith) and [`String.prototype.endsWith`](https://mths.be/endswith) are available, too.
## Author
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |
## License
This polyfill is available under the [MIT](https://mths.be/mit) license.

3
node_modules/string.prototype.includes/auto.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
/*! https://mths.be/includes v2.0.0 by @mathias */
require('./shim')();

View File

@@ -0,0 +1,32 @@
/*! https://mths.be/includes v2.0.0 by @mathias */
'use strict';
var callBound = require('es-abstract/helpers/callBound')
var RequireObjectCoercible = require('es-abstract/2019/RequireObjectCoercible');
var ToString = require('es-abstract/2019/ToString');
var ToInteger = require('es-abstract/2019/ToInteger');
var IsRegExp = require('es-abstract/2019/IsRegExp');
var min = Math.min;
var max = Math.max;
var indexOf = callBound('String.prototype.indexOf');
module.exports = function includes(searchString) {
var O = RequireObjectCoercible(this);
var S = ToString(O);
if (IsRegExp(searchString)) {
throw TypeError('Argument to String.prototype.includes cannot be a RegExp');
}
var searchStr = String(searchString);
var searchLength = searchStr.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = ToInteger(position);
var len = S.length;
var start = min(max(pos, 0), len);
// Avoid the `indexOf` call if no match is possible
if (searchLength + start > len) {
return false;
}
return indexOf(S, searchStr, pos) != -1;
};

20
node_modules/string.prototype.includes/index.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
/*! https://mths.be/includes v2.0.0 by @mathias */
'use strict';
var callBind = require('es-abstract/helpers/callBind');
var define = require('define-properties');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var boundIncludes = callBind(getPolyfill());
define(boundIncludes, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundIncludes;

49
node_modules/string.prototype.includes/package.json generated vendored Normal file
View File

@@ -0,0 +1,49 @@
{
"name": "string.prototype.includes",
"version": "2.0.0",
"description": "A robust & optimized `String.prototype.includes` polyfill, based on the ECMAScript 6 specification.",
"homepage": "https://mths.be/includes",
"main": "index.js",
"exports": {
".": "./index.js",
"./auto": "./auto.js",
"./shim": "./shim.js",
"./getPolyfill": "./getPolyfill.js",
"./implementation": "./implementation.js",
"./package.json": "./package.json"
},
"keywords": [
"string",
"includes",
"es6",
"ecmascript",
"polyfill"
],
"license": "MIT",
"author": {
"name": "Mathias Bynens",
"url": "https://mathiasbynens.be/"
},
"repository": {
"type": "git",
"url": "https://github.com/mathiasbynens/String.prototype.includes.git"
},
"bugs": "https://github.com/mathiasbynens/String.prototype.includes/issues",
"scripts": {
"pretest": "es-shim-api --bound",
"test": "npm run tests-only",
"tests-only": "tape 'tests/*.js'",
"cover": "istanbul cover --report html --verbose --dir coverage tape 'tests/*.js'"
},
"dependencies": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.5"
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
"function-bind": "^1.1.1",
"functions-have-names": "^1.2.1",
"istanbul": "^0.4.5",
"tape": "^5.0.0"
}
}

9
node_modules/string.prototype.includes/polyfill.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/*! https://mths.be/includes v2.0.0 by @mathias */
'use strict';
var implementation = require('./implementation');
module.exports = function getPolyfill() {
return String.prototype.includes || implementation;
};

17
node_modules/string.prototype.includes/shim.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/*! https://mths.be/includes v2.0.0 by @mathias */
'use strict';
var define = require('define-properties');
var getPolyfill = require('./polyfill');
module.exports = function shimIncludes() {
var polyfill = getPolyfill();
if (String.prototype.includes !== polyfill) {
define(String.prototype, { includes: polyfill });
}
return polyfill;
};

12
node_modules/string.prototype.includes/tests/index.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
var includes = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
runTests(includes, t);
t.end();
});

View File

@@ -0,0 +1,30 @@
'use strict';
var includes = require('../');
includes.shim();
var test = require('tape');
var defineProperties = require('define-properties');
var bind = require('function-bind');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(String.prototype.includes.length, 1, 'String#includes has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(String.prototype.includes.name, 'includes', 'String#includes has name "includes"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (st) {
st.equal(false, isEnumerable.call(String.prototype, 'includes'), 'String#includes is not enumerable');
st.end();
});
runTests(bind.call(Function.call, String.prototype.includes), t);
t.end();
});

138
node_modules/string.prototype.includes/tests/tests.js generated vendored Normal file
View File

@@ -0,0 +1,138 @@
'use strict';
function fakeArg(fn) {
return function(st) {
try {
Object.prototype[1] = 2; // try to break `arguments[1]`
fn(st);
} finally {
delete Object.prototype[1];
}
};
}
module.exports = function(includes, t) {
t.test('cast searchString arg', fakeArg(function(st) {
st.equals(includes('abc'), false);
st.equals(includes('aundefinedb'), true);
st.equals(includes('abc', undefined), false);
st.equals(includes('aundefinedb', undefined), true);
st.equals(includes('abc', null), false);
st.equals(includes('anullb', null), true);
st.equals(includes('abc', false), false);
st.equals(includes('afalseb', false), true);
st.equals(includes('abc', NaN), false);
st.equals(includes('aNaNb', NaN), true);
st.end();
}));
t.test('basic support', fakeArg(function(st) {
st.equals(includes('abc', 'abc'), true);
st.equals(includes('abc', 'def'), false);
st.equals(includes('abc', ''), true);
st.equals(includes('', ''), true);
st.equals(includes('abc', 'bc'), true);
st.equals(includes('abc', 'bc\0'), false);
st.end();
}));
t.test('pos argument', function(st) {
st.equals(includes('abc', 'b', -Infinity), true);
st.equals(includes('abc', 'b', -1), true);
st.equals(includes('abc', 'b', -0), true);
st.equals(includes('abc', 'b', +0), true);
st.equals(includes('abc', 'b', NaN), true);
st.equals(includes('abc', 'b', 'x'), true);
st.equals(includes('abc', 'b', false), true);
st.equals(includes('abc', 'b', undefined), true);
st.equals(includes('abc', 'b', null), true);
st.equals(includes('abc', 'b', 1), true);
st.equals(includes('abc', 'b', 2), false);
st.equals(includes('abc', 'b', 3), false);
st.equals(includes('abc', 'b', 4), false);
st.equals(includes('abc', 'b', +Infinity), false);
st.end();
});
t.test('cast stringSearch arg with pos - included', function(st) {
st.equals(includes('abc123def', 1, -Infinity), true);
st.equals(includes('abc123def', 1, -1), true);
st.equals(includes('abc123def', 1, -0), true);
st.equals(includes('abc123def', 1, +0), true);
st.equals(includes('abc123def', 1, NaN), true);
st.equals(includes('abc123def', 1, 'x'), true);
st.equals(includes('abc123def', 1, false), true);
st.equals(includes('abc123def', 1, undefined), true);
st.equals(includes('abc123def', 1, null), true);
st.equals(includes('abc123def', 1, 1), true);
st.equals(includes('abc123def', 1, 2), true);
st.equals(includes('abc123def', 1, 3), true);
st.equals(includes('abc123def', 1, 4), false);
st.equals(includes('abc123def', 1, 5), false);
st.equals(includes('abc123def', 1, +Infinity), false);
st.end();
});
t.test('cast stringSearch arg with pos - not included', function(st) {
st.equals(includes('abc123def', 9, -Infinity), false);
st.equals(includes('abc123def', 9, -1), false);
st.equals(includes('abc123def', 9, -0), false);
st.equals(includes('abc123def', 9, +0), false);
st.equals(includes('abc123def', 9, NaN), false);
st.equals(includes('abc123def', 9, 'x'), false);
st.equals(includes('abc123def', 9, false), false);
st.equals(includes('abc123def', 9, undefined), false);
st.equals(includes('abc123def', 9, null), false);
st.equals(includes('abc123def', 9, 1), false);
st.equals(includes('abc123def', 9, 2), false);
st.equals(includes('abc123def', 9, 3), false);
st.equals(includes('abc123def', 9, 4), false);
st.equals(includes('abc123def', 9, 5), false);
st.equals(includes('abc123def', 9, +Infinity), false);
st.end();
});
t.test('regex searchString', function(st) {
st.equals(includes('foo[a-z]+(bar)?', '[a-z]+'), true);
st['throws'](function() { includes('foo[a-z]+(bar)?', /[a-z]+/); }, TypeError);
st['throws'](function() { includes('foo/[a-z]+/(bar)?', /[a-z]+/); }, TypeError);
st.equals(includes('foo[a-z]+(bar)?', '(bar)?'), true);
st['throws'](function() { includes('foo[a-z]+(bar)?', /(bar)?/); }, TypeError);
st['throws'](function() { includes('foo[a-z]+/(bar)?/', /(bar)?/); }, TypeError);
st.end();
});
t.test('astral symbols', function(st) {
// https://mathiasbynens.be/notes/javascript-unicode#poo-test
var string = 'I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\u2603\uD83D\uDCA9';
st.equals(string.includes(''), true);
st.equals(string.includes('\xF1t\xEBr'), true);
st.equals(string.includes('\xE0liz\xE6'), true);
st.equals(string.includes('\xF8n\u2603\uD83D\uDCA9'), true);
st.equals(string.includes('\u2603'), true);
st.equals(string.includes('\uD83D\uDCA9'), true);
st.end();
});
t.test('nullish this object', function(st) {
st['throws'](function() { includes(undefined); }, TypeError);
st['throws'](function() { includes(undefined, 'b'); }, TypeError);
st['throws'](function() { includes(undefined, 'b', 4); }, TypeError);
st['throws'](function() { includes(null); }, TypeError);
st['throws'](function() { includes(null, 'b'); }, TypeError);
st['throws'](function() { includes(null, 'b', 4); }, TypeError);
st.end();
});
t.test('cast this object', function(st) {
st.equals(includes(42, '2'), true);
st.equals(includes(42, 'b', 4), false);
st.equals(includes(42, '2', 4), false);
st.equals(includes({ 'toString': function() { return 'abc'; } }, 'b', 0), true);
st.equals(includes({ 'toString': function() { return 'abc'; } }, 'b', 1), true);
st.equals(includes({ 'toString': function() { return 'abc'; } }, 'b', 2), false);
st['throws'](function() { includes({ 'toString': function() { throw RangeError(); } }, /./); }, RangeError);
st['throws'](function() { includes({ 'toString': function() { return 'abc'; } }, /./); }, TypeError);
st.end();
});
};