Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: use Node's promisify function (#5748)
Node's promisify function and the TS types for it give much better type understanding when wrapping a function in `promisify`. This change means we don't maintain our own implementation and our own (sub-par) types and rather lean on the tested and thorough @types/node version instead.
  • Loading branch information
jackfranklin committed Apr 27, 2020
1 parent 1b9d9e9 commit 5e2a029
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 58 deletions.
11 changes: 4 additions & 7 deletions src/helper.ts
Expand Up @@ -13,14 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Errors = require('./Errors');

import debug = require('debug');
import fs = require('fs');
import promisify = require('./promisify');
import {TimeoutError} from './Errors';
import * as debug from 'debug';
import * as fs from 'fs';
import {CDPSession} from './Connection';

const {TimeoutError} = Errors;
import {promisify} from 'util';

const openAsync = promisify(fs.open);
const writeAsync = promisify(fs.write);
Expand Down
51 changes: 0 additions & 51 deletions src/promisify.ts

This file was deleted.

0 comments on commit 5e2a029

Please sign in to comment.