Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

classwrap

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classwrap - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

dist/classwrap.js.gz

2

dist/classwrap.js

@@ -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

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