Skip to content

Commit

Permalink
stop directly exporting tag method (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp authored Dec 10, 2016
1 parent fafee87 commit e1cd61e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ var is = require('./lib/is')
var clone = require('./lib/clone')
var stringify = require('./lib/stringify')

exports = module.exports = tag
exports = module.exports = function ltx () {
return tag.apply(null, arguments)
}

exports.Element = Element

Expand Down
14 changes: 14 additions & 0 deletions test/ltx-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'

var vows = require('vows')
var assert = require('assert')
var ltx = require('..')
var tag = require('../lib/tag')

vows.describe('ltx').addBatch({
'returns same result as tag': function () {
var a = tag(['<foo>', '</foo>'], 'bar')
var b = ltx(['<foo>', '</foo>'], 'bar')
assert.strictEqual(a.toString(), b.toString())
}
}).export(module)
1 change: 0 additions & 1 deletion test/tag-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var Element = ltx.Element

vows.describe('tag').addBatch({
'exported correctly': function () {
assert.equal(ltx, tag)
assert.equal(ltx.tag, tag)
},
'parses the string and return an Element object': function () {
Expand Down

0 comments on commit e1cd61e

Please sign in to comment.