Skip to content

Commit 0eabf2d

Browse files
authored
chore: replace pify with Util.promisify (#232)
1 parent 08d7eff commit 0eabf2d

File tree

5 files changed

+7
-39
lines changed

5 files changed

+7
-39
lines changed

package-lock.json

Lines changed: 1 addition & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"findit2": "^2.2.3",
3636
"nan": "^2.17.0",
3737
"p-limit": "^3.0.0",
38-
"pify": "^5.0.0",
3938
"protobufjs": "~7.0.0",
4039
"source-map": "~0.8.0-beta.0",
4140
"split": "^1.0.1"
@@ -44,7 +43,6 @@
4443
"@types/mocha": "^9.0.0",
4544
"@types/node": "^16.0.0",
4645
"@types/p-limit": "^2.0.0",
47-
"@types/pify": "^5.0.0",
4846
"@types/pretty-ms": "^4.0.0",
4947
"@types/request": "^2.47.1",
5048
"@types/sinon": "^10.0.0",

ts/src/profile-encoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
import * as pify from 'pify';
17+
import {promisify} from 'util';
1818
import {gzip, gzipSync} from 'zlib';
1919

2020
import {perftools} from '../../proto/profile';
2121

22-
const gzipPromise = pify(gzip);
22+
const gzipPromise = promisify(gzip);
2323

2424
export async function encode(
2525
profile: perftools.profiles.IProfile

ts/src/sourcemapper/sourcemapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
import * as fs from 'fs';
2323
import * as path from 'path';
2424
import * as sourceMap from 'source-map';
25+
import {promisify} from 'util';
2526

2627
import * as scanner from '../../third_party/cloud-debug-nodejs/src/agent/io/scanner';
2728

28-
const pify = require('pify');
2929
const pLimit = require('p-limit');
30-
const readFile = pify(fs.readFile);
30+
const readFile = promisify(fs.readFile);
3131

3232
const CONCURRENCY = 10;
3333
const MAP_EXT = '.map';

ts/test/test-profile-encoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import * as pify from 'pify';
17+
import {promisify} from 'util';
1818
import {gunzip as gunzipPromise, gunzipSync} from 'zlib';
1919

2020
import {perftools} from '../../proto/profile';
@@ -23,7 +23,7 @@ import {encode, encodeSync} from '../src/profile-encoder';
2323
import {decodedTimeProfile, timeProfile} from './profiles-for-tests';
2424

2525
const assert = require('assert');
26-
const gunzip = pify(gunzipPromise);
26+
const gunzip = promisify(gunzipPromise);
2727

2828
describe('profile-encoded', () => {
2929
describe('encode', () => {

0 commit comments

Comments
 (0)