WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

25
node_modules/object.fromentries/.eslintrc generated vendored Normal file
View File

@ -0,0 +1,25 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"max-statements-per-line": [2, { "max": 2 }],
"max-statements": [2, 22],
"new-cap": [2, {
"capIsNewExceptions": [
"CreateDataPropertyOrThrow",
"Get",
"GetIterator",
"IsArray",
"IteratorStep",
"IteratorClose",
"IteratorValue",
"ThrowCompletion",
"ToPropertyKey",
"Type",
"RequireObjectCoercible",
],
}],
},
}

203
node_modules/object.fromentries/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,203 @@
language: node_js
os:
- linux
node_js:
- "9.8"
- "8.10"
- "7.10"
- "6.13"
- "5.12"
- "4.8"
- "iojs-v3.3"
- "iojs-v2.5"
- "iojs-v1.8"
- "0.12"
- "0.10"
- "0.8"
before_install:
- 'nvm install-latest-npm'
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
script:
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
sudo: false
env:
- TEST=true
matrix:
fast_finish: true
include:
- node_js: "lts/*"
env: PRETEST=true
- node_js: "lts/*"
env: POSTTEST=true
- node_js: "4"
env: COVERAGE=true
- node_js: "9.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "9.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "8.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "7.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.12"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "6.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.10"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.8"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "5.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "4.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v3.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v2.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.7"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.5"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.4"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.3"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.2"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.1"
env: TEST=true ALLOW_FAILURE=true
- node_js: "iojs-v1.0"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.11"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.9"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.6"
env: TEST=true ALLOW_FAILURE=true
- node_js: "0.4"
env: TEST=true ALLOW_FAILURE=true
allow_failures:
- os: osx
- env: TEST=true ALLOW_FAILURE=true
- env: COVERAGE=true

8
node_modules/object.fromentries/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,8 @@
2.0.0 / 2018-08-09
=================
* [Breaking] throw when `iterable` is nullish
* [Docs] Fix link to proposed spec
1.0.0 / 2018-03-21
=================
* v1.0.0

21
node_modules/object.fromentries/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Jordan Harband
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.

51
node_modules/object.fromentries/README.md generated vendored Normal file
View File

@ -0,0 +1,51 @@
# object.fromentries <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
[![browser support][testling-svg]][testling-url]
An ES spec-proposal-compliant `Object.fromEntries` shim. Invoke its "shim" method to shim `Object.fromEntries` if it is unavailable or noncompliant.
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 [proposed spec](https://tc39.github.io/proposal-object-from-entries/).
Most common usage:
```js
var assert = require('assert');
var fromEntries = require('object.fromentries');
var obj = { a: 1, b: 2, c: 3 };
var actual = fromEntries(Object.entries(obj));
assert.deepEqual(obj, actual);
if (!Object.fromEntries) {
fromEntries.shim();
}
assert.deepEqual(Object.fromEntries(Object.entries(obj)), obj);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.com/package/object.fromentries
[npm-version-svg]: http://versionbadg.es/es-shims/Object.fromEntries.svg
[travis-svg]: https://travis-ci.org/es-shims/Object.fromEntries.svg
[travis-url]: https://travis-ci.org/es-shims/Object.fromEntries
[deps-svg]: https://david-dm.org/es-shims/Object.fromEntries.svg
[deps-url]: https://david-dm.org/es-shims/Object.fromEntries
[dev-deps-svg]: https://david-dm.org/es-shims/Object.fromEntries/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Object.fromEntries#info=devDependencies
[testling-svg]: https://ci.testling.com/es-shims/Object.fromEntries.png
[testling-url]: https://ci.testling.com/es-shims/Object.fromEntries
[npm-badge-png]: https://nodei.co/npm/object.fromentries.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/object.fromentries.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/object.fromentries.svg
[downloads-url]: http://npm-stat.com/charts.html?package=object.fromentries

3
node_modules/object.fromentries/auto.js generated vendored Normal file
View File

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

72
node_modules/object.fromentries/implementation.js generated vendored Normal file
View File

@ -0,0 +1,72 @@
'use strict';
var ES = require('es-abstract/es2017');
var ThrowCompletion = function Throw(error) {
throw error;
};
var legacyAssign = function assign(obj, entries) {
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (ES.Type(entry) !== 'Object') {
throw new TypeError('iterator returned a non-object; entry expected');
}
var key = ES.Get(entry, '0');
var value = ES.Get(entry, '1');
var propertyKey = ES.ToPropertyKey(key);
ES.CreateDataPropertyOrThrow(obj, propertyKey, value);
}
};
/* global Symbol */
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
module.exports = function fromEntries(iterable) {
ES.RequireObjectCoercible(iterable);
var obj = {};
// this part isn't in the spec, it's for a reasonable fallback for pre-ES6 environments
if (!hasSymbols) {
if (!ES.IsArray(iterable)) {
throw new TypeError('this environment lacks native Symbols, and can not support non-Array iterables');
}
legacyAssign(obj, iterable);
return obj;
}
/*
return ES.AddEntriesFromIterable(obj, iterable, ES.CreateBuiltinFunction('CreateDataPropertyOnObject'));
function adder(key, value) {
var O = this;
var propertyKey = ES.ToPropertyKey(key);
CreateDataPropertyOrThrow(O, propertyKey, value);
}
*/
var iter = ES.GetIterator(iterable);
while (true) { // eslint-disable-line no-constant-condition
var next = ES.IteratorStep(iter);
if (next === false) {
return obj;
}
var nextItem = ES.IteratorValue(next);
if (ES.Type(nextItem) !== 'Object') {
var error = new TypeError('iterator returned a non-object; entry expected');
return ES.IteratorClose(iter, ThrowCompletion(error));
}
try {
var key = ES.Get(nextItem, '0');
var value = ES.Get(nextItem, '1');
var propertyKey = ES.ToPropertyKey(key);
ES.CreateDataPropertyOrThrow(obj, propertyKey, value);
} catch (e) {
return ES.IteratorClose(iter, ThrowCompletion(e));
}
}
};

17
node_modules/object.fromentries/index.js generated vendored Normal file
View File

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

107
node_modules/object.fromentries/package.json generated vendored Normal file
View File

@ -0,0 +1,107 @@
{
"_from": "object.fromentries@^2.0.0",
"_id": "object.fromentries@2.0.0",
"_inBundle": false,
"_integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==",
"_location": "/object.fromentries",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "object.fromentries@^2.0.0",
"name": "object.fromentries",
"escapedName": "object.fromentries",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/eslint-plugin-react"
],
"_resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz",
"_shasum": "49a543d92151f8277b3ac9600f1e930b189d30ab",
"_spec": "object.fromentries@^2.0.0",
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/eslint-plugin-react",
"author": {
"name": "Jordan Harband"
},
"bugs": {
"url": "https://github.com/es-shims/Object.fromEntries/issues"
},
"bundleDependencies": false,
"dependencies": {
"define-properties": "^1.1.2",
"es-abstract": "^1.11.0",
"function-bind": "^1.1.1",
"has": "^1.0.1"
},
"deprecated": false,
"description": "ES proposal-spec-compliant Object.fromEntries shim.",
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^12.2.1",
"array-map": "^0.0.0",
"covert": "^1.1.0",
"eslint": "^4.19.0",
"nsp": "^3.2.1",
"tape": "^4.9.0"
},
"engines": {
"node": ">= 0.4"
},
"homepage": "https://github.com/es-shims/Object.fromEntries#readme",
"keywords": [
"Object.fromEntries",
"Object.entries",
"Object.values",
"Object.keys",
"entries",
"values",
"ES7",
"ES8",
"ES2017",
"shim",
"object",
"keys",
"polyfill",
"es-shim API"
],
"license": "MIT",
"main": "index.js",
"name": "object.fromentries",
"repository": {
"type": "git",
"url": "git://github.com/es-shims/Object.fromEntries.git"
},
"scripts": {
"coverage": "covert test/*.js",
"coverage-quiet": "covert test/*.js --quiet",
"lint": "eslint test/*.js *.js",
"posttest": "npm run --silent security",
"pretest": "npm run --silent lint",
"security": "nsp check",
"test": "npm run --silent tests-only",
"test:module": "node test/index.js",
"test:shimmed": "node test/shimmed.js",
"tests-only": "es-shim-api && npm run --silent test:shimmed && npm run --silent test:module"
},
"testling": {
"files": "test/index.js",
"browsers": [
"iexplore/9.0..latest",
"firefox/4.0..6.0",
"firefox/15.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/20.0..latest",
"chrome/canary",
"opera/11.6..latest",
"opera/next",
"safari/5.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"version": "2.0.0"
}

7
node_modules/object.fromentries/polyfill.js generated vendored Normal file
View File

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

14
node_modules/object.fromentries/shim.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
'use strict';
var getPolyfill = require('./polyfill');
var define = require('define-properties');
module.exports = function shimEntries() {
var polyfill = getPolyfill();
define(Object, { fromEntries: polyfill }, {
fromEntries: function testEntries() {
return Object.fromEntries !== polyfill;
}
});
return polyfill;
};

11
node_modules/object.fromentries/test/.eslintrc generated vendored Normal file
View File

@ -0,0 +1,11 @@
{
"rules": {
"array-bracket-newline": 0,
"array-element-newline": 0,
"max-nested-callbacks": [2, 3],
"max-statements": [2, 12],
"max-statements-per-line": [2, { "max": 3 }],
"no-invalid-this": 1,
"object-curly-newline": 0,
}
}

17
node_modules/object.fromentries/test/index.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
'use strict';
var fromEntries = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', function (st) {
st['throws'](function () { fromEntries(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { fromEntries(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(fromEntries, t);
t.end();
});

36
node_modules/object.fromentries/test/shimmed.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
'use strict';
var fromEntries = require('../');
fromEntries.shim();
var test = require('tape');
var defineProperties = require('define-properties');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = function f() {}.name === 'f';
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(Object.fromEntries.length, 1, 'Object.fromEntries has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Object.fromEntries.name, 'fromEntries', 'Object.fromEntries has name "fromEntries"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, 'fromEntries'), 'Object.fromEntries is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad object value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return Object.fromEntries(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Object.fromEntries(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(Object.fromEntries, t);
t.end();
});

19
node_modules/object.fromentries/test/tests.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
'use strict';
/* global Symbol */
// var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
module.exports = function (fromEntries, t) {
var a = {};
var b = {};
var c = {};
var entries = [['a', a], ['b', b], ['c', c]];
var obj = { a: a, b: b, c: c };
t.deepEqual(fromEntries(entries), obj, 'entries -> obj');
t['throws'](function () { fromEntries(); }, 'entries throws on absent iterable');
t['throws'](function () { fromEntries(undefined); }, 'entries throws on undefined');
t['throws'](function () { fromEntries(null); }, 'entries throws on null');
};