Comparing version 0.1.0 to 1.0.0
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.classwrap=t()}(this,function(){"use strict";function e(t,n){var r,f="",o=typeof t;if(t&&"string"===o||"number"===o)return t;if(n=n||" ",Array.isArray(t)&&t.length)for(var i=0;i<t.length;i++)(r=e(t[i],n))&&(f+=(f&&n)+r);else for(var i in t)(r=t[i])&&(f+=(f&&n)+i+("object"==typeof r?e(r,n+i):""));return f}return e}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.classwrap=r()}(this,function(){"use strict";function e(r,t){var n,o="",f=typeof r;if(r&&"string"===f||"number"===f)return r;if(t=t||" ",Array.isArray(r)&&r.length)for(var i=0;i<r.length;i++)(n=e(r[i],t))&&(o+=(o&&t)+n);else for(var i in r)r.hasOwnProperty(i)&&(n=r[i])&&(o+=(o&&t)+i+("object"==typeof n?e(n,t+i):""));return o}return e}); | ||
//# sourceMappingURL=classwrap.js.map |
{ | ||
"name": "classwrap", | ||
"description": "320B JavaScript function for conditionally concatenating classNames.", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"main": "dist/classwrap.js", | ||
@@ -6,0 +6,0 @@ "jsnext:main": "src/index.js", |
@@ -6,3 +6,3 @@ # Classwrap | ||
Classwrap is a (320B) JavaScript function for conditionally concatenating [classNames](https://developer.mozilla.org/en-US/docs/Web/API/Element/className). | ||
Classwrap is a (340B) JavaScript function for conditionally concatenating [class names](https://developer.mozilla.org/en-US/docs/Web/API/Element/className). | ||
@@ -25,3 +25,3 @@ [Try it Online](https://codepen.io/jbucaran/pen/GMRjRB) | ||
Classwrap works in >=IE9 and you can use it with your favorite JavaScript view library. | ||
Classwrap works in all browsers >=IE9 and you can use it with your favorite JavaScript view library. | ||
@@ -39,3 +39,3 @@ ## Installation | ||
```js | ||
import wrap from "classwrap" | ||
import classwrap from "classwrap" | ||
``` | ||
@@ -49,7 +49,7 @@ | ||
You can find the library on `window.classwrap`. | ||
You can find the function on `window.classwrap`. | ||
## Usage | ||
Classwrap joins all elements of an array or keys of an object into a string. If the value associated with a given key is falsy, that key will be ignored. | ||
Classwrap joins all elements of an array or keys of an object into a string. If the value associated with a given key is falsy, the key will be ignored. | ||
@@ -66,3 +66,3 @@ ```js | ||
Nested arrays or objects are supported too. This feature can be useful to create classes with a similar prefix. | ||
Nested arrays or objects are supported too. Use this feature to assemble classes with a common prefix. | ||
@@ -90,3 +90,3 @@ ```js | ||
To solve this wrap the arguments inside an array. | ||
To solve this, wrap the arguments inside an array. | ||
@@ -93,0 +93,0 @@ ```js |
@@ -20,3 +20,3 @@ export default function wrap(classes, prefix) { | ||
for (var i in classes) { | ||
if ((value = classes[i])) { | ||
if (classes.hasOwnProperty(i) && (value = classes[i])) { | ||
className += | ||
@@ -23,0 +23,0 @@ (className && prefix) + |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7268
8
1
1