Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 150
[CHANGELOG.md]
indent_style = space
indent_size = 2
[*.json]
max_line_length = off
[Makefile]
max_line_length = off

View File

@@ -0,0 +1 @@
coverage/

View File

@@ -0,0 +1,12 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"id-length": 0,
"new-cap": [2, { "capIsNewExceptions": ["RequireObjectCoercible"] }],
"no-magic-numbers": [0],
"no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"]
}
}

View File

@@ -0,0 +1,13 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"test"
]
}

View File

@@ -0,0 +1,64 @@
1.1.3 / 2021-02-22
=================
* [readme] remove travis badge
* [meta] do not publish github action workflow files
* [Deps] update `call-bind`, `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `functions-have-names`, `has-strict-mode`, `tape`
* [actions] update workflows
1.1.2 / 2020-11-26
=================
* [Fix] do not mutate the native function when present
* [Deps] update `es-abstract`; use `call-bind` where applicable
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `functions-have-names`; add `aud`, `safe-publish-latest`
* [Tests] only audit prod deps
* [Tests] migrate tests to Github Actions
* [Tests] run `nyc` on all tests
* [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner
* [actions] add "Allow Edits" workflow
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
1.1.1 / 2019-12-12
=================
* [Refactor] use split-up `es-abstract` (85% bundle size decrease)
* [Deps] update `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names`, `tape`, `object-keys`
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
* [Tests] use shared travis-ci configs
* [Tests] use `functions-have-names`
* [meta] add `funding` field
* [actions] add automatic rebasing / merge commit blocking
1.1.0 / 2019-01-01
=================
* [New] add `auto` entry point`
* [Deps] update `define-properties`, `es-abstract`, `function-bind`, `has`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape`
* [Tests] up to `node` `v11.6`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.16`, `v4.9`; use `nvm install-latest-npm`
* [Tests] use `npm audit` instead of `nsp`
* [Tests] remove `jscs`
1.0.4 / 2016-12-04
=================
* [Docs] update to reflect ES2017 inclusion
* [Deps] update `es-abstract`, `function-bind`, `define-properties`
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`
* [Tests] up to `node` `v7.2`, `v6.9`, `v4.6`; improve test matrix.
1.0.3 / 2015-10-06
=================
* [Fix] Not-yet-visited keys made non-enumerable on a `[[Get]]` must not show up in the output (https://github.com/ljharb/proposal-object-values-entries/issues/5)
1.0.2 / 2015-09-25
=================
* [Fix] Not-yet-visited keys deleted on a `[[Get]]` must not show up in the output (#1)
1.0.1 / 2015-09-21
=================
* [Docs] update version badge URL
* [Tests] on `io.js` `v3.3`, up to `node` `v4.1`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`
1.0.0 / 2015-09-02
=================
* v1.0.0

View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 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.

View File

@@ -0,0 +1,56 @@
# object.values <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![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 ES2017 spec-compliant `Object.values` shim. Invoke its "shim" method to shim `Object.values` 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 [spec](https://tc39.github.io/ecma262/#sec-object.values).
Most common usage:
```js
var assert = require('assert');
var values = require('object.values');
var obj = { a: 1, b: 2, c: 3 };
var expected = [1, 2, 3];
if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
// for environments with Symbol support
var sym = Symbol();
obj[sym] = 4;
obj.d = sym;
expected.push(sym);
}
assert.deepEqual(values(obj), expected);
if (!Object.values) {
values.shim();
}
assert.deepEqual(Object.values(obj), expected);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.com/package/object.values
[npm-version-svg]: https://versionbadg.es/es-shims/Object.values.svg
[deps-svg]: https://david-dm.org/es-shims/Object.values.svg
[deps-url]: https://david-dm.org/es-shims/Object.values
[dev-deps-svg]: https://david-dm.org/es-shims/Object.values/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Object.values#info=devDependencies
[testling-svg]: https://ci.testling.com/es-shims/Object.values.png
[testling-url]: https://ci.testling.com/es-shims/Object.values
[npm-badge-png]: https://nodei.co/npm/object.values.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/object.values.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/object.values.svg
[downloads-url]: https://npm-stat.com/charts.html?package=object.values

View File

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

View File

@@ -0,0 +1,18 @@
'use strict';
var has = require('has');
var RequireObjectCoercible = require('es-abstract/2020/RequireObjectCoercible');
var callBound = require('call-bind/callBound');
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
module.exports = function values(O) {
var obj = RequireObjectCoercible(O);
var vals = [];
for (var key in obj) {
if (has(obj, key) && $isEnumerable(obj, key)) {
vals.push(obj[key]);
}
}
return vals;
};

View File

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

View File

@@ -0,0 +1,111 @@
{
"_from": "object.values@^1.1.0",
"_id": "object.values@1.1.3",
"_inBundle": false,
"_integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==",
"_location": "/object.values",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "object.values@^1.1.0",
"name": "object.values",
"escapedName": "object.values",
"rawSpec": "^1.1.0",
"saveSpec": null,
"fetchSpec": "^1.1.0"
},
"_requiredBy": [
"/imagemin-svgo/svgo"
],
"_resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz",
"_shasum": "eaa8b1e17589f02f698db093f7c62ee1699742ee",
"_spec": "object.values@^1.1.0",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\node_modules\\imagemin-svgo\\node_modules\\svgo",
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com"
},
"bugs": {
"url": "https://github.com/es-shims/Object.values/issues"
},
"bundleDependencies": false,
"dependencies": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.2",
"has": "^1.0.3"
},
"deprecated": false,
"description": "ES2017 spec-compliant Object.values shim.",
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^17.5.1",
"array-map": "^0.0.0",
"aud": "^1.1.4",
"eslint": "^7.20.0",
"functions-have-names": "^1.2.2",
"has-strict-mode": "^1.0.1",
"nyc": "^10.3.2",
"object-keys": "^1.1.1",
"safe-publish-latest": "^1.1.4",
"tape": "^5.2.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"homepage": "https://github.com/es-shims/Object.values#readme",
"keywords": [
"Object.values",
"Object.keys",
"Object.entries",
"values",
"ES7",
"ES8",
"ES2017",
"shim",
"object",
"keys",
"entries",
"polyfill",
"es-shim API"
],
"license": "MIT",
"main": "index.js",
"name": "object.values",
"repository": {
"type": "git",
"url": "git://github.com/es-shims/Object.values.git"
},
"scripts": {
"lint": "eslint .",
"postlint": "es-shim-api --bound",
"posttest": "npx aud --production",
"prepublish": "safe-publish-latest",
"pretest": "npm run lint",
"test": "npm run tests-only",
"tests-only": "nyc tape 'test/**/*.js'"
},
"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": "1.1.3"
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,20 @@
'use strict';
var implementation = require('../implementation');
var callBind = require('call-bind');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
/* eslint no-useless-call: 0 */
st['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(implementation, Object), t);
t.end();
});

View File

@@ -0,0 +1,17 @@
'use strict';
var values = 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 () { values(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { values(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(values, t);
t.end();
});

View File

@@ -0,0 +1,36 @@
'use strict';
var values = require('../');
values.shim();
var test = require('tape');
var defineProperties = require('define-properties');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(Object.values.length, 1, 'Object.values has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Object.values.name, 'values', 'Object.values has name "values"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, 'values'), 'Object.values 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.values(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Object.values(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(Object.values, t);
t.end();
});

View File

@@ -0,0 +1,82 @@
'use strict';
var keys = require('object-keys');
var map = require('array-map');
var define = require('define-properties');
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
module.exports = function (values, t) {
var a = {};
var b = {};
var c = {};
var obj = { a: a, b: b, c: c };
t.deepEqual(values(obj), [a, b, c], 'basic support');
t.deepEqual(values({ a: a, b: a, c: c }), [a, a, c], 'duplicate values are included');
t.test('values are in the same order as keys', function (st) {
var object = { a: a, b: b };
object[0] = 3;
object.c = c;
object[1] = 4;
delete object[0];
var objKeys = keys(object);
var objValues = map(objKeys, function (key) {
return object[key];
});
st.deepEqual(values(object), objValues, 'values match key order');
st.end();
});
t.test('non-enumerable properties are omitted', { skip: !Object.defineProperty }, function (st) {
var object = { a: a, b: b };
Object.defineProperty(object, 'c', { enumerable: false, value: c });
st.deepEqual(values(object), [a, b], 'non-enumerable propertys value is omitted');
st.end();
});
t.test('inherited properties are omitted', function (st) {
var F = function G() {};
F.prototype.a = a;
var f = new F();
f.b = b;
st.deepEqual(values(f), [b], 'only own properties are included');
st.end();
});
t.test('Symbol properties are omitted', { skip: !hasSymbols }, function (st) {
var object = { a: a, b: b, c: c };
var enumSym = Symbol('enum');
var nonEnumSym = Symbol('non enum');
object[enumSym] = enumSym;
object.d = enumSym;
Object.defineProperty(object, nonEnumSym, { enumerable: false, value: nonEnumSym });
st.deepEqual(values(object), [a, b, c, enumSym], 'symbol properties are omitted');
st.end();
});
t.test('not-yet-visited keys deleted on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) {
var o = { a: 1, b: 2, c: 3 };
Object.defineProperty(o, 'a', {
get: function () {
delete this.b;
return 1;
}
});
st.deepEqual(values(o), [1, 3], 'when "b" is deleted prior to being visited, it should not show up');
st.end();
});
t.test('not-yet-visited keys made non-enumerable on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) {
var o = { a: 'A', b: 'B' };
Object.defineProperty(o, 'a', {
get: function () {
Object.defineProperty(o, 'b', { enumerable: false });
return 'A';
}
});
st.deepEqual(values(o), ['A'], 'when "b" is made non-enumerable prior to being visited, it should not show up');
st.end();
});
};