Skip to content

Commit

Permalink
Remove util.promisify
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 19, 2019
1 parent 342d6d2 commit 3ff8f40
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 21 deletions.
3 changes: 1 addition & 2 deletions examples/test_plugin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

const { nextTick } = require('process')

const promisify = require('util.promisify')
const { promisify } = require('util')

const testPlugin = async function({ config, opts: { example_option: opt } }) {
await promisify(nextTick)()
Expand Down
3 changes: 2 additions & 1 deletion gulp/run.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const promisify = require('util.promisify')
const { promisify } = require('util')

const Nodemon = require('nodemon')
// eslint-disable-next-line import/no-internal-modules
const gulpExeca = require('gulp-shared-tasks/dist/exec')
Expand Down
23 changes: 18 additions & 5 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"signal-exit": "^3.0.2",
"type-is": "^1.6.16",
"underscore.string": "^3.3.5",
"util.promisify": "^1.0.0",
"uuid": "^3.3.2",
"vary": "^1.1.2",
"yargs": "^13.2.1"
Expand Down
3 changes: 1 addition & 2 deletions src/compress/adapters/brotli.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

const { brotliCompress, brotliDecompress } = require('zlib')

const promisify = require('util.promisify')
const { promisify } = require('util')

const pBrotliCompress = promisify(brotliCompress)
const pBrotliDecompress = promisify(brotliDecompress)
Expand Down
3 changes: 1 addition & 2 deletions src/compress/adapters/deflate.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

const { deflate, inflate } = require('zlib')

const promisify = require('util.promisify')
const { promisify } = require('util')

const pDeflate = promisify(deflate)
const pInflate = promisify(inflate)
Expand Down
3 changes: 1 addition & 2 deletions src/compress/adapters/gzip.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

const { gzip, gunzip } = require('zlib')

const promisify = require('util.promisify')
const { promisify } = require('util')

const pGzip = promisify(gzip)
const pGunzip = promisify(gunzip)
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/adapters/http/send/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const promisify = require('util.promisify')
const { promisify } = require('util')

const { setStatusCode } = require('./status')
const { setHeaders } = require('./headers')
Expand Down
3 changes: 1 addition & 2 deletions src/protocols/adapters/http/start.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

const http = require('http')

const promisify = require('util.promisify')
const { promisify } = require('util')

// Start HTTP server
const startServer = function({
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/adapters/http/stop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const promisify = require('util.promisify')
const { promisify } = require('util')

// Try a graceful server exit
const stopServer = function({ server }) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/promisify.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const { stat, readdir, readFile, writeFile } = require('fs')
const { promisify } = require('util')

const promisify = require('util.promisify')
const { capitalize } = require('underscore.string')

const { mapValues, mapKeys } = require('./functional')
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'

const { chdir } = require('process')
const { promisify } = require('util')

const test = require('ava')
const execa = require('execa')
const promisify = require('util.promisify')

const pSetTimeout = promisify(setTimeout)

Expand Down

0 comments on commit 3ff8f40

Please sign in to comment.