@oviirup/utils 0.0.1-canary.1 → 0.0.1-canary.3

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/dist/clsx.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ type ClassValue = string | number | bigint | null | boolean | undefined;
2
+ type ClassArray = ClassValue[];
3
+ type ClassRecord = Record<string, any>;
4
+ type ClassNameValue = ClassValue | ClassArray | ClassRecord;
5
+ /**
6
+ * Utility function to construct class names conditionally
7
+ * @category ClassNames
8
+ */
9
+ declare function clsx(...inputs: ClassNameValue[]): string;
10
+
11
+ export { clsx };
12
+ export type { ClassNameValue };
package/dist/clsx.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./assertions.js");exports.clsx=function(...r){let t,i="";for(let s of r)s&&(t=function r(t){let i,s="";if(e.isString(t)||e.isNumber(t))t&&(s+=t.toString().trim());else if(e.isArray(t))for(let e of t)(i=r(e))&&(s&&(s+=" "),s+=i);else if(e.isObject(t))for(let e in t)t[e]&&(s&&(s+=" "),s+=e);return s}(s))&&(i&&(i+=" "),i+=t);return i};
package/dist/clsx.mjs ADDED
@@ -0,0 +1 @@
1
+ import{isString as t,isNumber as e,isArray as r,isObject as o}from"./assertions.mjs";function f(...i){let n,l="";for(let f of i)f&&(n=function f(i){let n,l="";if(t(i)||e(i))i&&(l+=i.toString().trim());else if(r(i))for(let t of i)(n=f(t))&&(l&&(l+=" "),l+=n);else if(o(i))for(let t in i)i[t]&&(l&&(l+=" "),l+=t);return l}(f))&&(l&&(l+=" "),l+=n);return l}export{f as clsx};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oviirup/utils",
3
- "version": "0.0.1-canary.1",
3
+ "version": "0.0.1-canary.3",
4
4
  "description": "Collection of common JavaScript / TypeScript utilities bt @oviirup",
5
5
  "repository": "oviirup/utils",
6
6
  "license": "MIT",
@@ -21,6 +21,11 @@
21
21
  "import": "./dist/assertions.mjs",
22
22
  "require": "./dist/assertions.js"
23
23
  },
24
+ "./clsx": {
25
+ "types": "./dist/clsx.d.ts",
26
+ "import": "./dist/clsx.mjs",
27
+ "require": "./dist/clsx.js"
28
+ },
24
29
  "./nanoid": {
25
30
  "types": "./dist/nanoid.d.ts",
26
31
  "import": "./dist/nanoid.mjs",
@@ -60,6 +65,10 @@
60
65
  "typescript": "^5",
61
66
  "vitest": "^4"
62
67
  },
68
+ "publishConfig": {
69
+ "registry": "https://registry.npmjs.org/",
70
+ "access": "public"
71
+ },
63
72
  "lint-staged": {
64
73
  "*.{js,mjs,ts,json,md}": "biome format --write"
65
74
  }