Skip to content

Commit

Permalink
bump dependencies (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp authored Mar 4, 2017
1 parent ff770ee commit dbe598e
Show file tree
Hide file tree
Showing 6 changed files with 2,280 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!.npmignore
!.travis.yml

dist/
node_modules/

bundle.js
yarn.lock
4 changes: 3 additions & 1 deletion benchmarks/ltx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
benchmark the speed of the different methods to create elements
Not all tests are equally functional but it gives a good idea of what to expect from
the different techniques.
the different methods.
*/

var benchmark = require('benchmark')
Expand All @@ -23,11 +23,13 @@ var el = parse(XML)
var suite = new benchmark.Suite('ltx')

suite.add('tag with template literal', function () {
/* eslint-disable */
tag`
<message to="${'foo@bar'}" from="${'bar@foo'}" type="${'chat'}" id="${'foobar'}">
<body>${'Where there is love there is life.'}</body>
</message>
`
/* eslint-enable */
})

suite.add('tag with direct call', function () {
Expand Down
Empty file added dist/.gitkeep
Empty file.
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
"Sonny Piers"
],
"license": "MIT",
"engine": "node",
"scripts": {
"prepublish": "npm run bundle",
"preversion": "npm test",
"benchmark": "node benchmarks/",
"bundle": "browserify -s ltx index.js -o bundle.js",
"bundle": "browserify -s ltx index.js -o bundle.js && cp bundle.js dist/ltx.js",
"unit": "vows --spec",
"lint": "standard",
"test": "npm run unit && npm run lint && npm run bundle"
Expand All @@ -29,14 +28,14 @@
"inherits": "^2.0.1"
},
"devDependencies": {
"benchmark": "^2.1.0",
"browserify": "^13.0.1",
"libxmljs": "^0.18.0",
"benchmark": "^2.1.3",
"browserify": "^14.1.0",
"libxmljs": "^0.18.4",
"microtime": "^2.1.2",
"node-expat": "^2.3.13",
"node-xml": "^1.0.2",
"sax": "^1.1.5",
"standard": "^8.5.0",
"sax": "^1.2.2",
"standard": "^9.0.0",
"vows": "^0.8.1"
}
}
26 changes: 26 additions & 0 deletions test/stringify-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,31 @@ vows.describe('stringify').addBatch({

assert.equal(stringify(el, 2), expected)
assert.equal(stringify(el, ' '), expected)
},
'ignores empty string children': function () {
const el = {
name: 'foo',
attrs: {},
children: ['', 'bar', '']
}
assert.equal(stringify(el), '<foo>bar</foo>')
},
'ignores deep empty string children': function () {
const el = {
name: 'foo',
attrs: {},
children: [
'',
{
name: 'bar',
attrs: {},
children: [
'', '', ''
]
},
''
]
}
assert.equal(stringify(el), '<foo><bar></bar></foo>')
}
}).export(module)
Loading

0 comments on commit dbe598e

Please sign in to comment.