Skip to content

Commit

Permalink
Use promise shim instead of actual Node function
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidas-from-XIV committed Sep 3, 2019
1 parent fd006fd commit c62b085
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/parser.js

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

4 changes: 2 additions & 2 deletions src/parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

sax = require 'sax'
events = require 'events'
util = require 'util'
bom = require './bom'
processors = require './processors'
setImmediate = require('timers').setImmediate
defaults = require('./defaults').defaults
promisify = require 'util.promisify'

# Underscore has a nice function for this, but we try to go without dependencies
isEmpty = (thing) ->
Expand Down Expand Up @@ -255,7 +255,7 @@ class exports.Parser extends events
throw err

parseStringPromise: (str) =>
util.promisify(@parseString) str
promisify(@parseString) str

exports.parseString = (str, a, b) ->
# let's determine what we got as arguments
Expand Down
4 changes: 2 additions & 2 deletions test/parser.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ util = require 'util'
assert = require 'assert'
path = require 'path'
os = require 'os'
util = require 'util'
promisify = require 'util.promisify'

fileName = path.join __dirname, '/fixtures/sample.xml'

readFilePromise = util.promisify fs.readFile
readFilePromise = promisify fs.readFile

skeleton = (options, checks) ->
(test) ->
Expand Down

0 comments on commit c62b085

Please sign in to comment.