@duplojs/utils 1.1.8 → 1.1.10

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 (208) hide show
  1. package/dist/array/reduce.cjs +2 -0
  2. package/dist/array/reduce.mjs +2 -0
  3. package/dist/array/reduceRight.cjs +2 -0
  4. package/dist/array/reduceRight.mjs +2 -0
  5. package/dist/common/builder.cjs +70 -0
  6. package/dist/common/builder.d.ts +34 -0
  7. package/dist/common/builder.mjs +66 -0
  8. package/dist/common/globalStore.cjs +21 -0
  9. package/dist/common/globalStore.d.ts +7 -0
  10. package/dist/common/globalStore.mjs +19 -0
  11. package/dist/common/index.d.ts +2 -0
  12. package/dist/common/instanceOf.cjs +2 -0
  13. package/dist/common/instanceOf.mjs +2 -0
  14. package/dist/common/kind.cjs +5 -3
  15. package/dist/common/kind.d.ts +13 -5
  16. package/dist/common/kind.mjs +5 -4
  17. package/dist/common/wrapValue.cjs +4 -0
  18. package/dist/common/wrapValue.d.ts +1 -0
  19. package/dist/common/wrapValue.mjs +4 -1
  20. package/dist/dataParser/base.cjs +2 -0
  21. package/dist/dataParser/base.d.ts +2 -2
  22. package/dist/dataParser/base.mjs +2 -0
  23. package/dist/dataParser/baseExtended.cjs +2 -0
  24. package/dist/dataParser/baseExtended.d.ts +1 -1
  25. package/dist/dataParser/baseExtended.mjs +2 -0
  26. package/dist/dataParser/error.d.ts +3 -3
  27. package/dist/dataParser/extended/array.cjs +2 -0
  28. package/dist/dataParser/extended/array.mjs +2 -0
  29. package/dist/dataParser/extended/bigint.cjs +2 -0
  30. package/dist/dataParser/extended/bigint.mjs +2 -0
  31. package/dist/dataParser/extended/boolean.cjs +2 -0
  32. package/dist/dataParser/extended/boolean.mjs +2 -0
  33. package/dist/dataParser/extended/coerce/bigint.cjs +2 -0
  34. package/dist/dataParser/extended/coerce/bigint.mjs +2 -0
  35. package/dist/dataParser/extended/coerce/boolean.cjs +2 -0
  36. package/dist/dataParser/extended/coerce/boolean.mjs +2 -0
  37. package/dist/dataParser/extended/coerce/empty.cjs +2 -0
  38. package/dist/dataParser/extended/coerce/empty.mjs +2 -0
  39. package/dist/dataParser/extended/coerce/nil.cjs +2 -0
  40. package/dist/dataParser/extended/coerce/nil.mjs +2 -0
  41. package/dist/dataParser/extended/coerce/number.cjs +2 -0
  42. package/dist/dataParser/extended/coerce/number.mjs +2 -0
  43. package/dist/dataParser/extended/coerce/string.cjs +2 -0
  44. package/dist/dataParser/extended/coerce/string.mjs +2 -0
  45. package/dist/dataParser/extended/empty.cjs +2 -0
  46. package/dist/dataParser/extended/empty.mjs +2 -0
  47. package/dist/dataParser/extended/lazy.cjs +2 -0
  48. package/dist/dataParser/extended/lazy.mjs +2 -0
  49. package/dist/dataParser/extended/literal.cjs +2 -0
  50. package/dist/dataParser/extended/literal.mjs +2 -0
  51. package/dist/dataParser/extended/nil.cjs +2 -0
  52. package/dist/dataParser/extended/nil.mjs +2 -0
  53. package/dist/dataParser/extended/nullable.cjs +2 -0
  54. package/dist/dataParser/extended/nullable.mjs +2 -0
  55. package/dist/dataParser/extended/number.cjs +2 -0
  56. package/dist/dataParser/extended/number.mjs +2 -0
  57. package/dist/dataParser/extended/object.cjs +2 -0
  58. package/dist/dataParser/extended/object.mjs +2 -0
  59. package/dist/dataParser/extended/optional.cjs +2 -0
  60. package/dist/dataParser/extended/optional.mjs +2 -0
  61. package/dist/dataParser/extended/pipe.cjs +2 -0
  62. package/dist/dataParser/extended/pipe.mjs +2 -0
  63. package/dist/dataParser/extended/record.cjs +2 -0
  64. package/dist/dataParser/extended/record.mjs +2 -0
  65. package/dist/dataParser/extended/string.cjs +2 -0
  66. package/dist/dataParser/extended/string.mjs +2 -0
  67. package/dist/dataParser/extended/templateLiteral.cjs +2 -0
  68. package/dist/dataParser/extended/templateLiteral.mjs +2 -0
  69. package/dist/dataParser/extended/transform.cjs +2 -0
  70. package/dist/dataParser/extended/transform.mjs +2 -0
  71. package/dist/dataParser/extended/tuple.cjs +2 -0
  72. package/dist/dataParser/extended/tuple.mjs +2 -0
  73. package/dist/dataParser/extended/union.cjs +2 -0
  74. package/dist/dataParser/extended/union.mjs +2 -0
  75. package/dist/dataParser/extended/unknown.cjs +2 -0
  76. package/dist/dataParser/extended/unknown.mjs +2 -0
  77. package/dist/dataParser/kind.cjs +5 -1
  78. package/dist/dataParser/kind.d.ts +1 -1
  79. package/dist/dataParser/kind.mjs +5 -1
  80. package/dist/dataParser/parsers/array/checkers/max.d.ts +1 -1
  81. package/dist/dataParser/parsers/array/checkers/min.d.ts +1 -1
  82. package/dist/dataParser/parsers/array/index.d.ts +1 -1
  83. package/dist/dataParser/parsers/bigint/checkers/max.d.ts +1 -1
  84. package/dist/dataParser/parsers/bigint/checkers/min.d.ts +1 -1
  85. package/dist/dataParser/parsers/bigint/index.d.ts +1 -1
  86. package/dist/dataParser/parsers/boolean.d.ts +1 -1
  87. package/dist/dataParser/parsers/coerce/bigint.cjs +2 -0
  88. package/dist/dataParser/parsers/coerce/bigint.mjs +2 -0
  89. package/dist/dataParser/parsers/coerce/boolean.cjs +2 -0
  90. package/dist/dataParser/parsers/coerce/boolean.mjs +2 -0
  91. package/dist/dataParser/parsers/coerce/empty.cjs +2 -0
  92. package/dist/dataParser/parsers/coerce/empty.mjs +2 -0
  93. package/dist/dataParser/parsers/coerce/nil.cjs +2 -0
  94. package/dist/dataParser/parsers/coerce/nil.mjs +2 -0
  95. package/dist/dataParser/parsers/coerce/number.cjs +2 -0
  96. package/dist/dataParser/parsers/coerce/number.mjs +2 -0
  97. package/dist/dataParser/parsers/coerce/string.cjs +2 -0
  98. package/dist/dataParser/parsers/coerce/string.mjs +2 -0
  99. package/dist/dataParser/parsers/empty.d.ts +1 -1
  100. package/dist/dataParser/parsers/lazy.d.ts +1 -1
  101. package/dist/dataParser/parsers/literal.cjs +2 -0
  102. package/dist/dataParser/parsers/literal.d.ts +1 -1
  103. package/dist/dataParser/parsers/literal.mjs +2 -0
  104. package/dist/dataParser/parsers/nil.d.ts +1 -1
  105. package/dist/dataParser/parsers/nullable.d.ts +1 -1
  106. package/dist/dataParser/parsers/number/checkers/int.d.ts +1 -1
  107. package/dist/dataParser/parsers/number/checkers/max.d.ts +1 -1
  108. package/dist/dataParser/parsers/number/checkers/min.d.ts +1 -1
  109. package/dist/dataParser/parsers/number/index.d.ts +1 -1
  110. package/dist/dataParser/parsers/object.cjs +2 -0
  111. package/dist/dataParser/parsers/object.d.ts +1 -1
  112. package/dist/dataParser/parsers/object.mjs +2 -0
  113. package/dist/dataParser/parsers/optional.d.ts +1 -1
  114. package/dist/dataParser/parsers/pipe.d.ts +1 -1
  115. package/dist/dataParser/parsers/record.d.ts +1 -1
  116. package/dist/dataParser/parsers/string/checkers/email.d.ts +1 -1
  117. package/dist/dataParser/parsers/string/checkers/max.d.ts +1 -1
  118. package/dist/dataParser/parsers/string/checkers/min.d.ts +1 -1
  119. package/dist/dataParser/parsers/string/checkers/regex.d.ts +1 -1
  120. package/dist/dataParser/parsers/string/checkers/url.d.ts +1 -1
  121. package/dist/dataParser/parsers/string/index.d.ts +1 -1
  122. package/dist/dataParser/parsers/templateLiteral.cjs +2 -0
  123. package/dist/dataParser/parsers/templateLiteral.d.ts +1 -1
  124. package/dist/dataParser/parsers/templateLiteral.mjs +2 -0
  125. package/dist/dataParser/parsers/transform.d.ts +1 -1
  126. package/dist/dataParser/parsers/tuple.d.ts +1 -1
  127. package/dist/dataParser/parsers/union.d.ts +1 -1
  128. package/dist/dataParser/parsers/unknown.d.ts +1 -1
  129. package/dist/either/bool/base.d.ts +1 -1
  130. package/dist/either/bool/falsy.cjs +2 -0
  131. package/dist/either/bool/falsy.d.ts +1 -1
  132. package/dist/either/bool/falsy.mjs +2 -0
  133. package/dist/either/bool/truthy.cjs +2 -0
  134. package/dist/either/bool/truthy.d.ts +1 -1
  135. package/dist/either/bool/truthy.mjs +2 -0
  136. package/dist/either/future/base.d.ts +1 -1
  137. package/dist/either/future/create.cjs +2 -0
  138. package/dist/either/future/create.mjs +2 -0
  139. package/dist/either/future/error.cjs +2 -0
  140. package/dist/either/future/error.d.ts +1 -1
  141. package/dist/either/future/error.mjs +2 -0
  142. package/dist/either/future/success.cjs +2 -0
  143. package/dist/either/future/success.d.ts +1 -1
  144. package/dist/either/future/success.mjs +2 -0
  145. package/dist/either/kind.cjs +5 -1
  146. package/dist/either/kind.d.ts +2 -2
  147. package/dist/either/kind.mjs +5 -1
  148. package/dist/either/left/create.d.ts +1 -1
  149. package/dist/either/left/error.d.ts +1 -1
  150. package/dist/either/left/fail.d.ts +1 -1
  151. package/dist/either/left/when.cjs +2 -0
  152. package/dist/either/left/when.mjs +2 -0
  153. package/dist/either/nullable/base.d.ts +1 -1
  154. package/dist/either/nullable/empty.cjs +2 -0
  155. package/dist/either/nullable/empty.d.ts +1 -1
  156. package/dist/either/nullable/empty.mjs +2 -0
  157. package/dist/either/nullable/filled.cjs +2 -0
  158. package/dist/either/nullable/filled.d.ts +1 -1
  159. package/dist/either/nullable/filled.mjs +2 -0
  160. package/dist/either/nullish/base.d.ts +1 -1
  161. package/dist/either/nullish/empty.cjs +2 -0
  162. package/dist/either/nullish/empty.d.ts +1 -1
  163. package/dist/either/nullish/empty.mjs +2 -0
  164. package/dist/either/nullish/filled.cjs +2 -0
  165. package/dist/either/nullish/filled.d.ts +1 -1
  166. package/dist/either/nullish/filled.mjs +2 -0
  167. package/dist/either/optional/base.d.ts +1 -1
  168. package/dist/either/optional/empty.cjs +2 -0
  169. package/dist/either/optional/empty.d.ts +1 -1
  170. package/dist/either/optional/empty.mjs +2 -0
  171. package/dist/either/optional/filled.cjs +2 -0
  172. package/dist/either/optional/filled.d.ts +1 -1
  173. package/dist/either/optional/filled.mjs +2 -0
  174. package/dist/either/right/asyncPipe.cjs +2 -0
  175. package/dist/either/right/asyncPipe.mjs +2 -0
  176. package/dist/either/right/create.d.ts +1 -1
  177. package/dist/either/right/ok.d.ts +1 -1
  178. package/dist/either/right/pipe.cjs +2 -0
  179. package/dist/either/right/pipe.mjs +2 -0
  180. package/dist/either/right/success.d.ts +1 -1
  181. package/dist/either/right/when.cjs +2 -0
  182. package/dist/either/right/when.mjs +2 -0
  183. package/dist/either/whenHasInformation.cjs +2 -0
  184. package/dist/either/whenHasInformation.mjs +2 -0
  185. package/dist/generator/asyncReduce.cjs +2 -0
  186. package/dist/generator/asyncReduce.mjs +2 -0
  187. package/dist/generator/reduce.cjs +2 -0
  188. package/dist/generator/reduce.mjs +2 -0
  189. package/dist/index.cjs +8 -0
  190. package/dist/index.mjs +4 -2
  191. package/dist/object/deepDiscriminate.cjs +2 -0
  192. package/dist/object/deepDiscriminate.mjs +2 -0
  193. package/dist/object/discriminate.cjs +2 -0
  194. package/dist/object/discriminate.mjs +2 -0
  195. package/dist/object/entries.cjs +4 -1
  196. package/dist/object/entries.mjs +5 -2
  197. package/dist/object/keys.cjs +4 -1
  198. package/dist/object/keys.mjs +5 -2
  199. package/dist/pattern/exhaustive.cjs +2 -0
  200. package/dist/pattern/exhaustive.mjs +2 -0
  201. package/dist/pattern/otherwise.cjs +2 -0
  202. package/dist/pattern/otherwise.mjs +2 -0
  203. package/dist/pattern/result.cjs +2 -0
  204. package/dist/pattern/result.mjs +2 -0
  205. package/dist/string/types/forbiddenString.d.ts +7 -0
  206. package/dist/string/types/index.d.ts +1 -1
  207. package/package.json +1 -1
  208. package/dist/string/types/forbiddenCharacters.d.ts +0 -5
@@ -1,6 +1,8 @@
1
1
  import { createEitherKind } from '../kind.mjs';
2
2
  import { isLeft } from '../left/is.mjs';
3
3
  import { unwrap } from '../../common/unwrap.mjs';
4
+ import '../../common/globalStore.mjs';
5
+ import '../../common/builder.mjs';
4
6
  import { right } from '../right/create.mjs';
5
7
  import { isRight } from '../right/is.mjs';
6
8
  import { nullish } from './create.mjs';
@@ -1 +1 @@
1
- export declare const eitherOptionalKind: import("../..").KindHandler<import("../..").KindDefinition<"@Either/optional", unknown>>;
1
+ export declare const eitherOptionalKind: import("../..").KindHandler<import("../..").KindDefinition<"@DuplojsUtilsEither/optional", unknown>>;
@@ -5,6 +5,8 @@ var base = require('./base.cjs');
5
5
  var create$1 = require('./create.cjs');
6
6
  var create = require('../left/create.cjs');
7
7
  var is = require('../left/is.cjs');
8
+ require('../../common/globalStore.cjs');
9
+ require('../../common/builder.cjs');
8
10
  var is$1 = require('../right/is.cjs');
9
11
 
10
12
  const eitherOptionalEmptyKind = kind.createEitherKind("optional-empty");
@@ -4,7 +4,7 @@ import { eitherOptionalKind } from "./base";
4
4
  import { optional } from "./create";
5
5
  import { type EitherLeft } from "../left";
6
6
  import { type EitherRight } from "../right";
7
- export declare const eitherOptionalEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/optional-empty", unknown>>;
7
+ export declare const eitherOptionalEmptyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@DuplojsUtilsEither/optional-empty", unknown>>;
8
8
  type _EitherOptionalEmpty = (EitherLeft<"optional", undefined> & Kind<typeof eitherOptionalKind.definition> & Kind<typeof eitherOptionalEmptyKind.definition>);
9
9
  export interface EitherOptionalEmpty extends _EitherOptionalEmpty {
10
10
  }
@@ -3,6 +3,8 @@ import { eitherOptionalKind } from './base.mjs';
3
3
  import { optional } from './create.mjs';
4
4
  import { left } from '../left/create.mjs';
5
5
  import { isLeft } from '../left/is.mjs';
6
+ import '../../common/globalStore.mjs';
7
+ import '../../common/builder.mjs';
6
8
  import { isRight } from '../right/is.mjs';
7
9
 
8
10
  const eitherOptionalEmptyKind = createEitherKind("optional-empty");
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../../common/unwrap.cjs');
4
+ require('../../common/globalStore.cjs');
5
+ require('../../common/builder.cjs');
4
6
  var kind = require('../kind.cjs');
5
7
  var base = require('./base.cjs');
6
8
  var create$1 = require('./create.cjs');
@@ -4,7 +4,7 @@ import { eitherOptionalKind } from "./base";
4
4
  import { optional } from "./create";
5
5
  import { type EitherLeft } from "../left";
6
6
  import { type EitherRight } from "../right";
7
- export declare const eitherOptionalFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/optional-filled", unknown>>;
7
+ export declare const eitherOptionalFilledKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@DuplojsUtilsEither/optional-filled", unknown>>;
8
8
  type _EitherOptionalFilled<GenericValue extends unknown = unknown> = (EitherRight<"optional", GenericValue> & Kind<typeof eitherOptionalKind.definition> & Kind<typeof eitherOptionalFilledKind.definition>);
9
9
  export interface EitherOptionalFilled<GenericValue extends unknown = unknown> extends _EitherOptionalFilled<GenericValue> {
10
10
  }
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../../common/unwrap.mjs';
2
+ import '../../common/globalStore.mjs';
3
+ import '../../common/builder.mjs';
2
4
  import { createEitherKind } from '../kind.mjs';
3
5
  import { eitherOptionalKind } from './base.mjs';
4
6
  import { optional } from './create.mjs';
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../../common/unwrap.cjs');
4
+ require('../../common/globalStore.cjs');
5
+ require('../../common/builder.cjs');
4
6
  var is = require('../left/is.cjs');
5
7
  var create = require('../future/create.cjs');
6
8
  var success = require('./success.cjs');
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../../common/unwrap.mjs';
2
+ import '../../common/globalStore.mjs';
3
+ import '../../common/builder.mjs';
2
4
  import { isLeft } from '../left/is.mjs';
3
5
  import { future } from '../future/create.mjs';
4
6
  import { success } from './success.mjs';
@@ -1,7 +1,7 @@
1
1
  import { type Kind } from "../../common/kind";
2
2
  import { type WrappedValue } from "../../common/wrapValue";
3
3
  import { eitherInformationKind } from "../kind";
4
- export declare const eitherRightKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/right", unknown>>;
4
+ export declare const eitherRightKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@DuplojsUtilsEither/right", unknown>>;
5
5
  type _EitherRight<GenericInformation extends string = string, GenericValue extends unknown = unknown> = (Kind<typeof eitherRightKind.definition> & Kind<typeof eitherInformationKind.definition, GenericInformation> & WrappedValue<GenericValue>);
6
6
  export interface EitherRight<GenericInformation extends string = string, GenericValue extends unknown = unknown> extends _EitherRight<GenericInformation, GenericValue> {
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { type Kind } from "../../common/kind";
2
2
  import { type EitherRight } from "./create";
3
- export declare const eitherOkKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/ok", unknown>>;
3
+ export declare const eitherOkKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@DuplojsUtilsEither/ok", unknown>>;
4
4
  type _EitherOk = (EitherRight<"ok", never> & Kind<typeof eitherOkKind.definition>);
5
5
  export interface EitherOk extends _EitherOk {
6
6
  }
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../../common/unwrap.cjs');
4
+ require('../../common/globalStore.cjs');
5
+ require('../../common/builder.cjs');
4
6
  var is = require('../left/is.cjs');
5
7
  var success = require('./success.cjs');
6
8
  var is$1 = require('./is.cjs');
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../../common/unwrap.mjs';
2
+ import '../../common/globalStore.mjs';
3
+ import '../../common/builder.mjs';
2
4
  import { isLeft } from '../left/is.mjs';
3
5
  import { success } from './success.mjs';
4
6
  import { isRight } from './is.mjs';
@@ -1,6 +1,6 @@
1
1
  import { type Kind } from "../../common/kind";
2
2
  import { type EitherRight } from "./create";
3
- export declare const eitherSuccessKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/success", unknown>>;
3
+ export declare const eitherSuccessKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@DuplojsUtilsEither/success", unknown>>;
4
4
  type _EitherSuccess<GenericValue extends unknown = unknown> = (EitherRight<"success", GenericValue> & Kind<typeof eitherSuccessKind.definition>);
5
5
  export interface EitherSuccess<GenericValue extends unknown = unknown> extends _EitherSuccess<GenericValue> {
6
6
  }
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../../common/unwrap.cjs');
4
+ require('../../common/globalStore.cjs');
5
+ require('../../common/builder.cjs');
4
6
  var is = require('./is.cjs');
5
7
 
6
8
  function whenIsRight(...args) {
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../../common/unwrap.mjs';
2
+ import '../../common/globalStore.mjs';
3
+ import '../../common/builder.mjs';
2
4
  import { isRight } from './is.mjs';
3
5
 
4
6
  function whenIsRight(...args) {
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../common/unwrap.cjs');
4
+ require('../common/globalStore.cjs');
5
+ require('../common/builder.cjs');
4
6
  var kind = require('./kind.cjs');
5
7
  var is = require('./left/is.cjs');
6
8
  var is$1 = require('./right/is.cjs');
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../common/unwrap.mjs';
2
+ import '../common/globalStore.mjs';
3
+ import '../common/builder.mjs';
2
4
  import { eitherInformationKind } from './kind.mjs';
3
5
  import { isLeft } from './left/is.mjs';
4
6
  import { isRight } from './right/is.mjs';
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../common/unwrap.cjs');
4
+ require('../common/globalStore.cjs');
5
+ require('../common/builder.cjs');
4
6
  var override = require('../object/override.cjs');
5
7
 
6
8
  function asyncReduce(...args) {
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../common/unwrap.mjs';
2
+ import '../common/globalStore.mjs';
3
+ import '../common/builder.mjs';
2
4
  import { override } from '../object/override.mjs';
3
5
 
4
6
  function asyncReduce(...args) {
@@ -3,6 +3,8 @@
3
3
  var kind = require('../common/kind.cjs');
4
4
  var wrapValue = require('../common/wrapValue.cjs');
5
5
  var unwrap = require('../common/unwrap.cjs');
6
+ require('../common/globalStore.cjs');
7
+ require('../common/builder.cjs');
6
8
  var override = require('../object/override.cjs');
7
9
 
8
10
  const generatorReduceFromKind = kind.createKind("generator-reduce-from");
@@ -1,6 +1,8 @@
1
1
  import { createKind } from '../common/kind.mjs';
2
2
  import { wrapValue } from '../common/wrapValue.mjs';
3
3
  import { unwrap } from '../common/unwrap.mjs';
4
+ import '../common/globalStore.mjs';
5
+ import '../common/builder.mjs';
4
6
  import { override } from '../object/override.mjs';
5
7
 
6
8
  const generatorReduceFromKind = createKind("generator-reduce-from");
package/dist/index.cjs CHANGED
@@ -37,6 +37,8 @@ var whenElse = require('./common/whenElse.cjs');
37
37
  var justReturn = require('./common/justReturn.cjs');
38
38
  var memo = require('./common/memo.cjs');
39
39
  var instanceOf = require('./common/instanceOf.cjs');
40
+ var globalStore = require('./common/globalStore.cjs');
41
+ var builder = require('./common/builder.cjs');
40
42
  var index = require('./array/index.cjs');
41
43
  var index$1 = require('./number/index.cjs');
42
44
  var index$2 = require('./either/index.cjs');
@@ -59,6 +61,7 @@ exports.createExternalPromise = externalPromise.createExternalPromise;
59
61
  exports.createInterpolation = interpolation.createInterpolation;
60
62
  exports.createKind = kind.createKind;
61
63
  exports.createKindNamespace = kind.createKindNamespace;
64
+ exports.isRuntimeKind = kind.isRuntimeKind;
62
65
  exports.keyKindPrefix = kind.keyKindPrefix;
63
66
  exports.kindHeritage = kind.kindHeritage;
64
67
  exports.pipe = pipe.pipe;
@@ -76,6 +79,7 @@ exports.unwrap = unwrap.unwrap;
76
79
  exports.asyncLoop = asyncLoop.asyncLoop;
77
80
  exports.createAsyncRetry = asyncRetry.createAsyncRetry;
78
81
  exports.useAsyncRetry = asyncRetry.useAsyncRetry;
82
+ exports.isRuntimeWrappedValueKey = wrapValue.isRuntimeWrappedValueKey;
79
83
  exports.isWrappedValue = wrapValue.isWrappedValue;
80
84
  exports.keyWrappedValue = wrapValue.keyWrappedValue;
81
85
  exports.wrapValue = wrapValue.wrapValue;
@@ -95,6 +99,10 @@ exports.whenElse = whenElse.whenElse;
95
99
  exports.justReturn = justReturn.justReturn;
96
100
  exports.memo = memo.memo;
97
101
  exports.instanceOf = instanceOf.instanceOf;
102
+ exports.createGlobalStore = globalStore.createGlobalStore;
103
+ exports.MissingBuilderMethodsError = builder.MissingBuilderMethodsError;
104
+ exports.builderKind = builder.builderKind;
105
+ exports.createBuilder = builder.createBuilder;
98
106
  exports.A = index;
99
107
  exports.DArray = index;
100
108
  exports.DNumber = index$1;
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ export { createEnum } from './common/enum.mjs';
5
5
  export { escapeRegExp } from './common/escapeRegExp.mjs';
6
6
  export { createExternalPromise } from './common/externalPromise.mjs';
7
7
  export { createInterpolation } from './common/interpolation.mjs';
8
- export { createKind, createKindNamespace, keyKindPrefix, kindHeritage } from './common/kind.mjs';
8
+ export { createKind, createKindNamespace, isRuntimeKind, keyKindPrefix, kindHeritage } from './common/kind.mjs';
9
9
  export { pipe } from './common/pipe.mjs';
10
10
  export { promiseObject } from './common/promiseObject.mjs';
11
11
  export { simpleClone } from './common/simpleClone.mjs';
@@ -18,7 +18,7 @@ export { toWrappedValue } from './common/toWrappedValue.mjs';
18
18
  export { unwrap } from './common/unwrap.mjs';
19
19
  export { asyncLoop } from './common/asyncLoop.mjs';
20
20
  export { createAsyncRetry, useAsyncRetry } from './common/asyncRetry.mjs';
21
- export { isWrappedValue, keyWrappedValue, wrapValue } from './common/wrapValue.mjs';
21
+ export { isRuntimeWrappedValueKey, isWrappedValue, keyWrappedValue, wrapValue } from './common/wrapValue.mjs';
22
22
  export { toString } from './common/toString.mjs';
23
23
  export { innerPipe } from './common/innerPipe.mjs';
24
24
  export { asyncInnerPipe } from './common/asyncInnerPipe.mjs';
@@ -35,6 +35,8 @@ export { whenElse } from './common/whenElse.mjs';
35
35
  export { justReturn } from './common/justReturn.mjs';
36
36
  export { memo } from './common/memo.mjs';
37
37
  export { instanceOf } from './common/instanceOf.mjs';
38
+ export { createGlobalStore } from './common/globalStore.mjs';
39
+ export { MissingBuilderMethodsError, builderKind, createBuilder } from './common/builder.mjs';
38
40
  import * as index from './array/index.mjs';
39
41
  export { index as A };
40
42
  export { index as DArray };
@@ -2,6 +2,8 @@
2
2
 
3
3
  var equal = require('../common/equal.cjs');
4
4
  var getDeepProperty = require('./getDeepProperty.cjs');
5
+ require('../common/globalStore.cjs');
6
+ require('../common/builder.cjs');
5
7
 
6
8
  function deepDiscriminate(...args) {
7
9
  if (args.length === 2) {
@@ -1,5 +1,7 @@
1
1
  import { equal } from '../common/equal.mjs';
2
2
  import { getDeepProperty } from './getDeepProperty.mjs';
3
+ import '../common/globalStore.mjs';
4
+ import '../common/builder.mjs';
3
5
 
4
6
  function deepDiscriminate(...args) {
5
7
  if (args.length === 2) {
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var equal = require('../common/equal.cjs');
4
+ require('../common/globalStore.cjs');
5
+ require('../common/builder.cjs');
4
6
 
5
7
  function discriminate(...args) {
6
8
  if (args.length === 2) {
@@ -1,4 +1,6 @@
1
1
  import { equal } from '../common/equal.mjs';
2
+ import '../common/globalStore.mjs';
3
+ import '../common/builder.mjs';
2
4
 
3
5
  function discriminate(...args) {
4
6
  if (args.length === 2) {
@@ -1,10 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ var kind = require('../common/kind.cjs');
3
4
  var wrapValue = require('../common/wrapValue.cjs');
5
+ require('../common/globalStore.cjs');
6
+ require('../common/builder.cjs');
4
7
 
5
8
  function entries(object) {
6
9
  return Object.entries(object)
7
- .filter(([key]) => !key.startsWith(wrapValue.keyWrappedValue));
10
+ .filter(([key]) => !wrapValue.isRuntimeWrappedValueKey(key) && !kind.isRuntimeKind(key));
8
11
  }
9
12
 
10
13
  exports.entries = entries;
@@ -1,8 +1,11 @@
1
- import { keyWrappedValue } from '../common/wrapValue.mjs';
1
+ import { isRuntimeKind } from '../common/kind.mjs';
2
+ import { isRuntimeWrappedValueKey } from '../common/wrapValue.mjs';
3
+ import '../common/globalStore.mjs';
4
+ import '../common/builder.mjs';
2
5
 
3
6
  function entries(object) {
4
7
  return Object.entries(object)
5
- .filter(([key]) => !key.startsWith(keyWrappedValue));
8
+ .filter(([key]) => !isRuntimeWrappedValueKey(key) && !isRuntimeKind(key));
6
9
  }
7
10
 
8
11
  export { entries };
@@ -1,10 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ var kind = require('../common/kind.cjs');
3
4
  var wrapValue = require('../common/wrapValue.cjs');
5
+ require('../common/globalStore.cjs');
6
+ require('../common/builder.cjs');
4
7
 
5
8
  function keys(object) {
6
9
  return Object.keys(object)
7
- .filter((key) => !key.startsWith(wrapValue.keyWrappedValue));
10
+ .filter((key) => !wrapValue.isRuntimeWrappedValueKey(key) && !kind.isRuntimeKind(key));
8
11
  }
9
12
 
10
13
  exports.keys = keys;
@@ -1,8 +1,11 @@
1
- import { keyWrappedValue } from '../common/wrapValue.mjs';
1
+ import { isRuntimeKind } from '../common/kind.mjs';
2
+ import { isRuntimeWrappedValueKey } from '../common/wrapValue.mjs';
3
+ import '../common/globalStore.mjs';
4
+ import '../common/builder.mjs';
2
5
 
3
6
  function keys(object) {
4
7
  return Object.keys(object)
5
- .filter((key) => !key.startsWith(keyWrappedValue));
8
+ .filter((key) => !isRuntimeWrappedValueKey(key) && !isRuntimeKind(key));
6
9
  }
7
10
 
8
11
  export { keys };
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../common/unwrap.cjs');
4
+ require('../common/globalStore.cjs');
5
+ require('../common/builder.cjs');
4
6
 
5
7
  function exhaustive(result) {
6
8
  return unwrap.unwrap(result);
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../common/unwrap.mjs';
2
+ import '../common/globalStore.mjs';
3
+ import '../common/builder.mjs';
2
4
 
3
5
  function exhaustive(result) {
4
6
  return unwrap(result);
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var unwrap = require('../common/unwrap.cjs');
4
+ require('../common/globalStore.cjs');
5
+ require('../common/builder.cjs');
4
6
  var result = require('./result.cjs');
5
7
 
6
8
  function otherwise(...args) {
@@ -1,4 +1,6 @@
1
1
  import { unwrap } from '../common/unwrap.mjs';
2
+ import '../common/globalStore.mjs';
3
+ import '../common/builder.mjs';
2
4
  import { isResult } from './result.mjs';
3
5
 
4
6
  function otherwise(...args) {
@@ -2,6 +2,8 @@
2
2
 
3
3
  var kind = require('../common/kind.cjs');
4
4
  var wrapValue = require('../common/wrapValue.cjs');
5
+ require('../common/globalStore.cjs');
6
+ require('../common/builder.cjs');
5
7
 
6
8
  const patternResultKind = kind.createKind("pattern-result");
7
9
  function result(value) {
@@ -1,5 +1,7 @@
1
1
  import { createKind } from '../common/kind.mjs';
2
2
  import { wrapValue } from '../common/wrapValue.mjs';
3
+ import '../common/globalStore.mjs';
4
+ import '../common/builder.mjs';
3
5
 
4
6
  const patternResultKind = createKind("pattern-result");
5
7
  function result(value) {
@@ -0,0 +1,7 @@
1
+ import { type IsEqual } from "../../common";
2
+ import { type Includes } from "../../string";
3
+ declare const SymbolErrorForbiddenString: unique symbol;
4
+ export type ForbiddenString<GenericValue extends string, GenericCharacters extends string> = IsEqual<(GenericCharacters extends string ? Includes<GenericValue, GenericCharacters> : never) | false, boolean> extends true ? {
5
+ [SymbolErrorForbiddenString]: `String "${GenericCharacters}" is forbidden in value.`;
6
+ } : GenericValue;
7
+ export {};
@@ -6,4 +6,4 @@ export * from "./startsWith";
6
6
  export * from "./normalizeForm";
7
7
  export * from "./split";
8
8
  export * from "./stringLength";
9
- export * from "./forbiddenCharacters";
9
+ export * from "./forbiddenString";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duplojs/utils",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "author": "mathcovax",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,5 +0,0 @@
1
- import { type IsEqual } from "../../common";
2
- import { type Includes } from "../../string";
3
- export type ForbiddenCharacters<GenericValue extends string, GenericCharacters extends string> = IsEqual<(GenericCharacters extends string ? Includes<GenericValue, GenericCharacters> : never) | false, boolean> extends true ? {
4
- error: `Characters "${GenericCharacters}" is forbidden.`;
5
- } : GenericValue;