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

one-spaces

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

one-spaces - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

dist/index.js
/**
* @author TroyTae
* @version 1.1.1
* @version 1.1.2
* @name one-spaces

@@ -5,0 +5,0 @@ */

{
"name": "one-spaces",
"version": "1.1.1",
"version": "1.1.2",
"description": "A tiny(121B) module for making className 😎",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -0,4 +1,5 @@

[![npm](https://badge.fury.io/js/one-spaces.svg)](https://www.npmjs.com/package/one-spaces)
# One Spaces
A tiny(121B) module for making className 😎
## Installation

@@ -20,27 +21,36 @@

### arguments
### VanillaJS
```javascript
OneSpaces('cls1', 'cls2', 'cls3') === 'cls3 cls2 cls1 '
var el = document.getElementById('my-element');
// arguments
el.className = OneSpaces('cls1', 'cls2', 'cls3');
// array
el.className = OneSpaces(['cls1', 'cls2'], ['cls3']);
// exclude falsy
el.className = OneSpaces('cls1', null, 'cls2', false && 'none', true && 'cls3');
// mix
el.className = OneSpaces(['cls1', 'cls2'], null, 'cls3');
```
### array
### React (jsx)
```javascript
OneSpaces(['cls1', 'cls2'], ['cls3']) === 'cls3 cls2 cls1 '
```
```jsx
import spaces from 'one-spaces';
### exclude falsy
```javascript
OneSpaces('cls1', null, 'cls2', false && 'none', true && 'cls3') === 'cls3 cls2 cls1 '
export default () => {
return (
<div className={spaces(['cls1', 'cls2'], null, 'cls3')}>
<span>Hello React!</span>
</div>
);
};
```
### mix
### Angular & Vue
```javascript
OneSpaces(['cls1', 'cls2'], null, 'cls3') === 'cls3 cls2 cls1 '
```
Angular and Vue have their own system for className.
Of course you can use this module with them but not recommended.
## License
MIT © Troy Tae
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