@v-c/util 0.0.6 → 0.0.7

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(e){let t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e)){for(let o=0;o<e.length;o++)if(e[o]){const r=n(e[o]);r&&(t&&(t+=" "),t+=r)}}else for(const o in e)e[o]&&(t&&(t+=" "),t+=o);return t}function l(...e){let t="";for(let o=0;o<e.length;o++){const r=e[o];if(r){const f=n(r);f&&(t&&(t+=" "),t+=f)}}return t}exports.default=l;
@@ -0,0 +1,8 @@
1
+ type ClassValue = string | number | boolean | undefined | null | ClassDictionary | ClassArray;
2
+ interface ClassDictionary {
3
+ [id: string]: any;
4
+ }
5
+ interface ClassArray extends Array<ClassValue> {
6
+ }
7
+ export default function classNames(...args: ClassValue[]): string;
8
+ export {};
@@ -0,0 +1,30 @@
1
+ function r(t) {
2
+ let e = "";
3
+ if (typeof t == "string" || typeof t == "number")
4
+ e += t;
5
+ else if (typeof t == "object")
6
+ if (Array.isArray(t)) {
7
+ for (let f = 0; f < t.length; f++)
8
+ if (t[f]) {
9
+ const n = r(t[f]);
10
+ n && (e && (e += " "), e += n);
11
+ }
12
+ } else
13
+ for (const f in t)
14
+ t[f] && (e && (e += " "), e += f);
15
+ return e;
16
+ }
17
+ function s(...t) {
18
+ let e = "";
19
+ for (let f = 0; f < t.length; f++) {
20
+ const n = t[f];
21
+ if (n) {
22
+ const o = r(n);
23
+ o && (e && (e += " "), e += o);
24
+ }
25
+ }
26
+ return e;
27
+ }
28
+ export {
29
+ s as default
30
+ };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils/get.cjs"),t=require("./utils/set.cjs"),r=require("./warning.cjs");exports.get=e.default;exports.set=t.default;exports.warning=r.warningOnce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils/get.cjs"),t=require("./utils/set.cjs"),r=require("./warning.cjs"),n=require("./classnames.cjs");exports.get=e.default;exports.set=t.default;exports.warning=r.warningOnce;exports.classNames=n.default;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default as get } from './utils/get';
2
2
  export { default as set } from './utils/set';
3
3
  export { default as warning } from './warning';
4
+ export { default as classNames } from './classnames';
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
- import { default as a } from "./utils/get.js";
1
+ import { default as r } from "./utils/get.js";
2
2
  import { default as o } from "./utils/set.js";
3
- import { warningOnce as n } from "./warning.js";
3
+ import { warningOnce as f } from "./warning.js";
4
+ import { default as n } from "./classnames.js";
4
5
  export {
5
- a as get,
6
+ n as classNames,
7
+ r as get,
6
8
  o as set,
7
- n as warning
9
+ f as warning
8
10
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/util",
3
3
  "type": "module",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "description": "Vue3 components utils",
6
6
  "publishConfig": {
7
7
  "access": "public"