diff --git a/surreal.js b/surreal.js index cab443a..51e96fc 100644 --- a/surreal.js +++ b/surreal.js @@ -1,4 +1,4 @@ -// Welcome to Surreal 1.3.0 +// Welcome to Surreal 1.3.1 // Documentation: https://github.com/gnat/surreal // Locality of Behavior (LoB): https://htmx.org/essays/locality-of-behaviour/ let surreal = (function () { @@ -9,9 +9,9 @@ let $ = { // Convenience for internals. // Table of contents and convenient call chaining sugar. For a familiar "jQuery like" syntax. 🙂 // Check before adding new: https://youmightnotneedjquery.com/ sugar(e) { - if ($.isNodeList(e)) { e.forEach(_ => { $.sugar(_) }) } // Apply Surreal to nodes in array as well as the array. - if (!$.isNode(e) && !$.isNodeList(e)) { console.warn(`Surreal: Not a supported element / node / array of nodes "${e}"`); return e } - if (e.hasOwnProperty('hasSurreal')) return e // Surreal already applied + if (!$.isNode(e) && !$.isNodeList(e)) { console.warn(`Surreal: Not a supported element / node / node list "${e}"`); return e } + if ($.isNodeList(e)) e.forEach(_ => { $.sugar(_) }) // Add Surreal to all nodes from any() + if (e.hasOwnProperty('hasSurreal')) return e // Surreal already added. // General e.run = (f) => { return $.run(e, f) } @@ -47,8 +47,8 @@ let $ = { // Convenience for internals. e.hasSurreal = 1 return e }, - // Return single element. Selector not needed if used with inline