leanweb 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -172,7 +172,10 @@ const nodeHandlers = {
172
172
 
173
173
  const immediateContext = (node, context) => {
174
174
  if (Array.isArray(context)) {
175
- return context.find(contextObj => node.name in contextObj);
175
+ if (context.length === 0) {
176
+ return null;
177
+ }
178
+ return context.find(contextObj => node.name in contextObj) ?? context[0];
176
179
  } else if (typeof context === 'object') {
177
180
  return context;
178
181
  }