@vnejs/uis.utils 0.1.0 → 0.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/uis.utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "publish:major:plugin": "npm run publish:major",
package/src/cn.js CHANGED
@@ -1,6 +1,3 @@
1
- const getModifClassName = (prefix, key, value) => (typeof value === "string" ? `${prefix}_${key}_${value}` : value ? `${prefix}_${key}` : "");
1
+ import { cn as cnTmp } from "@bem-react/classname";
2
2
 
3
- const wrapWithModificator = (className, obj) =>
4
- Object.entries(obj).reduce((acc, [key, value]) => acc + getModifClassName(` ${className}`, key, value), [className]);
5
-
6
- const cn = (blockName) => (elementName, obj) => wrapWithModificator(elementName ? `${blockName}-${elementName}` : `${blockName}`, obj);
3
+ export const cn = (blockName) => cnTmp(blockName);
@@ -0,0 +1,2 @@
1
+ export const EMPTY_OBJ = {};
2
+ export const EMPTY_ARR = [];
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./cn";
2
- export * from "./getVneLength";
2
+ export * from "./defaults";
3
3
  export * from "./getHeightArray";
4
+ export * from "./getVneLength";