Skip to content

Commit

Permalink
[Breaking change] Return array if selector length is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
hum-n committed Jul 19, 2019
1 parent 5a9db8e commit 46245b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modujs",
"version": "1.1.5",
"version": "1.2.0",
"description": "Dead simple modular JavaScript framework for ES modules.",
"repository": "modularorg/modularjs",
"author": "Antoine Boulanger <[email protected]> (https://antoineboulanger.com)",
Expand Down
8 changes: 1 addition & 7 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,7 @@ export default class {
parent = context;
}

const els = parent.querySelectorAll('[' + this.mAttr + '=' + name + ']' + more);

if (els.length == 1) {
return els[0];
} else {
return els;
}
return parent.querySelectorAll('[' + this.mAttr + '=' + name + ']' + more);
}

parent(query, context) {
Expand Down

0 comments on commit 46245b9

Please sign in to comment.