ts-gems 3.5.0 → 3.6.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.
- package/README.md +32 -0
- package/lib/helpers.d.ts +2 -2
- package/lib/index.d.ts +20 -20
- package/lib/logical.d.ts +1 -1
- package/lib/mutable.d.ts +3 -3
- package/lib/nullish.d.ts +2 -2
- package/lib/omit-never.d.ts +2 -2
- package/lib/omit.d.ts +2 -2
- package/lib/partial.d.ts +3 -3
- package/lib/pick.d.ts +2 -2
- package/lib/readonly.d.ts +2 -2
- package/lib/required.d.ts +2 -2
- package/lib/type-check.d.ts +1 -1
- package/lib/types.d.ts +1 -32
- package/package.json +9 -10
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ts-gems
|
|
2
|
+
|
|
3
|
+
[![NPM Version][npm-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![CI Tests][ci-test-image]][ci-test-url]
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ npm install ts-gems --save
|
|
11
|
+
```
|
|
12
|
+
## Node Compatibility
|
|
13
|
+
- node >= 16.x
|
|
14
|
+
## License
|
|
15
|
+
ts-gems is available under [MIT](LICENSE) license.
|
|
16
|
+
|
|
17
|
+
[npm-image]: https://img.shields.io/npm/v/ts-gems
|
|
18
|
+
[npm-url]: https://npmjs.org/package/ts-gems
|
|
19
|
+
[ci-test-image]: https://github.com/panates/ts-gems/actions/workflows/test.yml/badge.svg
|
|
20
|
+
[ci-test-url]: https://github.com/panates/ts-gems/actions/workflows/test.yml
|
|
21
|
+
[coveralls-image]: https://img.shields.io/coveralls/panates/ts-gems/master.svg
|
|
22
|
+
[coveralls-url]: https://coveralls.io/r/panates/ts-gems
|
|
23
|
+
[downloads-image]: https://img.shields.io/npm/dm/ts-gems.svg
|
|
24
|
+
[downloads-url]: https://npmjs.org/package/ts-gems
|
|
25
|
+
[gitter-image]: https://badges.gitter.im/panates/ts-gems.svg
|
|
26
|
+
[gitter-url]: https://gitter.im/panates/ts-gems?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
|
27
|
+
[dependencies-image]: https://david-dm.org/panates/ts-gems/status.svg
|
|
28
|
+
[dependencies-url]:https://david-dm.org/panates/ts-gems
|
|
29
|
+
[devdependencies-image]: https://david-dm.org/panates/ts-gems/dev-status.svg
|
|
30
|
+
[devdependencies-url]:https://david-dm.org/panates/ts-gems?type=dev
|
|
31
|
+
[quality-image]: http://npm.packagequality.com/shield/ts-gems.png
|
|
32
|
+
[quality-url]: http://packagequality.com/#?package=ts-gems
|
package/lib/helpers.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// noinspection JSUnusedGlobalSymbols
|
|
2
2
|
|
|
3
|
-
import { DeeperMutable, DeepMutable, Mutable } from './mutable';
|
|
4
|
-
import { DeeperPartial, DeepPartial } from './partial';
|
|
5
|
-
import { DeeperReadonly, DeepReadonly } from './readonly';
|
|
6
|
-
import { DeeperRequired, DeepRequired } from './required';
|
|
7
|
-
|
|
8
|
-
export * from './combine';
|
|
9
|
-
export * from './dto';
|
|
10
|
-
export * from './helpers';
|
|
11
|
-
export * from './logical';
|
|
12
|
-
export * from './mutable';
|
|
13
|
-
export * from './nullish';
|
|
14
|
-
export * from './omit';
|
|
15
|
-
export * from './omit-never';
|
|
16
|
-
export * from './opaque';
|
|
17
|
-
export * from './partial';
|
|
18
|
-
export * from './pick';
|
|
19
|
-
export * from './readonly';
|
|
20
|
-
export * from './required';
|
|
21
|
-
export * from './type-check';
|
|
22
|
-
export * from './types';
|
|
3
|
+
import type { DeeperMutable, DeepMutable, Mutable } from './mutable';
|
|
4
|
+
import type { DeeperPartial, DeepPartial } from './partial';
|
|
5
|
+
import type { DeeperReadonly, DeepReadonly } from './readonly';
|
|
6
|
+
import type { DeeperRequired, DeepRequired } from './required';
|
|
7
|
+
|
|
8
|
+
export type * from './combine';
|
|
9
|
+
export type * from './dto';
|
|
10
|
+
export type * from './helpers';
|
|
11
|
+
export type * from './logical';
|
|
12
|
+
export type * from './mutable';
|
|
13
|
+
export type * from './nullish';
|
|
14
|
+
export type * from './omit';
|
|
15
|
+
export type * from './omit-never';
|
|
16
|
+
export type * from './opaque';
|
|
17
|
+
export type * from './partial';
|
|
18
|
+
export type * from './pick';
|
|
19
|
+
export type * from './readonly';
|
|
20
|
+
export type * from './required';
|
|
21
|
+
export type * from './type-check';
|
|
22
|
+
export type * from './types';
|
|
23
23
|
|
|
24
24
|
declare function asMutable<T>(x: T): Mutable<T>;
|
|
25
25
|
|
package/lib/logical.d.ts
CHANGED
package/lib/mutable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IfNoDeepValue } from './helpers';
|
|
1
|
+
import { IfNoDeepValue } from './helpers.js';
|
|
2
2
|
import {
|
|
3
3
|
DeeperOmitReadonly,
|
|
4
4
|
DeeperPickReadonly,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
DeepPickReadonly,
|
|
7
7
|
OmitReadonly,
|
|
8
8
|
PickReadonly,
|
|
9
|
-
} from './readonly';
|
|
10
|
-
import { IfNever } from './type-check';
|
|
9
|
+
} from './readonly.js';
|
|
10
|
+
import { IfNever } from './type-check.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Make all properties in T mutable
|
package/lib/nullish.d.ts
CHANGED
package/lib/omit-never.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IfNoDeepValue } from './helpers';
|
|
2
|
-
import { IfNever } from './type-check';
|
|
1
|
+
import { IfNoDeepValue } from './helpers.js';
|
|
2
|
+
import { IfNever } from './type-check.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* OmitNever<T> is a type that omits all properties with a value of type "never".
|
package/lib/omit.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IfNoDeepValue } from './helpers';
|
|
1
|
+
import { IfNoDeepValue } from './helpers.js';
|
|
2
2
|
import { Or } from './logical.js';
|
|
3
|
-
import { IfFunction, IfNever } from './type-check';
|
|
3
|
+
import { IfFunction, IfNever } from './type-check.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Construct a type with the properties of T except for those in type K,
|
package/lib/partial.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IfNoDeepValue } from './helpers';
|
|
1
|
+
import { IfNoDeepValue } from './helpers.js';
|
|
2
2
|
import {
|
|
3
3
|
DeeperOmitRequired,
|
|
4
4
|
DeeperPickRequired,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
DeepPickRequired,
|
|
7
7
|
OmitRequired,
|
|
8
8
|
PickRequired,
|
|
9
|
-
} from './required';
|
|
10
|
-
import { IfNever } from './type-check';
|
|
9
|
+
} from './required.js';
|
|
10
|
+
import { IfNever } from './type-check.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Marks given keys as optional
|
package/lib/pick.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Or } from './logical.js';
|
|
2
|
-
import { OmitFunctions } from './omit';
|
|
2
|
+
import { OmitFunctions } from './omit.js';
|
|
3
3
|
import {
|
|
4
4
|
IfAny,
|
|
5
5
|
IfEmptyObject,
|
|
6
6
|
IfFunction,
|
|
7
7
|
IfNever,
|
|
8
8
|
IfUnknown,
|
|
9
|
-
} from './type-check';
|
|
9
|
+
} from './type-check.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* From T, pick a set of properties whose keys are in the union K,
|
package/lib/readonly.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IfNoDeepValue } from './helpers';
|
|
1
|
+
import { IfNoDeepValue } from './helpers.js';
|
|
2
2
|
import { Or } from './logical.js';
|
|
3
|
-
import { IfEquals, IfNever } from './type-check';
|
|
3
|
+
import { IfEquals, IfNever } from './type-check.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Marks given keys as readonly
|
package/lib/required.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IfNoDeepValue } from './helpers';
|
|
1
|
+
import { IfNoDeepValue } from './helpers.js';
|
|
2
2
|
import { Or } from './logical.js';
|
|
3
3
|
import { OmitTypes } from './omit.js';
|
|
4
|
-
import { IfEquals, IfNever } from './type-check';
|
|
4
|
+
import { IfEquals, IfNever } from './type-check.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Marks given keys as required
|
package/lib/type-check.d.ts
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Declare ReadableStream and WritableStream in case dom.d.ts is not added to the tsconfig
|
|
3
|
-
* lib causing ReadableStream or WritableStream interface is not defined.
|
|
4
|
-
* For developers with dom.d.ts added, the ReadableStream and WritableStream
|
|
5
|
-
* interface will be merged correctly.
|
|
6
|
-
*
|
|
7
|
-
* This is also required for any clients with streaming interface where ReadableStream
|
|
8
|
-
* or WritableStream type is also referred.
|
|
9
|
-
*/
|
|
10
|
-
declare global {
|
|
11
|
-
export interface ReadableStream<R = any> {
|
|
12
|
-
readonly locked: boolean;
|
|
13
|
-
|
|
14
|
-
cancel(reason?: any): Promise<void>;
|
|
15
|
-
|
|
16
|
-
getReader(options: { mode: 'byob' }): ReadableStreamBYOBReader;
|
|
17
|
-
|
|
18
|
-
getReader(): ReadableStreamDefaultReader<R>;
|
|
19
|
-
|
|
20
|
-
getReader(
|
|
21
|
-
options?: ReadableStreamGetReaderOptions,
|
|
22
|
-
): ReadableStreamReader<R>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface WritableStream<W = any> {
|
|
26
|
-
readonly locked: boolean;
|
|
27
|
-
|
|
28
|
-
abort(reason?: any): Promise<void>;
|
|
29
|
-
|
|
30
|
-
getWriter(): WritableStreamDefaultWriter<W>;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
/// <reference lib="dom" />
|
|
33
2
|
|
|
34
3
|
/**
|
|
35
4
|
* BasicPrimitive
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-gems",
|
|
3
3
|
"description": "Valuable typing extensions for TypeScript",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "./lib/index.mjs",
|
|
7
7
|
"main": "./lib/index.cjs",
|
|
@@ -22,19 +22,18 @@
|
|
|
22
22
|
"format": "prettier . --write --log-level=warn",
|
|
23
23
|
"test:common": "jest --clearCache && jest --config=./jest.config.mjs",
|
|
24
24
|
"test:nostrict": "jest --clearCache && jest --config=./jest.nostrict.config.mjs",
|
|
25
|
-
"test": "npm run test:common && npm run test:nostrict"
|
|
26
|
-
"prepare": "husky"
|
|
25
|
+
"test": "npm run test:common && npm run test:nostrict"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@panates/eslint-config": "^1.0.
|
|
30
|
-
"@panates/eslint-config-ts": "^1.0.
|
|
31
|
-
"@panates/tsconfig": "^1.0.
|
|
32
|
-
"@types/jest": "^29.5.
|
|
33
|
-
"husky": "^9.1.
|
|
28
|
+
"@panates/eslint-config": "^1.0.21",
|
|
29
|
+
"@panates/eslint-config-ts": "^1.0.21",
|
|
30
|
+
"@panates/tsconfig": "^1.0.21",
|
|
31
|
+
"@types/jest": "^29.5.14",
|
|
32
|
+
"husky": "^9.1.6",
|
|
34
33
|
"jest": "^29.7.0",
|
|
35
34
|
"prettier": "^3.3.3",
|
|
36
|
-
"ts-jest": "^29.2.
|
|
37
|
-
"typescript": "^5.
|
|
35
|
+
"ts-jest": "^29.2.5",
|
|
36
|
+
"typescript": "^5.6.3"
|
|
38
37
|
},
|
|
39
38
|
"files": [
|
|
40
39
|
"LICENSE",
|