Comparing version 0.9.1 to 1.0.0
@@ -13,3 +13,3 @@ # Contributing guide | ||
Most of the coding standards are covered by `.jshintrc`. You can also test | ||
Most of the coding standards are covered by `.jshintrc`. You can also test | ||
any changes with `grunt test` (this will also run the tests). | ||
@@ -25,3 +25,3 @@ | ||
We acknowledge all the code does not meet these standards but we are working | ||
We acknowledge all the code does not meet these standards but we are working | ||
to change this over time. | ||
@@ -28,0 +28,0 @@ |
'use strict'; | ||
module.exports = require('./lib/index.js') | ||
module.exports = require('./lib/index.js') |
@@ -110,2 +110,14 @@ 'use strict'; | ||
DOMElement.createElement = function(name, attrs /*, child1, child2, ...*/) { | ||
var el = new DOMElement(name, attrs) | ||
var children = Array.prototype.slice.call(arguments, 2) | ||
children.forEach(function(child) { | ||
el.appendChild(child) | ||
}) | ||
return el | ||
} | ||
module.exports = DOMElement |
@@ -375,2 +375,14 @@ 'use strict'; | ||
Element.createElement = function(name, attrs /*, child1, child2, ...*/) { | ||
var el = new Element(name, attrs) | ||
var children = Array.prototype.slice.call(arguments, 2) | ||
children.forEach(function(child) { | ||
el.cnode(child) | ||
}) | ||
return el | ||
} | ||
function escapeXml(s) { | ||
@@ -377,0 +389,0 @@ return s. |
@@ -9,2 +9,2 @@ 'use strict'; | ||
/* SHIM */ | ||
module.exports = require('./index') | ||
module.exports = require('./index') |
'use strict'; | ||
var parse = require('./parse') | ||
var element = require('./element') | ||
var Element = element.Element | ||
var DOMElement = require('./dom-element') | ||
@@ -8,8 +11,12 @@ /** | ||
*/ | ||
exports.Element = require('./dom-element') | ||
exports.Element = DOMElement | ||
exports.createElement = Element.createElement | ||
exports.DOMElement = DOMElement | ||
exports.createDOMElement = DOMElement.createElement | ||
/** | ||
* Helper | ||
*/ | ||
exports.escapeXml = require('./element').escapeXml | ||
exports.escapeXml = element.escapeXml | ||
@@ -16,0 +23,0 @@ /** |
@@ -60,2 +60,2 @@ 'use strict'; | ||
} | ||
} | ||
} |
@@ -43,2 +43,2 @@ 'use strict'; | ||
} | ||
} | ||
} |
@@ -45,2 +45,2 @@ 'use strict'; | ||
this.parser.close() | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -111,2 +111,14 @@ | ||
DOMElement.createElement = function(name, attrs /*, child1, child2, ...*/) { | ||
var el = new DOMElement(name, attrs) | ||
var children = Array.prototype.slice.call(arguments, 2) | ||
children.forEach(function(child) { | ||
el.appendChild(child) | ||
}) | ||
return el | ||
} | ||
module.exports = DOMElement | ||
@@ -489,2 +501,14 @@ | ||
Element.createElement = function(name, attrs /*, child1, child2, ...*/) { | ||
var el = new Element(name, attrs) | ||
var children = Array.prototype.slice.call(arguments, 2) | ||
children.forEach(function(child) { | ||
el.cnode(child) | ||
}) | ||
return el | ||
} | ||
function escapeXml(s) { | ||
@@ -519,2 +543,3 @@ return s. | ||
module.exports = require('./index') | ||
},{"./index":4,"./parse":5,"./sax/sax_ltx":6}],4:[function(require,module,exports){ | ||
@@ -524,2 +549,5 @@ 'use strict'; | ||
var parse = require('./parse') | ||
var element = require('./element') | ||
var Element = element.Element | ||
var DOMElement = require('./dom-element') | ||
@@ -529,8 +557,12 @@ /** | ||
*/ | ||
exports.Element = require('./dom-element') | ||
exports.Element = DOMElement | ||
exports.createElement = Element.createElement | ||
exports.DOMElement = DOMElement | ||
exports.createDOMElement = DOMElement.createElement | ||
/** | ||
* Helper | ||
*/ | ||
exports.escapeXml = require('./element').escapeXml | ||
exports.escapeXml = element.escapeXml | ||
@@ -900,6 +932,4 @@ /** | ||
throw er; // Unhandled 'error' event | ||
} else { | ||
throw TypeError('Uncaught, unspecified "error" event.'); | ||
} | ||
return false; | ||
throw TypeError('Uncaught, unspecified "error" event.'); | ||
} | ||
@@ -989,3 +1019,6 @@ } | ||
this._events[type].length); | ||
console.trace(); | ||
if (typeof console.trace === 'function') { | ||
// not supported in IE 10 | ||
console.trace(); | ||
} | ||
} | ||
@@ -1173,38 +1206,62 @@ } | ||
var process = module.exports = {}; | ||
var queue = []; | ||
var draining = false; | ||
var currentQueue; | ||
var queueIndex = -1; | ||
process.nextTick = (function () { | ||
var canSetImmediate = typeof window !== 'undefined' | ||
&& window.setImmediate; | ||
var canPost = typeof window !== 'undefined' | ||
&& window.postMessage && window.addEventListener | ||
; | ||
function cleanUpNextTick() { | ||
draining = false; | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
} else { | ||
queueIndex = -1; | ||
} | ||
if (queue.length) { | ||
drainQueue(); | ||
} | ||
} | ||
if (canSetImmediate) { | ||
return function (f) { return window.setImmediate(f) }; | ||
function drainQueue() { | ||
if (draining) { | ||
return; | ||
} | ||
var timeout = setTimeout(cleanUpNextTick); | ||
draining = true; | ||
if (canPost) { | ||
var queue = []; | ||
window.addEventListener('message', function (ev) { | ||
var source = ev.source; | ||
if ((source === window || source === null) && ev.data === 'process-tick') { | ||
ev.stopPropagation(); | ||
if (queue.length > 0) { | ||
var fn = queue.shift(); | ||
fn(); | ||
} | ||
} | ||
}, true); | ||
var len = queue.length; | ||
while(len) { | ||
currentQueue = queue; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
currentQueue[queueIndex].run(); | ||
} | ||
queueIndex = -1; | ||
len = queue.length; | ||
} | ||
currentQueue = null; | ||
draining = false; | ||
clearTimeout(timeout); | ||
} | ||
return function nextTick(fn) { | ||
queue.push(fn); | ||
window.postMessage('process-tick', '*'); | ||
}; | ||
process.nextTick = function (fun) { | ||
var args = new Array(arguments.length - 1); | ||
if (arguments.length > 1) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
queue.push(new Item(fun, args)); | ||
if (queue.length === 1 && !draining) { | ||
setTimeout(drainQueue, 0); | ||
} | ||
}; | ||
return function nextTick(fn) { | ||
setTimeout(fn, 0); | ||
}; | ||
})(); | ||
// v8 likes predictible objects | ||
function Item(fun, array) { | ||
this.fun = fun; | ||
this.array = array; | ||
} | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
}; | ||
process.title = 'browser'; | ||
@@ -1214,2 +1271,4 @@ process.browser = true; | ||
process.argv = []; | ||
process.version = ''; // empty string to avoid regexp issues | ||
process.versions = {}; | ||
@@ -1219,4 +1278,7 @@ function noop() {} | ||
process.on = noop; | ||
process.addListener = noop; | ||
process.once = noop; | ||
process.off = noop; | ||
process.removeListener = noop; | ||
process.removeAllListeners = noop; | ||
process.emit = noop; | ||
@@ -1226,3 +1288,3 @@ | ||
throw new Error('process.binding is not supported'); | ||
} | ||
}; | ||
@@ -1234,2 +1296,3 @@ // TODO(shtylman) | ||
}; | ||
process.umask = function() { return 0; }; | ||
@@ -1832,3 +1895,3 @@ },{}],10:[function(require,module,exports){ | ||
}).call(this,require("/home/lloyd/Dropbox/code/node-xmpp/ltx/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{"./support/isBuffer":10,"/home/lloyd/Dropbox/code/node-xmpp/ltx/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":9,"inherits":8}]},{},[3]) | ||
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{"./support/isBuffer":10,"_process":9,"inherits":8}]},{},[3]); |
{ | ||
"name": "ltx", | ||
"version": "0.9.1", | ||
"version": "1.0.0", | ||
"main": "./lib/index", | ||
@@ -9,3 +9,3 @@ "browser": "./lib/index-browserify", | ||
"dependencies": { | ||
"sax": "~0.6.0", | ||
"sax": "~1.1.1", | ||
"node-expat": "~2.3.0" | ||
@@ -36,3 +36,4 @@ }, | ||
"Julien Genestoux", | ||
"▟ ▖▟ ▖" | ||
"▟ ▖▟ ▖", | ||
"Sonny Piers" | ||
], | ||
@@ -45,10 +46,10 @@ "license": "MIT", | ||
"grunt": "~0.4.2", | ||
"grunt-browserify": "~1.3.1", | ||
"grunt-browserify": "~4.0.0", | ||
"grunt-cli": "~0.1.13", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-jshint": "~0.8.0", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-contrib-jshint": "~0.11.2", | ||
"grunt-vows": "~0.4.0", | ||
"node-xml": ">=1.0.1", | ||
"request-animation-frame": ">=0.1.0", | ||
"vows": "~0.7.0" | ||
"vows": "~0.8.1" | ||
}, | ||
@@ -55,0 +56,0 @@ "scripts": { |
@@ -38,4 +38,16 @@ 'use strict'; | ||
} | ||
} | ||
}, | ||
'createElement': { | ||
'create a new element and set children': function() { | ||
var c = new ltx.DOMElement('bar') | ||
var e = ltx.createDOMElement('foo', {'foo': 'bar'}, 'foo', c) | ||
assert(e instanceof ltx.DOMElement) | ||
assert.equal(e.localName, 'foo') | ||
assert.equal(e.getAttribute('foo'), 'bar') | ||
assert.equal(e.childNodes.length, 2) | ||
assert.equal(e.childNodes[0], 'foo') | ||
assert.equal(e.childNodes[1], c) | ||
} | ||
}, | ||
}).export(module) | ||
}) | ||
}) |
@@ -5,3 +5,4 @@ 'use strict'; | ||
, assert = require('assert') | ||
, ltx = require('./../lib/index') | ||
, ltx = require('../lib/index') | ||
, Element = require('../lib/element').Element | ||
@@ -26,2 +27,14 @@ vows.describe('ltx').addBatch({ | ||
}, | ||
'createElement': { | ||
'create a new element and set children': function() { | ||
var c = new ltx.Element('bar') | ||
var e = ltx.createElement('foo', {'foo': 'bar'}, 'foo', c) | ||
assert(e instanceof Element) | ||
assert(e.is('foo')) | ||
assert.equal(e.attrs.foo, 'bar') | ||
assert.equal(e.children.length, 2) | ||
assert.equal(e.children[0], 'foo') | ||
assert.equal(e.children[1], c) | ||
} | ||
}, | ||
'serialization': { | ||
@@ -28,0 +41,0 @@ 'serialize an element': function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
106987
29
3217
0
1
+ Addedsax@1.1.6(transitive)
- Removedsax@0.6.1(transitive)
Updatedsax@~1.1.1