Skip to content

Commit

Permalink
[Refactor] use own-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 29, 2024
1 parent a2cd996 commit 3a06a02
Show file tree
Hide file tree
Showing 37 changed files with 38 additions and 52 deletions.
2 changes: 1 addition & 1 deletion 2015/ObjectDefineProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var ToPropertyDescriptor = require('./ToPropertyDescriptor');

var forEach = require('../helpers/forEach');
var getOwnPropertyDescriptor = require('gopd');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var $push = callBound('Array.prototype.push');

Expand Down
2 changes: 1 addition & 1 deletion 2015/TestIntegrityLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var $gOPD = require('gopd');
var $TypeError = require('es-errors/type');

var every = require('../helpers/every');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var IsDataDescriptor = require('./IsDataDescriptor');
var IsExtensible = require('./IsExtensible');
Expand Down
2 changes: 1 addition & 1 deletion 2016/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2016/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2017/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2017/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2017/WordCharacters.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var Canonicalize = require('./Canonicalize');

var caseFolding = require('../helpers/caseFolding.json');
var forEach = require('../helpers/forEach');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var A = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'; // step 1

Expand Down
2 changes: 1 addition & 1 deletion 2018/CopyDataProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var $TypeError = require('es-errors/type');

var callBound = require('call-bound');
var forEach = require('../helpers/forEach');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');

Expand Down
2 changes: 1 addition & 1 deletion 2018/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2018/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2018/WordCharacters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2019/CopyDataProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2019/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2019/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2019/WordCharacters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2020/CopyDataProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var $TypeError = require('es-errors/type');
var callBound = require('call-bound');
var forEach = require('../helpers/forEach');
var every = require('../helpers/every');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');

Expand Down
2 changes: 1 addition & 1 deletion 2020/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2020/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2020/WordCharacters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2021/CopyDataProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var callBound = require('call-bound');
var forEach = require('../helpers/forEach');
var every = require('../helpers/every');
var some = require('../helpers/some');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');

Expand Down
2 changes: 1 addition & 1 deletion 2021/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2021/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2021/WordCharacters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2022/CopyDataProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2022/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2022/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2022/WordCharacters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2023/CopyDataProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2023/ObjectDefineProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2023/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2023/WordCharacters.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var Canonicalize = require('./Canonicalize');
var caseFolding = require('../helpers/caseFolding.json');
var forEach = require('../helpers/forEach');
var isRegExpRecord = require('../helpers/records/regexp-record');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var basicWordChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'; // step 1

Expand Down
2 changes: 1 addition & 1 deletion 2024/CopyDataProperties.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2024/ObjectDefineProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var ToPropertyDescriptor = require('./ToPropertyDescriptor');

var forEach = require('../helpers/forEach');
var getOwnPropertyDescriptor = require('gopd');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var OwnPropertyKeys = require('own-keys');

var $push = callBound('Array.prototype.push');

Expand Down
2 changes: 1 addition & 1 deletion 2024/TestIntegrityLevel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2024/WordCharacters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 2 additions & 17 deletions helpers/OwnPropertyKeys.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var safePushApply = require('safe-push-apply');

var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true);
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true);
var $gOPS = GetIntrinsic('%Object.getOwnPropertySymbols%', true);

var keys = require('object-keys');

module.exports = $ownKeys || function OwnPropertyKeys(source) {
var ownKeys = ($gOPN || keys)(source);
if ($gOPS) {
safePushApply(ownKeys, $gOPS(source));
}
return ownKeys;
};
// TODO, semver-major: remove
module.exports = require('own-keys');
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"object-inspect": "^1.13.3",
"object-keys": "^1.1.1",
"object.assign": "^4.1.7",
"own-keys": "^1.0.0",
"regexp.prototype.flags": "^1.5.3",
"safe-array-concat": "^1.1.3",
"safe-push-apply": "^1.0.0",
Expand Down

0 comments on commit 3a06a02

Please sign in to comment.