[Pkg-javascript-commits] [ltx] 15/25: stop directly exporting tag method (#107)

Jonas Smedegaard dr at jones.dk
Tue Jan 10 18:21:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit e1cd61eeeb89c60f3af40485a921dddd77820104
Author: Sonny Piers <sonny at fastmail.net>
Date:   Sat Dec 10 14:27:57 2016 +0100

    stop directly exporting tag method (#107)
---
 index.js         |  4 +++-
 test/ltx-test.js | 14 ++++++++++++++
 test/tag-test.js |  1 -
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index ca39d0b..cf194cb 100644
--- a/index.js
+++ b/index.js
@@ -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
 
diff --git a/test/ltx-test.js b/test/ltx-test.js
new file mode 100644
index 0000000..0511f44
--- /dev/null
+++ b/test/ltx-test.js
@@ -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)
diff --git a/test/tag-test.js b/test/tag-test.js
index 5c866db..547550a 100644
--- a/test/tag-test.js
+++ b/test/tag-test.js
@@ -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 () {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list