@naturalcycles/js-lib 14.108.1 → 14.109.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/dist/types.d.ts CHANGED
@@ -179,19 +179,17 @@ export declare type Reviver = (this: any, key: string, value: any) => any;
179
179
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
180
180
  * Only affects typings, no runtime effect.
181
181
  */
182
- export declare function _stringMapValues<T>(m: StringMap<T>): T[];
182
+ export declare const _stringMapValues: <T>(m: StringMap<T>) => T[];
183
183
  /**
184
184
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
185
185
  * Only affects typings, no runtime effect.
186
186
  */
187
- export declare function _stringMapEntries<T>(m: StringMap<T>): [k: string, v: T][];
187
+ export declare const _stringMapEntries: <T>(m: StringMap<T>) => [k: string, v: T][];
188
188
  /**
189
189
  * Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
190
190
  * This is how TypeScript should work, actually.
191
- *
192
- * @experimental
193
191
  */
194
- export declare function _objectKeys<T extends AnyObject>(obj: T): (keyof T)[];
192
+ export declare const _objectKeys: <T extends AnyObject>(obj: T) => (keyof T)[];
195
193
  export declare type NullishValue = null | undefined;
196
194
  export declare type FalsyValue = false | '' | 0 | null | undefined;
197
195
  /**
package/dist/types.js CHANGED
@@ -26,28 +26,17 @@ exports._passNothingPredicate = _passNothingPredicate;
26
26
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
27
27
  * Only affects typings, no runtime effect.
28
28
  */
29
- function _stringMapValues(m) {
30
- return Object.values(m);
31
- }
32
- exports._stringMapValues = _stringMapValues;
29
+ exports._stringMapValues = Object.values;
33
30
  /**
34
31
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
35
32
  * Only affects typings, no runtime effect.
36
33
  */
37
- function _stringMapEntries(m) {
38
- return Object.entries(m);
39
- }
40
- exports._stringMapEntries = _stringMapEntries;
34
+ exports._stringMapEntries = Object.entries;
41
35
  /**
42
36
  * Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
43
37
  * This is how TypeScript should work, actually.
44
- *
45
- * @experimental
46
38
  */
47
- function _objectKeys(obj) {
48
- return Object.keys(obj);
49
- }
50
- exports._objectKeys = _objectKeys;
39
+ exports._objectKeys = Object.keys;
51
40
  /**
52
41
  * Utility function that helps to cast *existing variable* to needed type T.
53
42
  *
package/dist-esm/types.js CHANGED
@@ -18,25 +18,17 @@ export const _passNothingPredicate = () => false;
18
18
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
19
19
  * Only affects typings, no runtime effect.
20
20
  */
21
- export function _stringMapValues(m) {
22
- return Object.values(m);
23
- }
21
+ export const _stringMapValues = Object.values;
24
22
  /**
25
23
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
26
24
  * Only affects typings, no runtime effect.
27
25
  */
28
- export function _stringMapEntries(m) {
29
- return Object.entries(m);
30
- }
26
+ export const _stringMapEntries = Object.entries;
31
27
  /**
32
28
  * Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
33
29
  * This is how TypeScript should work, actually.
34
- *
35
- * @experimental
36
30
  */
37
- export function _objectKeys(obj) {
38
- return Object.keys(obj);
39
- }
31
+ export const _objectKeys = Object.keys;
40
32
  /**
41
33
  * Utility function that helps to cast *existing variable* to needed type T.
42
34
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.108.1",
3
+ "version": "14.109.0",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "build-prod": "build-prod-esm-cjs",
@@ -18,12 +18,10 @@
18
18
  "@types/node": "^18.0.0",
19
19
  "expect-type": "^0.13.0",
20
20
  "jest": "^28.0.3",
21
- "patch-package": "^6.2.1",
22
21
  "prettier": "^2.1.2",
23
22
  "rxjs": "^7.0.1",
24
23
  "vuepress": "^1.7.1",
25
- "vuepress-plugin-typescript": "^0.3.1",
26
- "weak-napi": "^2.0.2"
24
+ "vuepress-plugin-typescript": "^0.3.1"
27
25
  },
28
26
  "files": [
29
27
  "dist",
package/src/types.ts CHANGED
@@ -243,27 +243,19 @@ export type Reviver = (this: any, key: string, value: any) => any
243
243
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
244
244
  * Only affects typings, no runtime effect.
245
245
  */
246
- export function _stringMapValues<T>(m: StringMap<T>): T[] {
247
- return Object.values(m) as T[]
248
- }
246
+ export const _stringMapValues = Object.values as <T>(m: StringMap<T>) => T[]
249
247
 
250
248
  /**
251
249
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
252
250
  * Only affects typings, no runtime effect.
253
251
  */
254
- export function _stringMapEntries<T>(m: StringMap<T>): [k: string, v: T][] {
255
- return Object.entries(m) as [string, T][]
256
- }
252
+ export const _stringMapEntries = Object.entries as <T>(m: StringMap<T>) => [k: string, v: T][]
257
253
 
258
254
  /**
259
255
  * Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
260
256
  * This is how TypeScript should work, actually.
261
- *
262
- * @experimental
263
257
  */
264
- export function _objectKeys<T extends AnyObject>(obj: T): (keyof T)[] {
265
- return Object.keys(obj)
266
- }
258
+ export const _objectKeys = Object.keys as <T extends AnyObject>(obj: T) => (keyof T)[]
267
259
 
268
260
  export type NullishValue = null | undefined
269
261
  export type FalsyValue = false | '' | 0 | null | undefined