This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+8 -1
View File
@@ -5,7 +5,14 @@
"rules": {
"id-length": [2, { "min": 1, "max": 30 }],
"new-cap": [2, { "capIsNewExceptions": ["CreateDataProperty", "IsCallable", "RequireObjectCoercible", "ToObject"] }]
"new-cap": [2, {
"capIsNewExceptions": [
"CreateDataProperty",
"IsCallable",
"RequireObjectCoercible",
"ToObject",
]
}],
},
"overrides": [
+9
View File
@@ -0,0 +1,9 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}
+40
View File
@@ -1,3 +1,43 @@
2.1.4 / 2022-05-19
=================
* [Fix] `Array.prototype.reduce` isnt present in ES3 engines
* [meta] use `npmignore` to autogenerate an npmignore file
* [Deps] update `define-properties`, `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `auto-changelog`, `functions-have-names`, `safe-publish-latest`, `tape`
* [Tests] use `mock-property`
* [actions] reuse common workflows
* [actions] update codecov uploader
2.1.3 / 2021-10-03
=================
* [readme] remove travis badge; add actions and codecov badges
* [Deps] update `es-abstract`
* [meta] use `prepublishOnly` script for npm 7+
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `tape`
* [actions] update workflows
* [actions] use `node/install` instead of `node/run`; use `codecov` action
2.1.2 / 2021-02-20
=================
* [Deps] update `call-bind`, `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `functions-have-names`, `has-strict-mode`, `tape`
* [meta] do not publish github action workflow files
* [meta] gitignore coverage output
* [actions] update workflows
2.1.1 / 2020-11-26
=================
* [Fix] do not mutate the native function when present
* [Deps] update `es-abstract`; use `call-bind` where applicable
* [meta] remove unused Makefile and associated utilities
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `functions-have-names`; add `aud`
* [actions] add Require Allow Edits workflow
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
* [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
* [Tests] only audit prod deps
2.1.0 / 2019-12-12
=================
* [New] add auto entry point
+12 -7
View File
@@ -1,6 +1,7 @@
# Object.getOwnPropertyDescriptors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
# object.getownpropertydescriptors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![Build Status][travis-svg]][travis-url]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
@@ -81,15 +82,19 @@ assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/object.getownpropertydescriptors
[npm-version-svg]: http://versionbadg.es/es-shims/object.getownpropertydescriptors.svg
[npm-version-svg]: http://versionbadg.es/es-shims/Object.getOwnPropertyDescriptors.svg
[travis-svg]: https://travis-ci.org/es-shims/Object.getOwnPropertyDescriptors.svg
[travis-url]: https://travis-ci.org/es-shims/Object.getOwnPropertyDescriptors
[deps-svg]: https://david-dm.org/es-shims/object.getownpropertydescriptors.svg
[deps-url]: https://david-dm.org/es-shims/object.getownpropertydescriptors
[dev-deps-svg]: https://david-dm.org/es-shims/object.getownpropertydescriptors/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/object.getownpropertydescriptors#info=devDependencies
[deps-svg]: https://david-dm.org/es-shims/Object.getOwnPropertyDescriptors.svg
[deps-url]: https://david-dm.org/es-shims/Object.getOwnPropertyDescriptors
[dev-deps-svg]: https://david-dm.org/es-shims/Object.getOwnPropertyDescriptors/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Object.getOwnPropertyDescriptors#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/object.getownpropertydescriptors.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/object.getownpropertydescriptors.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/object.getownpropertydescriptors.svg
[downloads-url]: http://npm-stat.com/charts.html?package=object.getownpropertydescriptors
[codecov-image]: https://codecov.io/gh/es-shims/Object.getOwnPropertyDescriptors/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Object.getOwnPropertyDescriptors/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Object.getOwnPropertyDescriptors
[actions-url]: https://github.com/es-shims/Object.getOwnPropertyDescriptors/actions
+7 -7
View File
@@ -1,16 +1,16 @@
'use strict';
var CreateDataProperty = require('es-abstract/2019/CreateDataProperty');
var IsCallable = require('es-abstract/2019/IsCallable');
var RequireObjectCoercible = require('es-abstract/2019/RequireObjectCoercible');
var ToObject = require('es-abstract/2019/ToObject');
var callBound = require('es-abstract/helpers/callBound');
var CreateDataProperty = require('es-abstract/2021/CreateDataProperty');
var IsCallable = require('es-abstract/2021/IsCallable');
var RequireObjectCoercible = require('es-abstract/2021/RequireObjectCoercible');
var ToObject = require('es-abstract/2021/ToObject');
var callBound = require('call-bind/callBound');
var reduce = require('array.prototype.reduce');
var $gOPD = Object.getOwnPropertyDescriptor;
var $getOwnNames = Object.getOwnPropertyNames;
var $getSymbols = Object.getOwnPropertySymbols;
var $concat = callBound('Array.prototype.concat');
var $reduce = callBound('Array.prototype.reduce');
var getAll = $getSymbols ? function (obj) {
return $concat($getOwnNames(obj), $getSymbols(obj));
} : $getOwnNames;
@@ -24,7 +24,7 @@ module.exports = function getOwnPropertyDescriptors(value) {
}
var O = ToObject(value);
return $reduce(
return reduce(
getAll(O),
function (acc, key) {
var descriptor = $gOPD(O, key);
+5 -2
View File
@@ -1,15 +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');
define(implementation, {
var bound = callBind(getPolyfill(), Object);
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = implementation;
module.exports = bound;
+41 -33
View File
@@ -1,33 +1,32 @@
{
"_args": [
[
"object.getownpropertydescriptors@2.1.0",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"object.getownpropertydescriptors@2.1.4",
"/home/node/nuxt"
]
],
"_from": "object.getownpropertydescriptors@2.1.0",
"_id": "object.getownpropertydescriptors@2.1.0",
"_from": "object.getownpropertydescriptors@2.1.4",
"_id": "object.getownpropertydescriptors@2.1.4",
"_inBundle": false,
"_integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==",
"_integrity": "sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ==",
"_location": "/object.getownpropertydescriptors",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "object.getownpropertydescriptors@2.1.0",
"raw": "object.getownpropertydescriptors@2.1.4",
"name": "object.getownpropertydescriptors",
"escapedName": "object.getownpropertydescriptors",
"rawSpec": "2.1.0",
"rawSpec": "2.1.4",
"saveSpec": null,
"fetchSpec": "2.1.0"
"fetchSpec": "2.1.4"
},
"_requiredBy": [
"/html-webpack-plugin/util.promisify",
"/util.promisify"
],
"_resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz",
"_spec": "2.1.0",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz",
"_spec": "2.1.4",
"_where": "/home/node/nuxt",
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com"
@@ -36,20 +35,25 @@
"url": "https://github.com/es-shims/object.getownpropertydescriptors/issues"
},
"dependencies": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1"
"array.prototype.reduce": "^1.0.4",
"call-bind": "^1.0.2",
"define-properties": "^1.1.4",
"es-abstract": "^1.20.1"
},
"description": "ES2017 spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.",
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^15.0.2",
"covert": "^1.1.1",
"eslint": "^6.7.2",
"functions-have-names": "^1.2.0",
"replace": "^1.1.1",
"safe-publish-latest": "^1.1.4",
"semver": "^6.3.0",
"tape": "^4.11.0"
"@es-shims/api": "^2.2.3",
"@ljharb/eslint-config": "^21.0.0",
"aud": "^2.0.0",
"auto-changelog": "^2.4.0",
"eslint": "=8.8.0",
"functions-have-names": "^1.2.3",
"has-strict-mode": "^1.0.1",
"mock-property": "^1.0.0",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.5.3"
},
"engines": {
"node": ">= 0.8"
@@ -72,21 +76,25 @@
"license": "MIT",
"main": "index.js",
"name": "object.getownpropertydescriptors",
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"repository": {
"type": "git",
"url": "git://github.com/es-shims/object.getownpropertydescriptors.git"
},
"scripts": {
"coverage": "covert test/*.js",
"coverage:quiet": "covert test/*.js --quiet",
"lint": "eslint .",
"posttest": "npx aud",
"prepublish": "safe-publish-latest",
"pretest": "npm run --silent lint && es-shim-api --bound",
"lint": "eslint --ext=js,mjs .",
"postlint": "es-shim-api --bound",
"posttest": "aud --production",
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"test:module": "node test",
"test:shimmed": "node test/shimmed",
"tests-only": "npm run --silent test:shimmed && npm run --silent test:module"
"tests-only": "nyc tape 'test/**/*.js'"
},
"testling": {
"files": [
@@ -109,5 +117,5 @@
"android-browser/4.2"
]
},
"version": "2.1.0"
"version": "2.1.4"
}
+20
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();
});
+2 -1
View File
@@ -1,7 +1,8 @@
'use strict';
require('../auto');
var getDescriptors = require('../');
getDescriptors.shim();
var test = require('tape');
var defineProperties = require('define-properties');
+3 -4
View File
@@ -1,5 +1,7 @@
'use strict';
var mockProperty = require('mock-property');
module.exports = function (getDescriptors, t) {
var enumDescriptor = {
configurable: true,
@@ -28,9 +30,7 @@ module.exports = function (getDescriptors, t) {
writable: true
};
/* eslint-disable no-extend-native, accessor-pairs */
Object.defineProperty(Object.prototype, key, { configurable: true, set: function (v) { throw new Error(v); } });
/* eslint-enable no-extend-native, accessor-pairs */
st.teardown(mockProperty(Object.prototype, key, { set: function (v) { throw new Error(v); } }));
var hasOwnNamesBug = false;
try {
@@ -102,7 +102,6 @@ module.exports = function (getDescriptors, t) {
st.end();
});
/* global Proxy */
var supportsProxy = typeof Proxy === 'function';
t.test('Proxies that return an undefined descriptor', { skip: !supportsProxy }, function (st) {
var obj = { foo: true };