@bem-react/classnames 1.3.9 → 1.3.11-dev.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.10](https://github.com/bem/bem-react/compare/@bem-react/classnames@1.3.9...@bem-react/classnames@1.3.10) (2021-06-08)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- update pkg ([1ccdee8](https://github.com/bem/bem-react/commit/1ccdee8d9c4c09a02f888ee880a332ac75b725fd))
|
|
11
|
+
|
|
6
12
|
## [1.3.9](https://github.com/bem/bem-react/compare/@bem-react/classnames@1.3.8...@bem-react/classnames@1.3.9) (2020-03-12)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @bem-react/classnames
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate className string with unique tokens.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* classnames('Button', 'Header-Button', undefined) // -> Button Header-Button
|
|
6
|
+
*
|
|
7
|
+
* @param tokens ClassNames tokens.
|
|
8
|
+
*/
|
|
9
|
+
function classnames() {
|
|
10
|
+
var tokens = [];
|
|
11
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
12
|
+
tokens[_i] = arguments[_i];
|
|
13
|
+
}
|
|
14
|
+
var className = '';
|
|
15
|
+
var uniqueCache = new Set();
|
|
16
|
+
var classNameList = tokens.join(' ').split(' ');
|
|
17
|
+
for (var _a = 0, classNameList_1 = classNameList; _a < classNameList_1.length; _a++) {
|
|
18
|
+
var value = classNameList_1[_a];
|
|
19
|
+
if (value === '' || uniqueCache.has(value)) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
uniqueCache.add(value);
|
|
23
|
+
if (className.length > 0) {
|
|
24
|
+
className += ' ';
|
|
25
|
+
}
|
|
26
|
+
className += value;
|
|
27
|
+
}
|
|
28
|
+
return className;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { classnames };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bem-react/classnames",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11-dev.43+591cfee",
|
|
4
4
|
"description": "BEM React ClassNames merge",
|
|
5
5
|
"homepage": "https://github.com/bem/bem-react/tree/master/packages/classnames",
|
|
6
6
|
"repository": "https://github.com/bem/bem-react",
|
|
@@ -8,36 +8,28 @@
|
|
|
8
8
|
"classes",
|
|
9
9
|
"merge"
|
|
10
10
|
],
|
|
11
|
-
"main": "index.js",
|
|
12
|
-
"typings": "classnames.d.ts",
|
|
13
11
|
"publishConfig": {
|
|
14
12
|
"access": "public"
|
|
15
13
|
},
|
|
16
|
-
"files": [
|
|
17
|
-
"build",
|
|
18
|
-
"classnames.d.ts"
|
|
19
|
-
],
|
|
20
14
|
"license": "MPL-2.0",
|
|
21
15
|
"scripts": {
|
|
22
16
|
"prepublishOnly": "npm run build",
|
|
23
17
|
"build": "node ../../scripts/rollup/build.js",
|
|
24
18
|
"unit": "../../node_modules/.bin/jest --config ../../.config/jest/jest.config.js"
|
|
25
19
|
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"instrument": true,
|
|
40
|
-
"all": true
|
|
20
|
+
"files": [
|
|
21
|
+
"build",
|
|
22
|
+
"classnames.d.ts"
|
|
23
|
+
],
|
|
24
|
+
"main": "./build/classnames.cjs",
|
|
25
|
+
"module": "./build/classnames.mjs",
|
|
26
|
+
"types": "./classnames.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./classnames.d.ts",
|
|
30
|
+
"import": "./build/classnames.mjs",
|
|
31
|
+
"require": "./build/classnames.cjs"
|
|
32
|
+
}
|
|
41
33
|
},
|
|
42
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "591cfee41cfc0dce2f099f2e3d590fdf8bfbf51e"
|
|
43
35
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function classnames(){for(var e=[],s=0;s<arguments.length;s++)e[s]=arguments[s];for(var t="",a=new Set,n=0,r=e.join(" ").split(" ");n<r.length;n++){var l=r[n];""===l||a.has(l)||(a.add(l),t.length>0&&(t+=" "),t+=l)}return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.classnames=classnames;
|
package/index.js
DELETED
|
File without changes
|