@vinicunca/perkakas 1.0.4 → 1.0.5

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.
Files changed (151) hide show
  1. package/dist/add-prop.d.cts +1 -1
  2. package/dist/add-prop.d.ts +1 -1
  3. package/dist/chunk-D5B5IQRS.js +1 -0
  4. package/dist/chunk-IOSBDH5J.cjs +1 -0
  5. package/dist/chunk-QT66COHU.js +1 -0
  6. package/dist/chunk-Z6HCXPKS.cjs +1 -0
  7. package/dist/chunk.d.cts +1 -1
  8. package/dist/chunk.d.ts +1 -1
  9. package/dist/concat.d.cts +1 -1
  10. package/dist/concat.d.ts +1 -1
  11. package/dist/conditional.d.cts +1 -1
  12. package/dist/conditional.d.ts +1 -1
  13. package/dist/drop-first-by.d.cts +1 -1
  14. package/dist/drop-first-by.d.ts +1 -1
  15. package/dist/drop-last-while.d.cts +1 -1
  16. package/dist/drop-last-while.d.ts +1 -1
  17. package/dist/drop-last.d.cts +1 -1
  18. package/dist/drop-last.d.ts +1 -1
  19. package/dist/drop-while.d.cts +1 -1
  20. package/dist/drop-while.d.ts +1 -1
  21. package/dist/drop.cjs +1 -1
  22. package/dist/drop.d.cts +20 -7
  23. package/dist/drop.d.ts +20 -7
  24. package/dist/drop.js +1 -1
  25. package/dist/drop.spec-d.cjs +1 -1
  26. package/dist/drop.spec-d.js +1 -1
  27. package/dist/evolve.d.cts +1 -1
  28. package/dist/evolve.d.ts +1 -1
  29. package/dist/first-by.d.cts +1 -1
  30. package/dist/first-by.d.ts +1 -1
  31. package/dist/first.d.cts +1 -1
  32. package/dist/first.d.ts +1 -1
  33. package/dist/flat.d.cts +1 -1
  34. package/dist/flat.d.ts +1 -1
  35. package/dist/for-each-obj.d.cts +1 -1
  36. package/dist/for-each-obj.d.ts +1 -1
  37. package/dist/for-each.d.cts +1 -1
  38. package/dist/for-each.d.ts +1 -1
  39. package/dist/from-entries.d.cts +1 -1
  40. package/dist/from-entries.d.ts +1 -1
  41. package/dist/from-keys.d.cts +1 -1
  42. package/dist/from-keys.d.ts +1 -1
  43. package/dist/group-by.d.cts +1 -1
  44. package/dist/group-by.d.ts +1 -1
  45. package/dist/has-at-least.d.cts +1 -1
  46. package/dist/has-at-least.d.ts +1 -1
  47. package/dist/has-sub-object.d.cts +1 -1
  48. package/dist/has-sub-object.d.ts +1 -1
  49. package/dist/index-by.d.cts +1 -1
  50. package/dist/index-by.d.ts +1 -1
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.cts +2 -1
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.js +1 -1
  55. package/dist/is-array.d.cts +1 -1
  56. package/dist/is-array.d.ts +1 -1
  57. package/dist/is-big-int.d.cts +1 -1
  58. package/dist/is-big-int.d.ts +1 -1
  59. package/dist/is-boolean.d.cts +1 -1
  60. package/dist/is-boolean.d.ts +1 -1
  61. package/dist/is-empty.d.cts +1 -1
  62. package/dist/is-empty.d.ts +1 -1
  63. package/dist/is-included-in.d.cts +1 -1
  64. package/dist/is-included-in.d.ts +1 -1
  65. package/dist/is-nullish.d.cts +1 -1
  66. package/dist/is-nullish.d.ts +1 -1
  67. package/dist/is-number.d.cts +1 -1
  68. package/dist/is-number.d.ts +1 -1
  69. package/dist/is-object-type.d.cts +1 -1
  70. package/dist/is-object-type.d.ts +1 -1
  71. package/dist/is-plain-object.d.cts +1 -1
  72. package/dist/is-plain-object.d.ts +1 -1
  73. package/dist/is-string.d.cts +1 -1
  74. package/dist/is-string.d.ts +1 -1
  75. package/dist/is-symbol.d.cts +1 -1
  76. package/dist/is-symbol.d.ts +1 -1
  77. package/dist/keys.d.cts +1 -1
  78. package/dist/keys.d.ts +1 -1
  79. package/dist/last.d.cts +1 -1
  80. package/dist/last.d.ts +1 -1
  81. package/dist/map-keys.d.cts +1 -1
  82. package/dist/map-keys.d.ts +1 -1
  83. package/dist/map-values.d.cts +1 -1
  84. package/dist/map-values.d.ts +1 -1
  85. package/dist/map-with-feedback.d.cts +1 -1
  86. package/dist/map-with-feedback.d.ts +1 -1
  87. package/dist/map.d.cts +1 -1
  88. package/dist/map.d.ts +1 -1
  89. package/dist/nth-by.d.cts +1 -1
  90. package/dist/nth-by.d.ts +1 -1
  91. package/dist/omit-by.d.cts +1 -1
  92. package/dist/omit-by.d.ts +1 -1
  93. package/dist/only.d.cts +1 -1
  94. package/dist/only.d.ts +1 -1
  95. package/dist/pick-by.d.cts +1 -1
  96. package/dist/pick-by.d.ts +1 -1
  97. package/dist/product.d.cts +1 -1
  98. package/dist/product.d.ts +1 -1
  99. package/dist/pull-object.d.cts +1 -1
  100. package/dist/pull-object.d.ts +1 -1
  101. package/dist/random-integer.cjs +1 -0
  102. package/dist/random-integer.d.cts +20 -0
  103. package/dist/random-integer.d.ts +20 -0
  104. package/dist/random-integer.js +1 -0
  105. package/dist/random-integer.spec-d.cjs +1 -0
  106. package/dist/random-integer.spec-d.d.cts +2 -0
  107. package/dist/random-integer.spec-d.d.ts +2 -0
  108. package/dist/random-integer.spec-d.js +1 -0
  109. package/dist/rank-by.d.cts +1 -1
  110. package/dist/rank-by.d.ts +1 -1
  111. package/dist/sample.d.cts +1 -1
  112. package/dist/sample.d.ts +1 -1
  113. package/dist/set.d.cts +1 -1
  114. package/dist/set.d.ts +1 -1
  115. package/dist/shuffle.d.cts +1 -1
  116. package/dist/shuffle.d.ts +1 -1
  117. package/dist/sort-by.d.cts +1 -1
  118. package/dist/sort-by.d.ts +1 -1
  119. package/dist/sort.d.cts +1 -1
  120. package/dist/sort.d.ts +1 -1
  121. package/dist/sum.d.cts +1 -1
  122. package/dist/sum.d.ts +1 -1
  123. package/dist/swap-indices.d.cts +1 -1
  124. package/dist/swap-indices.d.ts +1 -1
  125. package/dist/take-first-by.d.cts +1 -1
  126. package/dist/take-first-by.d.ts +1 -1
  127. package/dist/take-last-while.d.cts +1 -1
  128. package/dist/take-last-while.d.ts +1 -1
  129. package/dist/take-last.d.cts +1 -1
  130. package/dist/take-last.d.ts +1 -1
  131. package/dist/take-while.d.cts +1 -1
  132. package/dist/take-while.d.ts +1 -1
  133. package/dist/take.d.cts +1 -1
  134. package/dist/take.d.ts +1 -1
  135. package/dist/{types-BE3YOWVA.d.cts → types-CC8iZVKO.d.cts} +12 -2
  136. package/dist/{types-BE3YOWVA.d.ts → types-CC8iZVKO.d.ts} +12 -2
  137. package/dist/unique-by.d.cts +1 -1
  138. package/dist/unique-by.d.ts +1 -1
  139. package/dist/unique-with.d.cts +1 -1
  140. package/dist/unique-with.d.ts +1 -1
  141. package/dist/unique.d.cts +1 -1
  142. package/dist/unique.d.ts +1 -1
  143. package/dist/values.d.cts +1 -1
  144. package/dist/values.d.ts +1 -1
  145. package/dist/zip-with.d.cts +1 -1
  146. package/dist/zip-with.d.ts +1 -1
  147. package/dist/zip.d.cts +1 -1
  148. package/dist/zip.d.ts +1 -1
  149. package/package.json +1 -1
  150. package/dist/chunk-IRH6TGG5.js +0 -1
  151. package/dist/chunk-RCENCAXY.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { a as NonEmptyArray } from './types-BE3YOWVA.js';
1
+ import { a as NonEmptyArray } from './types-CC8iZVKO.js';
2
2
  import { O as OrderRule } from './curry-order-rules-DETxSzle.js';
3
3
  import 'type-fest';
4
4
 
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/take.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/take.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split } from 'type-fest';
1
+ import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split, IfNever } from 'type-fest';
2
2
 
3
3
  declare const __brand: unique symbol;
4
4
  type Branded<T, Brand extends symbol> = T & {
@@ -135,6 +135,16 @@ type TupleParts<T, Prefix extends Array<unknown> = [], Suffix extends Array<unkn
135
135
  item: Item;
136
136
  suffix: Suffix;
137
137
  } : never;
138
+ /**
139
+ * `never[]` and `[]` are not the same type, and in some cases they aren't
140
+ * interchangeable.
141
+ *
142
+ * This type makes it easier to use the result of TupleParts when the input is a
143
+ * fixed-length tuple but we still want to spread the rest of the array. e.g.
144
+ * `[...CoercedArray<TupleParts<T>["item"]>, ...TupleParts<T>["suffix"]]`.
145
+ *
146
+ */
147
+ type CoercedArray<T> = IfNever<T, [], Array<T>>;
138
148
  /**
139
149
  * The result of running a function that would dedupe an array (`unique`,
140
150
  * `uniqueBy`, and `uniqueWith`).
@@ -155,4 +165,4 @@ type Deduped<T extends IterableContainer> = T extends readonly [] ? [
155
165
  ...Array<Rest[number]>
156
166
  ] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
157
167
 
158
- export type { Branded as B, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
168
+ export type { Branded as B, CoercedArray as C, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
@@ -1,4 +1,4 @@
1
- import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split } from 'type-fest';
1
+ import { EmptyObject, IsAny, Simplify, IsLiteral, IsNever, KeysOfUnion, IsStringLiteral, IsNumericLiteral, IsSymbolLiteral, Split, IfNever } from 'type-fest';
2
2
 
3
3
  declare const __brand: unique symbol;
4
4
  type Branded<T, Brand extends symbol> = T & {
@@ -135,6 +135,16 @@ type TupleParts<T, Prefix extends Array<unknown> = [], Suffix extends Array<unkn
135
135
  item: Item;
136
136
  suffix: Suffix;
137
137
  } : never;
138
+ /**
139
+ * `never[]` and `[]` are not the same type, and in some cases they aren't
140
+ * interchangeable.
141
+ *
142
+ * This type makes it easier to use the result of TupleParts when the input is a
143
+ * fixed-length tuple but we still want to spread the rest of the array. e.g.
144
+ * `[...CoercedArray<TupleParts<T>["item"]>, ...TupleParts<T>["suffix"]]`.
145
+ *
146
+ */
147
+ type CoercedArray<T> = IfNever<T, [], Array<T>>;
138
148
  /**
139
149
  * The result of running a function that would dedupe an array (`unique`,
140
150
  * `uniqueBy`, and `uniqueWith`).
@@ -155,4 +165,4 @@ type Deduped<T extends IterableContainer> = T extends readonly [] ? [
155
165
  ...Array<Rest[number]>
156
166
  ] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
157
167
 
158
- export type { Branded as B, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
168
+ export type { Branded as B, CoercedArray as C, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer, D as Deduped } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer, D as Deduped } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer, D as Deduped } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  type IsEquals<T> = (a: T, b: T) => boolean;
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer, D as Deduped } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  type IsEquals<T> = (a: T, b: T) => boolean;
package/dist/unique.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer, D as Deduped } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/unique.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer, D as Deduped } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  /**
package/dist/values.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
package/dist/values.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  type ZippingFunction<T1 extends IterableContainer = IterableContainer, T2 extends IterableContainer = IterableContainer, Value = unknown> = (first: T1[number], second: T2[number], index: number, data: readonly [first: T1, second: T2]) => Value;
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  type ZippingFunction<T1 extends IterableContainer = IterableContainer, T2 extends IterableContainer = IterableContainer, Value = unknown> = (first: T1[number], second: T2[number], index: number, data: readonly [first: T1, second: T2]) => Value;
package/dist/zip.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.cjs';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.cjs';
2
2
  import 'type-fest';
3
3
 
4
4
  type Zipped<Left extends IterableContainer, Right extends IterableContainer> = Left extends readonly [] ? [] : Right extends readonly [] ? [] : Left extends readonly [infer LeftHead, ...infer LeftRest] ? Right extends readonly [infer RightHead, ...infer RightRest] ? [
package/dist/zip.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IterableContainer } from './types-BE3YOWVA.js';
1
+ import { I as IterableContainer } from './types-CC8iZVKO.js';
2
2
  import 'type-fest';
3
3
 
4
4
  type Zipped<Left extends IterableContainer, Right extends IterableContainer> = Left extends readonly [] ? [] : Right extends readonly [] ? [] : Left extends readonly [infer LeftHead, ...infer LeftRest] ? Right extends readonly [infer RightHead, ...infer RightRest] ? [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/perkakas",
3
3
  "type": "module",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "description": "Utility for JavaScript and Typescript.",
6
6
  "author": "praburangki<https://github.com/praburangki>",
7
7
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{a as n,c as o}from"./chunk-MYLYERXO.js";import{a as t}from"./chunk-JFXZ246Y.js";function T(...e){return t(a,e,p)}function a(e,r){return r<0?[...e]:e.slice(r)}function p(e){if(e<=0)return o;let r=e;return u=>r>0?(r-=1,n):{done:!1,hasNext:!0,next:u}}export{T as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3X6SAJDQcjs = require('./chunk-3X6SAJDQ.cjs');var _chunkY74ER22Ocjs = require('./chunk-Y74ER22O.cjs');function T(...e){return _chunkY74ER22Ocjs.a.call(void 0, a,e,p)}function a(e,r){return r<0?[...e]:e.slice(r)}function p(e){if(e<=0)return _chunk3X6SAJDQcjs.c;let r=e;return u=>r>0?(r-=1,_chunk3X6SAJDQcjs.a):{done:!1,hasNext:!0,next:u}}exports.a = T;