classix 1.2.2 → 2.1.0

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,13 @@
1
+ function cx() {
2
+ let str = "", i = 0, arg;
3
+ while (i < arguments.length) {
4
+ if ((arg = arguments[i++]) && typeof arg === "string") {
5
+ str && (str += " ");
6
+ str += arg;
7
+ }
8
+ }
9
+ return str;
10
+ }
11
+
12
+ exports.cx = cx;
13
+ exports["default"] = cx;
@@ -1,9 +1,9 @@
1
- declare type Argument = string | boolean | number | null | undefined;
1
+ declare type Argument = string | boolean | null | undefined;
2
2
  /**
3
3
  * Conditionally join classNames into a single string
4
4
  * @param {...String} args The expressions to evaluate
5
5
  * @returns {String} The joined classNames
6
6
  */
7
7
  declare function cx(...args: Argument[]): string;
8
- export { cx };
9
- export default cx;
8
+
9
+ export { cx, cx as default };
@@ -0,0 +1,12 @@
1
+ function cx() {
2
+ let str = "", i = 0, arg;
3
+ while (i < arguments.length) {
4
+ if ((arg = arguments[i++]) && typeof arg === "string") {
5
+ str && (str += " ");
6
+ str += arg;
7
+ }
8
+ }
9
+ return str;
10
+ }
11
+
12
+ export { cx, cx as default };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "classix",
3
- "version": "1.2.2",
3
+ "version": "2.1.0",
4
4
  "description": "The fastest and tiniest utility for conditionally joining classNames.",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "main": "dist/classix.cjs.js",
6
+ "module": "dist/classix.mjs.js",
7
+ "types": "dist/classix.d.ts",
7
8
  "author": "Alex Nault",
8
9
  "keywords": [
9
10
  "class",
@@ -19,7 +20,7 @@
19
20
  "homepage": "https://github.com/alexnault/classix#readme",
20
21
  "scripts": {
21
22
  "bench": "node benchmark",
22
- "build": "rm -rf ./dist && tsc",
23
+ "build": "rm -rf ./dist && rollup -c",
23
24
  "format": "prettier --write \"{src,benchmark}/**/*.{js,ts}\"",
24
25
  "lint": "eslint src/ --max-warnings=0",
25
26
  "test": "jest"
@@ -35,10 +36,14 @@
35
36
  "classnames": "^2.3.1",
36
37
  "clsx": "^1.2.1",
37
38
  "conventional-changelog-conventionalcommits": "^4.6.3",
39
+ "esbuild": "^0.14.49",
38
40
  "eslint": "^8.19.0",
39
41
  "eslint-config-prettier": "^8.5.0",
40
42
  "jest": "^28.0.0",
41
43
  "prettier": "^2.7.1",
44
+ "rollup": "^2.77.0",
45
+ "rollup-plugin-dts": "^4.2.2",
46
+ "rollup-plugin-esbuild": "^4.9.1",
42
47
  "semantic-release": "^19.0.3",
43
48
  "ts-jest": "^28.0.0",
44
49
  "typescript": "^4.7.4"
package/dist/index.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cx = void 0;
4
- function cx() {
5
- var str = "", i = 0, arg;
6
- while (i < arguments.length) {
7
- if ((arg = arguments[i++]) &&
8
- (typeof arg === "string" || typeof arg === "number")) {
9
- str && (str += " ");
10
- str += arg;
11
- }
12
- }
13
- return str;
14
- }
15
- exports.cx = cx;
16
- exports.default = cx;