Socket
Socket
Sign inDemoInstall

@stormid/boilerplate

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stormid/boilerplate - npm Package Compare versions

Comparing version 1.0.0-alpha.4 to 1.0.0-alpha.5

dist/index.modern.js

2

dist/index.js

@@ -1,2 +0,2 @@

var e={callback:null},n=function(e){var n=e.callback;return function(e){this.classList.toggle("clicked"),n&&n.call&&n.call(this)}};module.exports=function(t,l){var c=[].slice.call(document.querySelectorAll(t));if(0!==c.length)return c.map(function(t){return Object.create(function(e){var t=e.settings,l=e.node;return l.addEventListener("click",n(t).bind(l),!1),{settings:t,node:l,click:n(t)}}({settings:Object.assign({},e,l),node:t}))});console.warn("boilerplate not initialised, no elements found for selector '"+t+"'")};
function t(){return t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}var e={callback:null},n=function(t){var e=t.callback;return function(t){this.classList.toggle("clicked"),e&&e.call&&e.call(this)}},r=function(t){return"string"==typeof t?[].slice.call(document.querySelectorAll(t)):t instanceof Array?t:Object.prototype.isPrototypeOf.call(NodeList.prototype,t)?[].slice.call(t):t instanceof HTMLElement?[t]:[]};exports.default=function(l,o){var c=r(l);if(0!==c.length)return c.map(function(r){return Object.create(function(t){var e=t.settings,r=t.node;return r.addEventListener("click",n(e).bind(r),!1),{settings:e,node:r,click:n(e)}}({settings:t({},e,o),node:r}))});console.warn("boilerplate not initialised, no elements found for selector '"+l+"'")},exports.getSelection=r;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.boilerplate=n()}(this,function(){var e={callback:null},n=function(e){var n=e.callback;return function(e){this.classList.toggle("clicked"),n&&n.call&&n.call(this)}};return function(t,i){var l=[].slice.call(document.querySelectorAll(t));if(0!==l.length)return l.map(function(t){return Object.create(function(e){var t=e.settings,i=e.node;return i.addEventListener("click",n(t).bind(i),!1),{settings:t,node:i,click:n(t)}}({settings:Object.assign({},e,i),node:t}))});console.warn("boilerplate not initialised, no elements found for selector '"+t+"'")}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).boilerplate={})}(this,function(e){function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},t.apply(this,arguments)}var n={callback:null},o=function(e){var t=e.callback;return function(e){this.classList.toggle("clicked"),t&&t.call&&t.call(this)}},i=function(e){return"string"==typeof e?[].slice.call(document.querySelectorAll(e)):e instanceof Array?e:Object.prototype.isPrototypeOf.call(NodeList.prototype,e)?[].slice.call(e):e instanceof HTMLElement?[e]:[]};e.default=function(e,l){var r=i(e);if(0!==r.length)return r.map(function(e){return Object.create(function(e){var t=e.settings,n=e.node;return n.addEventListener("click",o(t).bind(n),!1),{settings:t,node:n,click:o(t)}}({settings:t({},n,l),node:e}))});console.warn("boilerplate not initialised, no elements found for selector '"+e+"'")},e.getSelection=i});
//# sourceMappingURL=index.umd.js.map
{
"name": "@stormid/boilerplate",
"version": "1.0.0-alpha.4",
"version": "1.0.0-alpha.5",
"description": "Boilerplate for developing UI components",

@@ -30,6 +30,3 @@ "author": "stormid",

},
"jest": {
"testURL": "http://localhost"
},
"gitHead": "21baf6c4e6b44d324308f2b97a1654537839e455"
"gitHead": "5a78d93bb9f509d1af5dcf4d3b3f30bb2cd1583f"
}

@@ -19,9 +19,29 @@

Initialise the module
Import the module
```
import boilerplate from '@stormid/boilerplate';
Initialise the module via selector string
```
const [ instance ] = boilerplate('.js-boilerplate');
```
Initialise with a DOM element
```
const element = document.querySelector('.js-boilerplate');
const [ instance ] = boilerplate(element);
```
Initialise with a Node list
```
const elements = document.querySelectorAll('.js-boilerplate');
const [ instance ] = boilerplate(elements);
```
Initialise with an Array of elements
```
const elements = [].slice.call(document.querySelectorAll('.js-boilerplate'));
const [ instance ] = boilerplate(elements);
```
## Options

@@ -28,0 +48,0 @@ ```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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