Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elementtree

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elementtree - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

.npmignore

6

CHANGES.md

@@ -0,1 +1,7 @@

elementtree v0.1.5 (in development)
* Fix a bug in the find() and findtext() method which could manifest itself
under some conditions.
[metagriffin]
elementtree v0.1.4

@@ -2,0 +8,0 @@

8

lib/elementpath.js

@@ -321,6 +321,6 @@ /**

function find(element, path) {
var resultElement = findall(element, path);
var resultElements = findall(element, path);
if (resultElement) {
return resultElement[0];
if (resultElements && resultElements.length > 0) {
return resultElements[0];
}

@@ -334,3 +334,3 @@

if (resultElements) {
if (resultElements && resultElements.length > 0) {
return resultElements[0].text;

@@ -337,0 +337,0 @@ }

@@ -9,3 +9,3 @@ {

"description": "XML Serialization and Parsing module based on Python's ElementTree.",
"version": "0.1.4",
"version": "0.1.5",
"keywords": [ "xml", "sax", "parser", "seralization", "elementtree" ],

@@ -12,0 +12,0 @@ "homepage": "https://github.com/racker/node-elementtree",

@@ -278,1 +278,23 @@ /**

};
exports['test_find_null'] = function(test, assert) {
var root = Element('root');
var node = SubElement(root, 'node');
var leaf = SubElement(node, 'leaf');
leaf.text = 'ipsum';
assert.equal(root.find('node/leaf'), leaf);
assert.equal(root.find('no-such-node/leaf'), null);
test.finish();
};
exports['test_findtext_null'] = function(test, assert) {
var root = Element('root');
var node = SubElement(root, 'node');
var leaf = SubElement(node, 'leaf');
leaf.text = 'ipsum';
assert.equal(root.findtext('node/leaf'), 'ipsum');
assert.equal(root.findtext('no-such-node/leaf'), null);
test.finish();
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc