extra-utils 5.13.0 → 5.14.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 CHANGED
@@ -115,6 +115,10 @@ function isntEmptyObject(val: object): boolean
115
115
  function isReferenceEqual(a: unknown, b: unknown): boolean
116
116
  function isShallowEqual(a: unknown, b: unknown): boolean
117
117
  function isDeepEqual(a: unknown, b: unknown): boolean
118
+
119
+ function fromEntries<Key extends number | string, Value>(
120
+ entries: Iterable<[Key, Value]>
121
+ ): Record<Key, Value>
118
122
  ```
119
123
 
120
124
  ### String
@@ -0,0 +1 @@
1
+ export declare function fromEntries<Key extends number | string, Value>(entries: Iterable<[Key, Value]>): Record<Key, Value>;
@@ -0,0 +1,4 @@
1
+ export function fromEntries(entries) {
2
+ return Object.fromEntries(entries);
3
+ }
4
+ //# sourceMappingURL=from-entries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from-entries.js","sourceRoot":"","sources":["../../src/object/from-entries.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CACzB,OAA+B;IAE/B,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAuB,CAAA;AAC1D,CAAC"}
@@ -4,3 +4,4 @@ export * from './is-plain-object.js';
4
4
  export * from './is-reference-equal.js';
5
5
  export * from './is-shallow-equal.js';
6
6
  export * from './is-deep-equal.js';
7
+ export * from './from-entries.js';
@@ -4,4 +4,5 @@ export * from './is-plain-object.js';
4
4
  export * from './is-reference-equal.js';
5
5
  export * from './is-shallow-equal.js';
6
6
  export * from './is-deep-equal.js';
7
+ export * from './from-entries.js';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/object/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/object/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA"}
@@ -3,7 +3,7 @@ export function isURLString(text) {
3
3
  new URL(text);
4
4
  return true;
5
5
  }
6
- catch (_a) {
6
+ catch {
7
7
  return false;
8
8
  }
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-url-string.js","sourceRoot":"","sources":["../../src/string/is-url-string.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI;QACF,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;QACb,OAAO,IAAI,CAAA;KACZ;IAAC,WAAM;QACN,OAAO,KAAK,CAAA;KACb;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC"}
1
+ {"version":3,"file":"is-url-string.js","sourceRoot":"","sources":["../../src/string/is-url-string.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI;QACF,IAAI,GAAG,CAAC,IAAI,CAAC,CAAA;QACb,OAAO,IAAI,CAAA;KACZ;IAAC,MAAM;QACN,OAAO,KAAK,CAAA;KACb;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extra-utils",
3
- "version": "5.13.0",
3
+ "version": "5.14.0",
4
4
  "description": "Utilities for JavaScript and Typescript",
5
5
  "files": [
6
6
  "src",
@@ -0,0 +1,5 @@
1
+ export function fromEntries<Key extends number | string, Value>(
2
+ entries: Iterable<[Key, Value]>
3
+ ): Record<Key, Value> {
4
+ return Object.fromEntries(entries) as Record<Key, Value>
5
+ }
@@ -4,3 +4,4 @@ export * from './is-plain-object.js'
4
4
  export * from './is-reference-equal.js'
5
5
  export * from './is-shallow-equal.js'
6
6
  export * from './is-deep-equal.js'
7
+ export * from './from-entries.js'