Skip to content

Commit

Permalink
Merge pull request #531 from Leonidas-from-XIV/node-4
Browse files Browse the repository at this point in the history
Restore Node 4 compatibility temporarily
  • Loading branch information
Leonidas-from-XIV authored Sep 3, 2019
2 parents 5b11691 + c62b085 commit 7a6d39f
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js

node_js:
- "4"
- "6"
- "8"
- "10"
- "12"
Expand Down
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.

131 changes: 128 additions & 3 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
},
"dependencies": {
"sax": ">=0.6.0",
"xmlbuilder": "~13.0.0"
"xmlbuilder": "~11.0.0",
"util.promisify": "~1.0.0"
},
"devDependencies": {
"coffee-script": ">=1.10.0",
Expand All @@ -86,7 +87,7 @@
"zap": ">=0.2.9"
},
"engines": {
"node": ">=8.0.0"
"node": ">=4.0.0"
},
"license": "MIT"
}
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 7a6d39f

Please sign in to comment.