@ts-type/unpacked 1.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## 1.0.1 (2022-10-10)
7
+
8
+
9
+
10
+ ### 🐛 Bug Fixes
11
+
12
+ * ITSUnpackedIteratorLike ([7f8dcfa](https://github.com/bluelovers/ws-ts-type/commit/7f8dcfa6576b74c0c1d4b60aa4c2ae4d78ae2212))
13
+
14
+
15
+ ### 🔖 Miscellaneous
16
+
17
+ * . ([6588a93](https://github.com/bluelovers/ws-ts-type/commit/6588a932156f6e44e746b3ae2452336a04833153))
18
+ * . ([78b9302](https://github.com/bluelovers/ws-ts-type/commit/78b93022c7c13234b947928418e0567b5193cf45))
19
+ * . ([6368bcd](https://github.com/bluelovers/ws-ts-type/commit/6368bcd018310cf18b15d74173ab46d17ebd9c5d))
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # README.md
2
+
3
+
4
+
5
+ ## install
6
+
7
+ ```bash
8
+ yarn add @ts-type/unpacked
9
+ yarn-tool add @ts-type/unpacked
10
+ yt add @ts-type/unpacked
11
+ ```
12
+
package/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { ITSMapLike, ITSResolvable, ITSTypeFunction } from 'ts-type/lib/generic';
2
+ export type ITSUnpackedReturnType<T extends (...args: any[]) => any> = ITSUnpacked<ReturnType<T>>;
3
+ /**
4
+ * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
5
+ */
6
+ export type ITSUnpacked<T> = T extends ITSMapLike<any, infer U> ? U : T extends (infer U)[] ? U : T extends ArrayLike<infer U> ? U : T extends Iterator<infer U> ? U : T extends IteratorResult<infer U> ? U : T extends ITSTypeFunction<infer U> ? U : T extends ITSResolvable<infer U> ? U : T;
7
+ export type ITSUnpackedPromiseLike<T> = T extends ITSResolvable<infer U> ? U : T;
8
+ export type ITSUnpackedIteratorLike<T extends Iterator<any> | IteratorResult<any>> = T extends Iterator<infer U> ? U : T extends IteratorYieldResult<infer U> ? U : never;
9
+ export type ITSUnpackedArrayLike<T extends ArrayLike<any> | any[]> = T extends (infer U)[] ? ITSUnpacked<U> : T extends readonly (infer U)[] ? ITSUnpacked<U> : T extends ArrayLike<infer U> ? ITSUnpacked<U> : T;
10
+ export type ITSUnpackedThisFunction<T extends (...args: any[]) => any> = T extends (this: infer R, ...args: any[]) => any ? R : unknown;
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"","sourcesContent":["import { ITSMapLike, ITSResolvable, ITSTypeFunction } from 'ts-type/lib/generic';\n\nexport type ITSUnpackedReturnType<T extends (...args: any[]) => any> =\n\tITSUnpacked<ReturnType<T>>\n//\tT extends ITSTypeFunction<infer R>\n//\t\t? ITSUnpacked<R>\n//\t\t: T\n\t;\n\n/**\n * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html\n */\nexport type ITSUnpacked<T> =\n\tT extends ITSMapLike<any, infer U> ? U :\n\t\tT extends (infer U)[] ? U :\n\t\t\tT extends ArrayLike<infer U> ? U :\n\t\t\t\tT extends Iterator<infer U> ? U :\n\t\t\t\t\tT extends IteratorResult<infer U> ? U :\n\t\t\t\t\t\tT extends ITSTypeFunction<infer U> ? U :\n\t\t\t\t\t\t\tT extends ITSResolvable<infer U> ? U :\n\t\t\t\t\t\t\t\t//T extends Promise<infer U> ? U :\n\t\t\t\t\t\t\t\tT\n\t;\n\nexport type ITSUnpackedPromiseLike<T> =\n\tT extends ITSResolvable<infer U> ? U :\n\t\tT\n\t;\n\nexport type ITSUnpackedIteratorLike<T extends Iterator<any> | IteratorResult<any>> =\n\tT extends Iterator<infer U> ? U :\n\t\tT extends IteratorYieldResult<infer U> ? U :\n\t\t\t\tnever\n\t;\n\nexport type ITSUnpackedArrayLike<T extends ArrayLike<any> | any[]> =\n\tT extends (infer U)[] ? ITSUnpacked<U> :\n\t\tT extends readonly (infer U)[] ? ITSUnpacked<U> :\n\t\t\tT extends ArrayLike<infer U> ? ITSUnpacked<U> :\n\t\t\t\tT\n\t;\n\nexport type ITSUnpackedThisFunction<T extends (...args: any[]) => any> =\n\tT extends (this: infer R, ...args: any[]) => any\n\t\t? R\n\t\t: unknown;\n"]}
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "@ts-type/unpacked",
3
+ "version": "1.0.1",
4
+ "description": "",
5
+ "keywords": [
6
+ ".d.ts",
7
+ "@types",
8
+ "declaration",
9
+ "dev",
10
+ "develop",
11
+ "development",
12
+ "environment",
13
+ "ide",
14
+ "interface",
15
+ "node",
16
+ "playground",
17
+ "runtime",
18
+ "ts",
19
+ "type",
20
+ "type-level",
21
+ "typelevel",
22
+ "types",
23
+ "typescript",
24
+ "typing",
25
+ "typings",
26
+ "type-helprt",
27
+ "toolbox",
28
+ "toolbelt",
29
+ "create-by-yarn-tool"
30
+ ],
31
+ "homepage": "https://github.com/bluelovers/ws-ts-type/tree/master/packages/@ts-type/unpacked#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/bluelovers/ws-ts-type/issues"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/bluelovers/ws-ts-type.git",
38
+ "directory": "packages/@ts-type/unpacked"
39
+ },
40
+ "license": "ISC",
41
+ "author": "bluelovers",
42
+ "sideEffects": false,
43
+ "main": "index.js",
44
+ "scripts": {
45
+ "review": "yarn run review:coverage",
46
+ "review:coverage": "yarn run lint && yarn run coverage",
47
+ "review:test": "yarn run lint && yarn run test",
48
+ "coverage": "yarn run test -- --coverage",
49
+ "lint": "yarn run lint:eslint",
50
+ "lint:eslint": "ynpx eslint --ext .ts,.tsx,.mts,.cts ./",
51
+ "pretest": "echo pretest",
52
+ "test": "yarn run test:tsd",
53
+ "test:jest": "jest --passWithNoTests",
54
+ "test:jest:snapshot": "yarn run test:jest -- -u",
55
+ "test:mocha": "ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
56
+ "test:snapshot": "yarn run test -- -u",
57
+ "test:tsd": "ynpx tsd -f ./test/unpacked.test-d.ts",
58
+ "test:tsdx": "ynpx @bluelovers/tsdx test --passWithNoTests",
59
+ "build:dts:bundle": "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle",
60
+ "build:dts:copy": "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts",
61
+ "build:dts:tsc": "yarn run build:dts:tsc:emit && yarn run build:dts:copy",
62
+ "build:dts:tsc:emit": "tsc --emitDeclarationOnly --declaration --noEmit false",
63
+ "build:microbundle": "ynpx microbundle --target node",
64
+ "build:tsdx": "ynpx @bluelovers/tsdx build --target node --name index",
65
+ "ci:install": "echo ci:install",
66
+ "ci:build": "echo ci:build",
67
+ "preversion": "echo preversion && yarn run test",
68
+ "version": "echo version",
69
+ "postversion": "echo postversion",
70
+ "prepublish": "echo prepublish",
71
+ "prepare": "echo prepare",
72
+ "prepublishOnly": "echo prepublishOnly",
73
+ "prepublishOnly:update": "yarn run ncu && yarn run sort-package-json",
74
+ "prepack": "echo prepack",
75
+ "pack": "echo pack",
76
+ "postpack": "echo postpack",
77
+ "publish": "echo publish",
78
+ "postpublish": "echo postpublish",
79
+ "postpublishOnly": "echo postpublishOnly",
80
+ "ncu": "yarn-tool ncu -u",
81
+ "sort-package-json": "yarn-tool sort",
82
+ "tsc:showConfig": "ynpx get-current-tsconfig -p"
83
+ },
84
+ "dependencies": {
85
+ "ts-type": "^3.0.1"
86
+ },
87
+ "packageManager": "yarn@1.22.19",
88
+ "publishConfig": {
89
+ "access": "public"
90
+ },
91
+ "gitHead": "fa34eea119b9bcbb363061ddffcfe9d78c2d0ddd"
92
+ }