aboutsummaryrefslogtreecommitdiff
path: root/lib/xml
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-06-28 21:51:50 +0100
committerMichael Williamson <mike@zwobble.org>2016-06-28 21:51:50 +0100
commit4b13398d9f4fc303d22fc24aac519113941b032c (patch)
tree7422aa51b30de16ff9a90fb8863f1503ef755642 /lib/xml
parentd046c4297a04b6eecadf01093382b72bb1b71032 (diff)
Add stylistic eslint rules
Diffstat (limited to 'lib/xml')
-rw-r--r--lib/xml/nodes.js4
-rw-r--r--lib/xml/reader.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/xml/nodes.js b/lib/xml/nodes.js
index 9305918..76f5fd7 100644
--- a/lib/xml/nodes.js
+++ b/lib/xml/nodes.js
@@ -32,7 +32,7 @@ function Element(name, attributes, children) {
Element.prototype.first = function(name) {
return _.find(this.children, function(child) {
- return child.name == name;
+ return child.name === name;
});
};
@@ -42,7 +42,7 @@ Element.prototype.firstOrEmpty = function(name) {
Element.prototype.getElementsByTagName = function(name) {
var elements = _.filter(this.children, function(child) {
- return child.name == name;
+ return child.name === name;
});
return toElementList(elements);
};
diff --git a/lib/xml/reader.js b/lib/xml/reader.js
index 67b69be..844ee0c 100644
--- a/lib/xml/reader.js
+++ b/lib/xml/reader.js
@@ -78,8 +78,8 @@ function readString(xmlString, namespaceMap) {
function mapObject(input, valueFunc, keyFunc) {
return _.reduce(input, function(result, value, key) {
- var mappedKey = keyFunc.call(null, value, key, input);
- result[mappedKey] = valueFunc.call(null, value, key, input);
+ var mappedKey = keyFunc(value, key, input);
+ result[mappedKey] = valueFunc(value, key, input);
return result;
}, {});
}