util.promisify
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -8,4 +8,24 @@ # Changelog | ||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). | ||
## [v1.1.0](https://github.com/ljharb/util.promisify/compare/v1.0.1...v1.1.0) - 2021-01-06 | ||
### Commits | ||
- [Tests] migrate tests to Github Actions [`a09e2f5`](https://github.com/ljharb/util.promisify/commit/a09e2f5cc3590c3098681c98b08dcb15b5c0877b) | ||
- [Tests] add tests [`5162b64`](https://github.com/ljharb/util.promisify/commit/5162b642805030b7d83e978e73392213d0b2431a) | ||
- [meta] do not publish github action workflow files [`4b5a39e`](https://github.com/ljharb/util.promisify/commit/4b5a39ed1df1c6ce86fb687f7494882fd29099ba) | ||
- [Fix] handle nonconfigurable own function properties, in older engines [`07693ae`](https://github.com/ljharb/util.promisify/commit/07693ae63cdc71d88c2203d62aca53623fba4815) | ||
- [New] use a global symbol for `util.promisify.custom` [`8f8631b`](https://github.com/ljharb/util.promisify/commit/8f8631b04c3f2cf1bd082837c8d73431e356eb2f) | ||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`83e7267`](https://github.com/ljharb/util.promisify/commit/83e7267f27e38a9abcba6803f945c71a68255ff9) | ||
- [actions] add "Allow Edits" workflow [`e2a92ae`](https://github.com/ljharb/util.promisify/commit/e2a92ae988554713f89e62fcbf0ac602f76976f6) | ||
- [Tests] move `es-shim-api` to `postlint` [`7b93efa`](https://github.com/ljharb/util.promisify/commit/7b93efacd4c978b76d02be9b33b94b61ee366e65) | ||
- [Deps] use `call-bind` instead of `es-abstract` [`e68f500`](https://github.com/ljharb/util.promisify/commit/e68f500d9dd0cdd0563d72b758e34bdf1bed0d6c) | ||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`7da936c`](https://github.com/ljharb/util.promisify/commit/7da936c0681062c5eb812185ebc9ccf4d86851c5) | ||
- [Dev Deps] update `aud`, `auto-changelog` [`88465d4`](https://github.com/ljharb/util.promisify/commit/88465d4202969895123e3113db3e8b45972ca2f6) | ||
- [Tests] only audit prod deps [`8a13dc5`](https://github.com/ljharb/util.promisify/commit/8a13dc5192ab899034e1f78151324ea06fb381b1) | ||
- [Deps] update `object.getownpropertydescriptors` [`899d30b`](https://github.com/ljharb/util.promisify/commit/899d30b3389b033b3964dd0e7faa0469db8b3ba4) | ||
- [Deps] update `es-abstract` [`552d18b`](https://github.com/ljharb/util.promisify/commit/552d18b34ebc0eda0d0bc33a84ca1827aa86aaf9) | ||
- [Dev Deps] update `auto-changelog` [`dd61917`](https://github.com/ljharb/util.promisify/commit/dd61917fabad7c8c4c52807ca4b5b40611a14e62) | ||
- [Deps] update `es-abstract` [`40a839a`](https://github.com/ljharb/util.promisify/commit/40a839a8db3d79699688d27f6613a827056428c8) | ||
- [Dev Deps] update `@ljharb/eslint-config` [`07c3b39`](https://github.com/ljharb/util.promisify/commit/07c3b3952682e9c4d58b6bfb9404049827b5c523) | ||
## [v1.0.1](https://github.com/ljharb/util.promisify/compare/v1.0.0...v1.0.1) - 2020-01-16 | ||
@@ -12,0 +32,0 @@ |
'use strict'; | ||
var isES5 = typeof Object.defineProperty === 'function' | ||
&& typeof Object.defineProperties === 'function'; | ||
var forEach = require('for-each'); | ||
var isES5 = typeof Object.defineProperty === 'function'; | ||
var hasProto = [].__proto__ === Array.prototype; // eslint-disable-line no-proto | ||
@@ -18,3 +19,3 @@ | ||
var callBound = require('es-abstract/helpers/callBound'); | ||
var callBound = require('call-bind/callBound'); | ||
@@ -27,3 +28,4 @@ var $slice = callBound('Array.prototype.slice'); | ||
var kCustomPromisifiedSymbol = hasSymbols ? Symbol('util.promisify.custom') : null; | ||
// eslint-disable-next-line no-restricted-properties | ||
var kCustomPromisifiedSymbol = hasSymbols ? Symbol['for']('nodejs.util.promisify.custom') : null; | ||
var kCustomPromisifyArgsSymbol = hasSymbols ? Symbol('customPromisifyArgs') : null; | ||
@@ -86,3 +88,11 @@ | ||
}); | ||
return Object.defineProperties(promisified, getOwnPropertyDescriptors(orig)); | ||
var descriptors = getOwnPropertyDescriptors(orig); | ||
forEach(descriptors, function (k, v) { | ||
try { | ||
Object.defineProperty(promisified, k, v); | ||
} catch (e) { | ||
// handle nonconfigurable function properties | ||
} | ||
}); | ||
return promisified; | ||
}; | ||
@@ -89,0 +99,0 @@ |
{ | ||
"name": "util.promisify", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Polyfill/shim for util.promisify in node versions < v8", | ||
"main": "index.js", | ||
"dependencies": { | ||
"call-bind": "^1.0.0", | ||
"define-properties": "^1.1.3", | ||
"es-abstract": "^1.17.2", | ||
"has-symbols": "^1.0.1", | ||
"object.getownpropertydescriptors": "^2.1.0" | ||
"for-each": "^0.3.3", | ||
"object.getownpropertydescriptors": "^2.1.1" | ||
}, | ||
"devDependencies": { | ||
"@es-shims/api": "^2.1.2", | ||
"@ljharb/eslint-config": "^15.1.0", | ||
"auto-changelog": "^1.16.2", | ||
"eslint": "^6.8.0", | ||
"safe-publish-latest": "^1.1.4" | ||
"@ljharb/eslint-config": "^17.3.0", | ||
"aud": "^1.1.3", | ||
"auto-changelog": "^2.2.1", | ||
"eslint": "^7.17.0", | ||
"has-symbols": "^1.0.1", | ||
"nyc": "^10.3.2", | ||
"safe-publish-latest": "^1.1.4", | ||
"tape": "^5.1.1" | ||
}, | ||
@@ -22,6 +26,7 @@ "scripts": { | ||
"lint": "eslint .", | ||
"postlint": "es-shim-api --bound", | ||
"pretest": "npm run lint", | ||
"tests-only": "es-shim-api --bound", | ||
"tests-only": "nyc tape 'test/**/*.js'", | ||
"test": "npm run tests-only", | ||
"posttest": "npx aud", | ||
"posttest": "aud --production", | ||
"version": "auto-changelog && git add CHANGELOG.md", | ||
@@ -56,4 +61,5 @@ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" | ||
"commitLimit": false, | ||
"backfillLimit": false | ||
"backfillLimit": false, | ||
"hideCredit": true | ||
} | ||
} |
@@ -7,3 +7,3 @@ 'use strict'; | ||
module.exports = function getPolyfill() { | ||
if (typeof util.promisify === 'function') { | ||
if (typeof util.promisify === 'function' && util.promisify.custom === implementation.custom) { | ||
return util.promisify; | ||
@@ -10,0 +10,0 @@ } |
Sorry, the diff of this file is not supported yet
20270
17
212
9
+ Addedcall-bind@^1.0.0
+ Addedfor-each@^0.3.3
- Removedes-abstract@^1.17.2
- Removedhas-symbols@^1.0.1