@clerc/utils 1.0.2 → 1.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.
@@ -6,7 +6,7 @@ type BuiltIns = Primitive | void | Date | RegExp;
6
6
  type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown) | Promise<unknown>;
7
7
  type UnknownArray = readonly unknown[];
8
8
  type MapsSetsOrArrays = ReadonlyMap<unknown, unknown> | WeakMap<WeakKey, unknown> | ReadonlySet<unknown> | WeakSet<WeakKey> | UnknownArray;
9
- type ConditionalDeepPrettify<T, E = never, I$1 = unknown> = T extends E ? T : T extends I$1 ? { [TypeKey in keyof T]: ConditionalDeepPrettify<T[TypeKey], E, I$1> } : T;
9
+ type ConditionalDeepPrettify<T, E = never, I = unknown> = T extends E ? T : T extends I ? { [TypeKey in keyof T]: ConditionalDeepPrettify<T[TypeKey], E, I> } : T;
10
10
  type DeepPrettify<T, E = never> = ConditionalDeepPrettify<T, E | NonRecursiveType | MapsSetsOrArrays, object>;
11
11
  type IsAny<T> = 0 extends 1 & T ? true : false;
12
12
  type RequireExactlyOne<T, Keys extends keyof T = keyof T> = { [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, never>> }[Keys] & Omit<T, Keys>;
@@ -24,8 +24,8 @@ type CamelCase<S extends string> = S extends `${infer Head} ${infer Tail}` ? `${
24
24
  declare const looseIsArray: <T>(arr: any) => arr is readonly T[];
25
25
  declare const toArray: <T>(a: MaybeArray<T>) => T[];
26
26
  /**
27
- * Converts a dash- or space-separated string to camelCase.
28
- * Not using regexp for better performance, because this function is used in parser.
27
+ * Converts a dash- or space-separated string to camelCase. Not using regexp for
28
+ * better performance, because this function is used in parser.
29
29
  */
30
30
  declare function camelCase(str: string): string;
31
31
  declare function joinWithAnd(values: string[]): string;
@@ -2,8 +2,8 @@
2
2
  const looseIsArray = (arr) => Array.isArray(arr);
3
3
  const toArray = (a) => Array.isArray(a) ? a : [a];
4
4
  /**
5
- * Converts a dash- or space-separated string to camelCase.
6
- * Not using regexp for better performance, because this function is used in parser.
5
+ * Converts a dash- or space-separated string to camelCase. Not using regexp for
6
+ * better performance, because this function is used in parser.
7
7
  */
8
8
  function camelCase(str) {
9
9
  const firstIdx = Math.min(str.includes("-") ? str.indexOf("-") : Infinity, str.includes(" ") ? str.indexOf(" ") : Infinity);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/utils",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve)",
5
5
  "type": "module",
6
6
  "description": "Clerc utils",
@@ -26,26 +26,16 @@
26
26
  "license": "MIT",
27
27
  "sideEffects": false,
28
28
  "exports": {
29
- ".": "./dist/index.js"
30
- },
31
- "main": "./dist/index.js",
32
- "module": "./dist/index.js",
33
- "types": "dist/index.d.ts",
34
- "typesVersions": {
35
- "*": {
36
- "*": [
37
- "./dist/*",
38
- "./dist/index.d.ts"
39
- ]
40
- }
29
+ ".": "./dist/index.mjs",
30
+ "./package.json": "./package.json"
41
31
  },
32
+ "main": "./dist/index.mjs",
33
+ "module": "./dist/index.mjs",
34
+ "types": "./dist/index.d.mts",
42
35
  "files": [
43
36
  "dist"
44
37
  ],
45
38
  "publishConfig": {
46
39
  "access": "public"
47
- },
48
- "peerDependencies": {
49
- "@clerc/core": "*"
50
40
  }
51
41
  }