@koine/utils 1.1.12 → 1.1.14

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
@@ -11,6 +11,6 @@
11
11
  },
12
12
  "main": "./index.js",
13
13
  "types": "./index.d.ts",
14
- "version": "1.1.12",
14
+ "version": "1.1.14",
15
15
  "module": "./index.mjs"
16
16
  }
package/without.d.ts ADDED
File without changes
package/without.js ADDED
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ // TODO: finish this up, this is not exported yet
4
+ // ready to copy-paste to https://www.typescriptlang.org/play
5
+ // type EmptyObject = Record<string, never>;
6
+ // type EmptyArray = never[];
7
+ // type EmptyString = "";
8
+ // type WithoutEmptyObject<T> = T extends EmptyObject ? never : T;
9
+ // type WithoutEmptyArray<T> = T extends EmptyArray ? never : T;
10
+ // type WithoutEmptyString<T> = T extends EmptyString ? never : T;
11
+ // type WithoutEmpty<T> = T extends EmptyObject | EmptyArray | EmptyString | null | undefined ? never : T;
12
+ // function withoutEmptyObject<T>(arg: WithoutEmptyObject<T>) {
13
+ // return arg;
14
+ // }
15
+ // function withoutEmptyArray<T>(arg: WithoutEmptyArray<T>) {
16
+ // return arg;
17
+ // }
18
+ // function withoutEmptyString<T>(arg: WithoutEmptyString<T>) {
19
+ // return arg;
20
+ // }
21
+ // function withoutEmpty<T>(arg: WithoutEmpty<T>) {
22
+ // return arg;
23
+ // }
24
+ // // @ts-expect-error
25
+ // const o1 = withoutEmptyObject({});
26
+ // // ^?
27
+ // const o2 = withoutEmptyObject({ accepted: 1 });
28
+ // // @ts-expect-error
29
+ // const a1 = withoutEmptyArray([]);
30
+ // // ^?
31
+ // const a2 = withoutEmptyArray(["accepted"]);
32
+ // // ^?
33
+ // const a3 = withoutEmptyArray("accepted");
34
+ // // ^?
35
+ // const a4 = withoutEmptyArray("accepted" === "accepted");
36
+ // // ^?
37
+ // // @ts-expect-error
38
+ // const s1 = withoutEmptyString("");
39
+ // // ^?
40
+ // const s2 = withoutEmptyString("accepted");
41
+ // // ^?
42
+ // // @ts-expect-error
43
+ // const w1 = withoutEmpty("");
44
+ // // ^?
45
+ // // @ts-expect-error
46
+ // const w2 = withoutEmpty(undefined);
47
+ // // ^?
48
+ // // @ts-expect-error
49
+ // const w3 = withoutEmpty(null);
50
+ // // ^?
51
+ // // @ts-expect-error
52
+ // const w4 = withoutEmpty({});
53
+ // // ^?
54
+ // // @ts-expect-error
55
+ // const w5 = withoutEmpty([]);
56
+ // // ^?
package/without.mjs ADDED
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ // TODO: finish this up, this is not exported yet
4
+ // ready to copy-paste to https://www.typescriptlang.org/play
5
+ // type EmptyObject = Record<string, never>;
6
+ // type EmptyArray = never[];
7
+ // type EmptyString = "";
8
+ // type WithoutEmptyObject<T> = T extends EmptyObject ? never : T;
9
+ // type WithoutEmptyArray<T> = T extends EmptyArray ? never : T;
10
+ // type WithoutEmptyString<T> = T extends EmptyString ? never : T;
11
+ // type WithoutEmpty<T> = T extends EmptyObject | EmptyArray | EmptyString | null | undefined ? never : T;
12
+ // function withoutEmptyObject<T>(arg: WithoutEmptyObject<T>) {
13
+ // return arg;
14
+ // }
15
+ // function withoutEmptyArray<T>(arg: WithoutEmptyArray<T>) {
16
+ // return arg;
17
+ // }
18
+ // function withoutEmptyString<T>(arg: WithoutEmptyString<T>) {
19
+ // return arg;
20
+ // }
21
+ // function withoutEmpty<T>(arg: WithoutEmpty<T>) {
22
+ // return arg;
23
+ // }
24
+ // // @ts-expect-error
25
+ // const o1 = withoutEmptyObject({});
26
+ // // ^?
27
+ // const o2 = withoutEmptyObject({ accepted: 1 });
28
+ // // @ts-expect-error
29
+ // const a1 = withoutEmptyArray([]);
30
+ // // ^?
31
+ // const a2 = withoutEmptyArray(["accepted"]);
32
+ // // ^?
33
+ // const a3 = withoutEmptyArray("accepted");
34
+ // // ^?
35
+ // const a4 = withoutEmptyArray("accepted" === "accepted");
36
+ // // ^?
37
+ // // @ts-expect-error
38
+ // const s1 = withoutEmptyString("");
39
+ // // ^?
40
+ // const s2 = withoutEmptyString("accepted");
41
+ // // ^?
42
+ // // @ts-expect-error
43
+ // const w1 = withoutEmpty("");
44
+ // // ^?
45
+ // // @ts-expect-error
46
+ // const w2 = withoutEmpty(undefined);
47
+ // // ^?
48
+ // // @ts-expect-error
49
+ // const w3 = withoutEmpty(null);
50
+ // // ^?
51
+ // // @ts-expect-error
52
+ // const w4 = withoutEmpty({});
53
+ // // ^?
54
+ // // @ts-expect-error
55
+ // const w5 = withoutEmpty([]);
56
+ // // ^?