@voiceflow/common 7.9.0 → 7.12.1

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 (189) hide show
  1. package/build/{constants → common/constants}/environment.d.ts +0 -0
  2. package/build/{constants → common/constants}/environment.js +0 -0
  3. package/build/common/constants/environment.js.map +1 -0
  4. package/build/{constants → common/constants}/index.d.ts +0 -0
  5. package/build/{constants → common/constants}/index.js +0 -0
  6. package/build/common/constants/index.js.map +1 -0
  7. package/build/{constants → common/constants}/intent.d.ts +0 -0
  8. package/build/{constants → common/constants}/intent.js +0 -0
  9. package/build/{constants → common/constants}/intent.js.map +1 -1
  10. package/build/{constants → common/constants}/regexp.d.ts +0 -0
  11. package/build/{constants → common/constants}/regexp.js +0 -0
  12. package/build/common/constants/regexp.js.map +1 -0
  13. package/build/{constants → common/constants}/slot.d.ts +0 -0
  14. package/build/{constants → common/constants}/slot.js +0 -0
  15. package/build/common/constants/slot.js.map +1 -0
  16. package/build/{crypto → common/crypto}/base64.d.ts +0 -0
  17. package/build/{crypto → common/crypto}/base64.js +0 -0
  18. package/build/common/crypto/base64.js.map +1 -0
  19. package/build/{crypto → common/crypto}/index.d.ts +0 -0
  20. package/build/{crypto → common/crypto}/index.js +0 -0
  21. package/build/common/crypto/index.js.map +1 -0
  22. package/build/{crypto → common/crypto}/synchronous.d.ts +0 -0
  23. package/build/{crypto → common/crypto}/synchronous.js +0 -0
  24. package/build/common/crypto/synchronous.js.map +1 -0
  25. package/build/{index.d.ts → common/index.d.ts} +0 -0
  26. package/build/{index.js → common/index.js} +0 -0
  27. package/build/common/index.js.map +1 -0
  28. package/build/{types.d.ts → common/types.d.ts} +0 -0
  29. package/build/{types.js → common/types.js} +0 -0
  30. package/build/common/types.js.map +1 -0
  31. package/build/{utils → common/utils}/array.d.ts +1 -0
  32. package/build/{utils → common/utils}/array.js +13 -1
  33. package/build/common/utils/array.js.map +1 -0
  34. package/build/{utils → common/utils}/emails.d.ts +0 -0
  35. package/build/{utils → common/utils}/emails.js +0 -0
  36. package/build/common/utils/emails.js.map +1 -0
  37. package/build/{utils → common/utils}/functional.d.ts +4 -4
  38. package/build/common/utils/functional.js +64 -0
  39. package/build/common/utils/functional.js.map +1 -0
  40. package/build/{utils → common/utils}/generate.d.ts +0 -0
  41. package/build/{utils → common/utils}/generate.js +0 -0
  42. package/build/common/utils/generate.js.map +1 -0
  43. package/build/{utils → common/utils}/id.d.ts +0 -0
  44. package/build/{utils → common/utils}/id.js +0 -0
  45. package/build/common/utils/id.js.map +1 -0
  46. package/build/{utils → common/utils}/index.d.ts +0 -0
  47. package/build/{utils → common/utils}/index.js +0 -0
  48. package/build/common/utils/index.js.map +1 -0
  49. package/build/{utils → common/utils}/intent.d.ts +0 -0
  50. package/build/{utils → common/utils}/intent.js +0 -0
  51. package/build/common/utils/intent.js.map +1 -0
  52. package/build/{utils → common/utils}/mathjs.d.ts +0 -0
  53. package/build/{utils → common/utils}/mathjs.js +0 -0
  54. package/build/common/utils/mathjs.js.map +1 -0
  55. package/build/{utils → common/utils}/normalized.d.ts +1 -0
  56. package/build/{utils → common/utils}/normalized.js +3 -1
  57. package/build/common/utils/normalized.js.map +1 -0
  58. package/build/{utils → common/utils}/number.d.ts +0 -0
  59. package/build/{utils → common/utils}/number.js +0 -0
  60. package/build/common/utils/number.js.map +1 -0
  61. package/build/{utils → common/utils}/object.d.ts +0 -0
  62. package/build/{utils → common/utils}/object.js +0 -0
  63. package/build/common/utils/object.js.map +1 -0
  64. package/build/{utils → common/utils}/promise.d.ts +0 -0
  65. package/build/{utils → common/utils}/promise.js +0 -0
  66. package/build/common/utils/promise.js.map +1 -0
  67. package/build/{utils → common/utils}/protocol.d.ts +0 -0
  68. package/build/{utils → common/utils}/protocol.js +0 -0
  69. package/build/common/utils/protocol.js.map +1 -0
  70. package/build/{utils → common/utils}/string.d.ts +0 -0
  71. package/build/{utils → common/utils}/string.js +0 -0
  72. package/build/common/utils/string.js.map +1 -0
  73. package/build/{utils → common/utils}/time.d.ts +0 -0
  74. package/build/{utils → common/utils}/time.js +0 -0
  75. package/build/common/utils/time.js.map +1 -0
  76. package/build/{utils → common/utils}/timezones.d.ts +0 -0
  77. package/build/{utils → common/utils}/timezones.js +0 -0
  78. package/build/common/utils/timezones.js.map +1 -0
  79. package/build/{utils → common/utils}/variables.d.ts +0 -0
  80. package/build/{utils → common/utils}/variables.js +0 -0
  81. package/build/common/utils/variables.js.map +1 -0
  82. package/build/esm/constants/environment.d.ts +9 -0
  83. package/build/esm/constants/environment.js +11 -0
  84. package/build/esm/constants/environment.js.map +1 -0
  85. package/build/esm/constants/index.d.ts +4 -0
  86. package/build/esm/constants/index.js +5 -0
  87. package/build/esm/constants/index.js.map +1 -0
  88. package/build/esm/constants/intent.d.ts +4 -0
  89. package/build/esm/constants/intent.js +2 -0
  90. package/build/esm/constants/intent.js.map +1 -0
  91. package/build/esm/constants/regexp.d.ts +10 -0
  92. package/build/esm/constants/regexp.js +16 -0
  93. package/build/esm/constants/regexp.js.map +1 -0
  94. package/build/esm/constants/slot.d.ts +9 -0
  95. package/build/esm/constants/slot.js +7 -0
  96. package/build/esm/constants/slot.js.map +1 -0
  97. package/build/esm/crypto/base64.d.ts +7 -0
  98. package/build/esm/crypto/base64.js +18 -0
  99. package/build/esm/crypto/base64.js.map +1 -0
  100. package/build/esm/crypto/index.d.ts +2 -0
  101. package/build/esm/crypto/index.js +3 -0
  102. package/build/esm/crypto/index.js.map +1 -0
  103. package/build/esm/crypto/synchronous.d.ts +16 -0
  104. package/build/esm/crypto/synchronous.js +39 -0
  105. package/build/esm/crypto/synchronous.js.map +1 -0
  106. package/build/esm/index.d.ts +5 -0
  107. package/build/esm/index.js +7 -0
  108. package/build/esm/index.js.map +1 -0
  109. package/build/esm/types.d.ts +29 -0
  110. package/build/esm/types.js +2 -0
  111. package/build/esm/types.js.map +1 -0
  112. package/build/esm/utils/array.d.ts +26 -0
  113. package/build/esm/utils/array.js +91 -0
  114. package/build/esm/utils/array.js.map +1 -0
  115. package/build/esm/utils/emails.d.ts +2 -0
  116. package/build/esm/utils/emails.js +4 -0
  117. package/build/esm/utils/emails.js.map +1 -0
  118. package/build/esm/utils/functional.d.ts +23 -0
  119. package/build/esm/utils/functional.js +52 -0
  120. package/build/esm/utils/functional.js.map +1 -0
  121. package/build/esm/utils/generate.d.ts +12 -0
  122. package/build/esm/utils/generate.js +31 -0
  123. package/build/esm/utils/generate.js.map +1 -0
  124. package/build/esm/utils/id.d.ts +3 -0
  125. package/build/esm/utils/id.js +5 -0
  126. package/build/esm/utils/id.js.map +1 -0
  127. package/build/esm/utils/index.d.ts +18 -0
  128. package/build/esm/utils/index.js +20 -0
  129. package/build/esm/utils/index.js.map +1 -0
  130. package/build/esm/utils/intent.d.ts +17 -0
  131. package/build/esm/utils/intent.js +34 -0
  132. package/build/esm/utils/intent.js.map +1 -0
  133. package/build/esm/utils/mathjs.d.ts +1 -0
  134. package/build/esm/utils/mathjs.js +59 -0
  135. package/build/esm/utils/mathjs.js.map +1 -0
  136. package/build/esm/utils/normalized.d.ts +46 -0
  137. package/build/esm/utils/normalized.js +71 -0
  138. package/build/esm/utils/normalized.js.map +1 -0
  139. package/build/esm/utils/number.d.ts +4 -0
  140. package/build/esm/utils/number.js +6 -0
  141. package/build/esm/utils/number.js.map +1 -0
  142. package/build/esm/utils/object.d.ts +8 -0
  143. package/build/esm/utils/object.js +77 -0
  144. package/build/esm/utils/object.js.map +1 -0
  145. package/build/esm/utils/promise.d.ts +8 -0
  146. package/build/esm/utils/promise.js +16 -0
  147. package/build/esm/utils/promise.js.map +1 -0
  148. package/build/esm/utils/protocol.d.ts +11 -0
  149. package/build/esm/utils/protocol.js +17 -0
  150. package/build/esm/utils/protocol.js.map +1 -0
  151. package/build/esm/utils/string.d.ts +6 -0
  152. package/build/esm/utils/string.js +11 -0
  153. package/build/esm/utils/string.js.map +1 -0
  154. package/build/esm/utils/time.d.ts +3 -0
  155. package/build/esm/utils/time.js +64 -0
  156. package/build/esm/utils/time.js.map +1 -0
  157. package/build/esm/utils/timezones.d.ts +1 -0
  158. package/build/esm/utils/timezones.js +2030 -0
  159. package/build/{utils → esm/utils}/timezones.js.map +1 -1
  160. package/build/esm/utils/variables.d.ts +7 -0
  161. package/build/esm/utils/variables.js +57 -0
  162. package/build/esm/utils/variables.js.map +1 -0
  163. package/package.json +8 -6
  164. package/build/constants/environment.js.map +0 -1
  165. package/build/constants/index.js.map +0 -1
  166. package/build/constants/regexp.js.map +0 -1
  167. package/build/constants/slot.js.map +0 -1
  168. package/build/crypto/base64.js.map +0 -1
  169. package/build/crypto/index.js.map +0 -1
  170. package/build/crypto/synchronous.js.map +0 -1
  171. package/build/index.js.map +0 -1
  172. package/build/types.js.map +0 -1
  173. package/build/utils/array.js.map +0 -1
  174. package/build/utils/emails.js.map +0 -1
  175. package/build/utils/functional.js +0 -32
  176. package/build/utils/functional.js.map +0 -1
  177. package/build/utils/generate.js.map +0 -1
  178. package/build/utils/id.js.map +0 -1
  179. package/build/utils/index.js.map +0 -1
  180. package/build/utils/intent.js.map +0 -1
  181. package/build/utils/mathjs.js.map +0 -1
  182. package/build/utils/normalized.js.map +0 -1
  183. package/build/utils/number.js.map +0 -1
  184. package/build/utils/object.js.map +0 -1
  185. package/build/utils/promise.js.map +0 -1
  186. package/build/utils/protocol.js.map +0 -1
  187. package/build/utils/string.js.map +0 -1
  188. package/build/utils/time.js.map +0 -1
  189. package/build/utils/variables.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regexp.js","sourceRoot":"","sources":["../../../src/constants/regexp.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC,MAAM,CAAC,MAAM,WAAW,GAAG,wCAAwC,CAAC;AAEpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AAExC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,eAAe,wBAAwB,CAAC;AAEhF,0EAA0E;AAC1E,qDAAqD;AACrD,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,qBAAqB,0GAA0G,CAAC;AAEzK,MAAM,CAAC,MAAM,sDAAsD,GAAG,GAAG,sBAAsB,QAAQ,CAAC;AAExG,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,sDAAsD,SAAS,CAAC;AAE1G,iGAAiG;AACjG,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,uBAAuB,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare type BuiltinSlot<T extends string, L extends string = string> = {
2
+ type: T;
3
+ label: string;
4
+ locales?: L[];
5
+ immutable?: boolean;
6
+ };
7
+ export declare const CUSTOM_SLOT_TYPE = "Custom";
8
+ export declare const LOWER_CASE_CUSTOM_SLOT_TYPE: string;
9
+ export declare const CustomSlot: BuiltinSlot<string>;
@@ -0,0 +1,7 @@
1
+ export const CUSTOM_SLOT_TYPE = 'Custom';
2
+ export const LOWER_CASE_CUSTOM_SLOT_TYPE = CUSTOM_SLOT_TYPE.toLowerCase();
3
+ export const CustomSlot = {
4
+ type: CUSTOM_SLOT_TYPE,
5
+ label: CUSTOM_SLOT_TYPE,
6
+ };
7
+ //# sourceMappingURL=slot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../../src/constants/slot.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AACzC,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;AAE1E,MAAM,CAAC,MAAM,UAAU,GAAwB;IAC7C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,gBAAgB;CACxB,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare class Base64 {
2
+ static encode(data: string): string;
3
+ static encodeJSON(data: unknown): string;
4
+ static decode(data: string): string;
5
+ static decodeJSON<T>(data?: string): T;
6
+ }
7
+ export default Base64;
@@ -0,0 +1,18 @@
1
+ import CryptoBase64 from 'crypto-js/enc-base64';
2
+ import Utf8 from 'crypto-js/enc-utf8';
3
+ class Base64 {
4
+ static encode(data) {
5
+ return CryptoBase64.stringify(Utf8.parse(data));
6
+ }
7
+ static encodeJSON(data) {
8
+ return Base64.encode(JSON.stringify(data));
9
+ }
10
+ static decode(data) {
11
+ return Utf8.stringify(CryptoBase64.parse(data));
12
+ }
13
+ static decodeJSON(data) {
14
+ return data ? JSON.parse(Base64.decode(data)) : '';
15
+ }
16
+ }
17
+ export default Base64;
18
+ //# sourceMappingURL=base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../src/crypto/base64.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,MAAM,MAAM;IACH,MAAM,CAAC,MAAM,CAAC,IAAY;QAC/B,OAAO,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,IAAa;QACpC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,IAAY;QAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IAEM,MAAM,CAAC,UAAU,CAAI,IAAa;QACvC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrD,CAAC;CACF;AAED,eAAe,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as Base64 } from './base64';
2
+ export { default as Synchronous } from './synchronous';
@@ -0,0 +1,3 @@
1
+ export { default as Base64 } from './base64';
2
+ export { default as Synchronous } from './synchronous';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="crypto-js" />
2
+ import type CipherHelper from 'crypto-js/aes';
3
+ interface SynchronousOptions {
4
+ alg: typeof CipherHelper;
5
+ key: string;
6
+ }
7
+ declare class Synchronous {
8
+ #private;
9
+ constructor({ alg, key }: SynchronousOptions);
10
+ protected getKey(): string;
11
+ encrypt(data: string, key?: string): string;
12
+ encryptJSON(data: unknown): string;
13
+ decrypt(data: string, key?: string): string;
14
+ decryptJSON<T>(data: string): T;
15
+ }
16
+ export default Synchronous;
@@ -0,0 +1,39 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _Synchronous_alg, _Synchronous_key;
13
+ import Utf8 from 'crypto-js/enc-utf8';
14
+ class Synchronous {
15
+ constructor({ alg, key }) {
16
+ _Synchronous_alg.set(this, void 0);
17
+ _Synchronous_key.set(this, void 0);
18
+ __classPrivateFieldSet(this, _Synchronous_alg, alg, "f");
19
+ __classPrivateFieldSet(this, _Synchronous_key, key, "f");
20
+ }
21
+ getKey() {
22
+ return __classPrivateFieldGet(this, _Synchronous_key, "f");
23
+ }
24
+ encrypt(data, key = __classPrivateFieldGet(this, _Synchronous_key, "f")) {
25
+ return __classPrivateFieldGet(this, _Synchronous_alg, "f").encrypt(data, key).toString();
26
+ }
27
+ encryptJSON(data) {
28
+ return this.encrypt(JSON.stringify(data));
29
+ }
30
+ decrypt(data, key = __classPrivateFieldGet(this, _Synchronous_key, "f")) {
31
+ return __classPrivateFieldGet(this, _Synchronous_alg, "f").decrypt(data, key).toString(Utf8);
32
+ }
33
+ decryptJSON(data) {
34
+ return JSON.parse(this.decrypt(data));
35
+ }
36
+ }
37
+ _Synchronous_alg = new WeakMap(), _Synchronous_key = new WeakMap();
38
+ export default Synchronous;
39
+ //# sourceMappingURL=synchronous.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"synchronous.js","sourceRoot":"","sources":["../../../src/crypto/synchronous.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAOtC,MAAM,WAAW;IAKf,YAAY,EAAE,GAAG,EAAE,GAAG,EAAsB;QAJ5C,mCAA0B;QAE1B,mCAAa;QAGX,uBAAA,IAAI,oBAAQ,GAAG,MAAA,CAAC;QAChB,uBAAA,IAAI,oBAAQ,GAAG,MAAA,CAAC;IAClB,CAAC;IAES,MAAM;QACd,OAAO,uBAAA,IAAI,wBAAK,CAAC;IACnB,CAAC;IAEM,OAAO,CAAC,IAAY,EAAE,MAAc,uBAAA,IAAI,wBAAK;QAClD,OAAO,uBAAA,IAAI,wBAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IACjD,CAAC;IAEM,WAAW,CAAC,IAAa;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,CAAC;IAEM,OAAO,CAAC,IAAY,EAAE,GAAG,GAAG,uBAAA,IAAI,wBAAK;QAC1C,OAAO,uBAAA,IAAI,wBAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAEM,WAAW,CAAI,IAAY;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;CACF;;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './constants';
2
+ export * as Crypto from './crypto';
3
+ export * from './types';
4
+ export * as Utils from './utils';
5
+ export * from './utils';
@@ -0,0 +1,7 @@
1
+ export * from './constants';
2
+ export * as Crypto from './crypto';
3
+ export * from './types';
4
+ export * as Utils from './utils';
5
+ // TODO: Remove this export once we migrate all utils in other repos.
6
+ export * from './utils';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,qEAAqE;AACrE,cAAc,SAAS,CAAC"}
@@ -0,0 +1,29 @@
1
+ export declare type Nullable<T> = T | null;
2
+ export declare type Nullish<T = unknown> = Nullable<T> | undefined;
3
+ export declare type Function<A extends any[] = any[], R = any> = (...args: A) => R;
4
+ export declare type AnyFunction = Function<any[], any>;
5
+ export declare type Callback = Function<[], Eventual<void>>;
6
+ export declare type Eventual<T> = Promise<T> | T;
7
+ export declare type StringifyEnum<T extends string> = T | `${T}`;
8
+ export declare type NormalizedValue<T> = T extends Normalized<infer R> ? R : never;
9
+ export interface Normalized<T> {
10
+ byKey: Record<string, T>;
11
+ allKeys: string[];
12
+ }
13
+ export declare type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
14
+ export declare type WithRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
15
+ export declare type Writeable<T> = {
16
+ -readonly [P in keyof T]: T[P];
17
+ };
18
+ export declare type NullableRecord<T extends object> = {
19
+ [K in keyof T]: Nullable<T[K]>;
20
+ };
21
+ export declare type NonNullishRecord<T extends object> = Required<{
22
+ [K in keyof T]: NonNullable<T[K]>;
23
+ }>;
24
+ export declare type Struct = Record<string, unknown>;
25
+ /**
26
+ * An object with no keys or values.
27
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
28
+ */
29
+ export declare type EmptyObject = Record<never, never>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ export declare const unique: <T>(items: T[]) => T[];
2
+ export declare const without: <T>(items: T[], index: number) => T[];
3
+ export declare const withoutValue: <T>(items: T[], value: T) => T[];
4
+ export declare const withoutValues: <T>(items: T[], values: T[]) => T[];
5
+ export declare const replace: <T>(items: T[], index: number, item: T) => T[];
6
+ export declare const insert: <T>(items: T[], index: number, item: T) => T[];
7
+ export declare const insertAll: <T>(items: T[], index: number, additionalItems: T[]) => T[];
8
+ export declare const append: <T>(items: T[], item: T) => T[];
9
+ export declare const toggleMembership: <T>(items: T[], item: T) => T[];
10
+ export declare const head: <T>(items: T[]) => [T, T[]];
11
+ export declare const tail: <T>(items: T[]) => [T[], T];
12
+ export declare const reorder: <T>(items: T[], fromIndex: number, toIndex: number) => T[];
13
+ export declare const separate: <T>(items: T[], predicate: (item: T, index: number) => boolean) => [T[], T[]];
14
+ export declare const findUnion: <T>(lhs: T[], rhs: T[]) => {
15
+ rhsOnly: T[];
16
+ lhsOnly: T[];
17
+ union: T[];
18
+ };
19
+ export declare const diff: <T>(lhs: T[], rhs: T[]) => T[];
20
+ export declare const hasIdenticalMembers: <T>(lhs: T[], rhs: T[]) => boolean;
21
+ export declare const asyncForEach: <T>(array: T[], callback: (item: T, index: number, array: T[]) => Promise<void>) => Promise<void>;
22
+ export declare const isNullish: (value: unknown) => value is unknown;
23
+ export declare const isNotNullish: <T>(value: T) => value is NonNullable<T>;
24
+ /** @deprecated Use `array.filter(isNotNullish)` instead. */
25
+ export declare const filterOutNullish: <T>(items: readonly T[]) => NonNullable<T>[];
26
+ export declare const filterAndGetLastRemovedValue: <T>(list: T[], filterFunc: (item: T) => boolean) => [T[], T | null];
@@ -0,0 +1,91 @@
1
+ export const unique = (items) => Array.from(new Set(items));
2
+ export const without = (items, index) => (index < 0 ? items : [...items.slice(0, index), ...items.slice(index + 1)]);
3
+ export const withoutValue = (items, value) => without(items, items.indexOf(value));
4
+ export const withoutValues = (items, values) => items.filter((item) => !values.includes(item));
5
+ export const replace = (items, index, item) => index < 0 ? items : [...items.slice(0, index), item, ...items.slice(index + 1)];
6
+ export const insert = (items, index, item) => index < 0 ? [item, ...items] : [...items.slice(0, index), item, ...items.slice(index)];
7
+ export const insertAll = (items, index, additionalItems) => index < 0 ? [...additionalItems, ...items] : [...items.slice(0, index), ...additionalItems, ...items.slice(index)];
8
+ export const append = (items, item) => (items.includes(item) ? items : [...items, item]);
9
+ export const toggleMembership = (items, item) => (items.includes(item) ? withoutValue(items, item) : [...items, item]);
10
+ export const head = (items) => {
11
+ const [first, ...rest] = items;
12
+ return [first, rest];
13
+ };
14
+ export const tail = (items) => {
15
+ const last = items[items.length - 1];
16
+ const rest = items.slice(0, -1);
17
+ return [rest, last];
18
+ };
19
+ export const reorder = (items, fromIndex, toIndex) => {
20
+ if (fromIndex < 0 || fromIndex >= items.length) {
21
+ return items;
22
+ }
23
+ if (toIndex < 0) {
24
+ return [items[fromIndex], ...without(items, fromIndex)];
25
+ }
26
+ if (toIndex >= items.length) {
27
+ return [...without(items, fromIndex), items[fromIndex]];
28
+ }
29
+ return insert(without(items, fromIndex), toIndex, items[fromIndex]);
30
+ };
31
+ export const separate = (items, predicate) => items.reduce(([passAcc, failAcc], item, index) => {
32
+ if (predicate(item, index)) {
33
+ passAcc.push(item);
34
+ }
35
+ else {
36
+ failAcc.push(item);
37
+ }
38
+ return [passAcc, failAcc];
39
+ }, [[], []]);
40
+ export const findUnion = (lhs, rhs) => {
41
+ const unique = new Set([...lhs, ...rhs]);
42
+ return Array.from(unique).reduce((acc, item) => {
43
+ if (lhs.includes(item)) {
44
+ if (rhs.includes(item)) {
45
+ acc.union.push(item);
46
+ }
47
+ else {
48
+ acc.lhsOnly.push(item);
49
+ }
50
+ }
51
+ else {
52
+ acc.rhsOnly.push(item);
53
+ }
54
+ return acc;
55
+ }, { rhsOnly: [], lhsOnly: [], union: [] });
56
+ };
57
+ export const diff = (lhs, rhs) => {
58
+ const { lhsOnly, rhsOnly } = findUnion(lhs, rhs);
59
+ return [...lhsOnly, ...rhsOnly];
60
+ };
61
+ export const hasIdenticalMembers = (lhs, rhs) => {
62
+ if (lhs.length !== rhs.length) {
63
+ return false;
64
+ }
65
+ if (!lhs.length && !rhs.length) {
66
+ return true;
67
+ }
68
+ return !lhs.some((value) => !rhs.includes(value));
69
+ };
70
+ export const asyncForEach = async (array, callback) => {
71
+ for (let index = 0; index < array.length; index++) {
72
+ // eslint-disable-next-line callback-return,no-await-in-loop
73
+ await callback(array[index], index, array);
74
+ }
75
+ };
76
+ export const isNullish = (value) => value === null || value === undefined;
77
+ export const isNotNullish = (value) => value !== null && value !== undefined;
78
+ /** @deprecated Use `array.filter(isNotNullish)` instead. */
79
+ export const filterOutNullish = (items) => items.filter(isNotNullish);
80
+ // mostly just saves us needing to traverse an array twice
81
+ export const filterAndGetLastRemovedValue = (list, filterFunc) => {
82
+ let lastItem = null;
83
+ const filteredList = list.filter((a) => {
84
+ if (filterFunc(a))
85
+ return true;
86
+ lastItem = a;
87
+ return false;
88
+ });
89
+ return [filteredList, lastItem];
90
+ };
91
+ //# sourceMappingURL=array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/utils/array.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,KAAU,EAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAEzE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAU,EAAE,KAAa,EAAO,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1I,MAAM,CAAC,MAAM,YAAY,GAAG,CAAI,KAAU,EAAE,KAAQ,EAAO,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,KAAU,EAAE,MAAW,EAAO,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAU,EAAE,KAAa,EAAE,IAAO,EAAO,EA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AAC,CAAC;AAE9G,0DAA0D;AAC1D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAI,IAAS,EAAE,UAAgC,EAAmB,EAAE;IAC9G,IAAI,QAAQ,GAAa,IAAI,CAAC;IAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACrC,IAAI,UAAU,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAC/B,QAAQ,GAAG,CAAC,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const isValidEmail: (email: string) => boolean;
2
+ export declare const getEmailDomain: (email: string) => string;
@@ -0,0 +1,4 @@
1
+ const FORMAT = /^\w+(['+-.]\w+)*@\w+([.-]\w+)*\.\w+([.-]\w+)*$/;
2
+ export const isValidEmail = (email) => !!email.match(FORMAT);
3
+ export const getEmailDomain = (email) => email.substring(email.lastIndexOf('@') + 1);
4
+ //# sourceMappingURL=emails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.js","sourceRoot":"","sources":["../../../src/utils/emails.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,gDAAgD,CAAC;AAEhE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Nullish } from '../types';
2
+ export declare type Transform<T = any, R = T> = (value: T) => R;
3
+ export interface Compose {
4
+ <R, T1>(t0: Transform<T1, R>): (value: T1) => R;
5
+ <R, T1, T2>(t0: Transform<T1, T2>, t1: Transform<T2, R>): (value: T1) => R;
6
+ <R, T1, T2, T3>(t0: Transform<T1, T2>, t1: Transform<T2, T3>, t2: Transform<T3, R>): (value: T1) => R;
7
+ <R, T1, T2, T3, T4>(t0: Transform<T1, T2>, t1: Transform<T2, T3>, t2: Transform<T3, T4>, t3: Transform<T4, R>): (value: T1) => R;
8
+ <R, T1, T2, T3, T4, T5>(t0: Transform<T1, T2>, t1: Transform<T2, T3>, t2: Transform<T3, T4>, t3: Transform<T4, T5>, t4: Transform<T5, R>): (value: T1) => R;
9
+ <R, T1, T2, T3, T4, T5, T6>(t0: Transform<T1, T2>, t1: Transform<T2, T3>, t2: Transform<T3, T4>, t3: Transform<T4, T5>, t4: Transform<T5, T6>, t5: Transform<T6, R>): (value: T1) => R;
10
+ (...transforms: Transform[]): <T extends object>(value: T) => T;
11
+ }
12
+ export declare const compose: Compose;
13
+ export declare type VoidFunction = () => void;
14
+ export declare const noop: VoidFunction;
15
+ export declare const identity: <T>(value: T) => T;
16
+ export declare const stringify: (value: any) => string;
17
+ declare type ChainCallback<A extends any[]> = (...args: A) => void;
18
+ export declare const chain: <A extends any[]>(fns_0: Nullish<ChainCallback<A>>, ...fns_1: Nullish<ChainCallback<A>>[]) => (...args: A) => void;
19
+ export declare const chainVoid: (fns_0: Nullish<VoidFunction>, ...fns_1: Nullish<VoidFunction>[]) => () => void;
20
+ export declare const chainAsync: <A extends any[]>(fns_0: Nullish<ChainCallback<A>>, ...fns_1: Nullish<ChainCallback<A>>[]) => (...args: A) => Promise<void>;
21
+ export declare const chainVoidAsync: (fns_0: Nullish<VoidFunction>, ...fns_1: Nullish<VoidFunction>[]) => () => Promise<void>;
22
+ export declare const withEffect: <T>(callback: (value: T) => void) => (value: T) => T;
23
+ export {};
@@ -0,0 +1,52 @@
1
+ export const compose = (...transforms) => (value) => {
2
+ if (transforms.length === 1) {
3
+ return transforms[0](value);
4
+ }
5
+ if (transforms.length === 2) {
6
+ return transforms[0](transforms[1](value));
7
+ }
8
+ return transforms.reduceRight((acc, transform) => transform(acc), value);
9
+ };
10
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
11
+ export const noop = () => { };
12
+ export const identity = (value) => value;
13
+ export const stringify = (value) => (typeof value === 'string' ? value : String(value));
14
+ export const chain = (...fns) => (...args) => {
15
+ var _a, _b, _c;
16
+ // perf optimization, most of the time we have one or two functions
17
+ if (fns.length === 1) {
18
+ (_a = fns[0]) === null || _a === void 0 ? void 0 : _a.call(fns, ...args);
19
+ }
20
+ else if (fns.length === 2) {
21
+ (_b = fns[0]) === null || _b === void 0 ? void 0 : _b.call(fns, ...args);
22
+ (_c = fns[1]) === null || _c === void 0 ? void 0 : _c.call(fns, ...args);
23
+ }
24
+ else {
25
+ fns.forEach((fn) => fn === null || fn === void 0 ? void 0 : fn(...args));
26
+ }
27
+ };
28
+ export const chainVoid = (...fns) => () => chain(...fns)();
29
+ export const chainAsync = (...fns) => async (...args) => {
30
+ var _a, _b, _c;
31
+ // perf optimization, most of the time we have one or two functions
32
+ if (fns.length === 1) {
33
+ await ((_a = fns[0]) === null || _a === void 0 ? void 0 : _a.call(fns, ...args));
34
+ }
35
+ else if (fns.length === 2) {
36
+ await ((_b = fns[0]) === null || _b === void 0 ? void 0 : _b.call(fns, ...args));
37
+ await ((_c = fns[1]) === null || _c === void 0 ? void 0 : _c.call(fns, ...args));
38
+ }
39
+ else {
40
+ // eslint-disable-next-line no-restricted-syntax
41
+ for (const fn of fns) {
42
+ // eslint-disable-next-line no-await-in-loop
43
+ await (fn === null || fn === void 0 ? void 0 : fn(...args));
44
+ }
45
+ }
46
+ };
47
+ export const chainVoidAsync = (...fns) => () => chainAsync(...fns)();
48
+ export const withEffect = (callback) => (value) => {
49
+ callback(value);
50
+ return value;
51
+ };
52
+ //# sourceMappingURL=functional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functional.js","sourceRoot":"","sources":["../../../src/utils/functional.ts"],"names":[],"m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C,EAAE,CAAC;AAEzB,MAAM,CAAC,MAAM,UAAU,GACrB,CAAI,QAA4B,EAAE,EAAE,CACpC,CAAC,KAAQ,EAAK,EAAE;IACd,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const generateHash: (object: unknown) => string;
2
+ interface Generate {
3
+ hash: (object: unknown) => string;
4
+ oneOf: <T>(options: T[]) => T;
5
+ number: (min?: number, max?: number) => number;
6
+ id: (slug?: boolean) => string;
7
+ string: (length?: number) => string;
8
+ object: <T = string>(entryCount?: number, factory?: () => T) => Record<string, T>;
9
+ array: <T = string>(length?: number, factory?: () => T) => T[];
10
+ }
11
+ export declare const generate: Generate;
12
+ export {};
@@ -0,0 +1,31 @@
1
+ import { cuid } from './id';
2
+ const CHARACTERS = Array.from({ length: 26 }).map((_, index) => String.fromCharCode(97 + index));
3
+ export const generateHash = (object) => {
4
+ const objectStr = typeof object === 'object' ? JSON.stringify(object) : String(object);
5
+ if (objectStr.length === 0) {
6
+ return '';
7
+ }
8
+ let hash = 0;
9
+ for (let i = 0; i < objectStr.length; i++) {
10
+ const chr = objectStr.charCodeAt(i);
11
+ // eslint-disable-next-line no-bitwise
12
+ hash = (hash << 5) - hash + chr;
13
+ // eslint-disable-next-line no-bitwise
14
+ hash |= 0; // Convert to 32bit integer
15
+ }
16
+ return Math.abs(hash).toString();
17
+ };
18
+ export const generate = {
19
+ hash: generateHash,
20
+ oneOf: (options) => options[generate.number(0, options.length - 1)],
21
+ number: (min = 0, max = 100) => min + Math.floor(Math.random() * (max - min)),
22
+ id: (slug = true) => (slug ? cuid.slug() : cuid()),
23
+ string: (length = 10) => Array.from({ length })
24
+ .map(() => generate.oneOf(CHARACTERS))
25
+ .join(''),
26
+ object: (entryCount = 3, factory = generate.string) => Array.from({ length: entryCount })
27
+ .map(() => [generate.string(), factory()])
28
+ .reduce((acc, [key, value]) => Object.assign(acc, { [key]: value }), {}),
29
+ array: (length = 3, factory = generate.string) => Array.from({ length }).map(() => factory()),
30
+ };
31
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/utils/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAU,EAAE;IACtD,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEvF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,OAAO,EAAE,CAAC;KACX;IAED,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACpC,sCAAsC;QACtC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC;QAChC,sCAAsC;QACtC,IAAI,IAAI,CAAC,CAAC,CAAC,2BAA2B;KACvC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC,CAAC;AAkBF,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,IAAI,EAAE,YAAY;IA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,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;CAC3G,CAAC"}
@@ -0,0 +1,3 @@
1
+ import cuid from 'cuid';
2
+ export { cuid };
3
+ export declare const objectID: () => string;
@@ -0,0 +1,5 @@
1
+ import ObjectId from 'bson-objectid';
2
+ import cuid from 'cuid';
3
+ export { cuid };
4
+ export const objectID = () => new ObjectId().toHexString();
5
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../src/utils/id.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAW,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ export * as array from './array';
2
+ export * as emails from './emails';
3
+ export * as functional from './functional';
4
+ export { generate, generateHash } from './generate';
5
+ export * as id from './id';
6
+ export * as intent from './intent';
7
+ export * as mathjs from './mathjs';
8
+ export * as normalized from './normalized';
9
+ export * as number from './number';
10
+ export * as object from './object';
11
+ export * as promise from './promise';
12
+ export * as protocol from './protocol';
13
+ export * as string from './string';
14
+ export * as time from './time';
15
+ export * as timezones from './timezones';
16
+ export * as variables from './variables';
17
+ export * from './intent';
18
+ export * from './variables';
@@ -0,0 +1,20 @@
1
+ export * as array from './array';
2
+ export * as emails from './emails';
3
+ export * as functional from './functional';
4
+ export { generate, generateHash } from './generate';
5
+ export * as id from './id';
6
+ export * as intent from './intent';
7
+ export * as mathjs from './mathjs';
8
+ export * as normalized from './normalized';
9
+ export * as number from './number';
10
+ export * as object from './object';
11
+ export * as promise from './promise';
12
+ export * as protocol from './protocol';
13
+ export * as string from './string';
14
+ export * as time from './time';
15
+ export * as timezones from './timezones';
16
+ export * as variables from './variables';
17
+ // TODO: Remove these exports once we migrate all utils in other repos.
18
+ export * from './intent';
19
+ export * from './variables';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,uEAAuE;AACvE,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { BuiltinSlot } from "../constants";
2
+ export declare const formatIntentName: (name: string) => string;
3
+ export declare const getUtterancesWithSlotNames: ({ slots, utterances, }: {
4
+ slots?: {
5
+ key: string;
6
+ name: string;
7
+ }[] | undefined;
8
+ utterances?: {
9
+ text: string;
10
+ }[] | undefined;
11
+ }) => string[];
12
+ export declare const getSlotType: (slots: BuiltinSlot<string, string>[], slot: {
13
+ name: string;
14
+ type: {
15
+ value?: string;
16
+ };
17
+ }) => string;
@@ -0,0 +1,34 @@
1
+ import { LOWER_CASE_CUSTOM_SLOT_TYPE, SLOT_REGEXP, SPACE_REGEXP } from "../constants";
2
+ export const formatIntentName = (name) => {
3
+ if (!name) {
4
+ return name;
5
+ }
6
+ let formattedName = '';
7
+ // replace white spaces with underscores
8
+ formattedName = name.replace(SPACE_REGEXP, '_');
9
+ // replace numbers with equivalent capital letter. Ex: 0 = A, 1 = B
10
+ formattedName = formattedName.replace(/\d/g, (digit) => String.fromCharCode(parseInt(digit, 10) + 65));
11
+ return formattedName;
12
+ };
13
+ export const getUtterancesWithSlotNames = ({ slots = [], utterances = [], }) => utterances
14
+ .filter((utterance) => { var _a; return !!((_a = utterance.text) === null || _a === void 0 ? void 0 : _a.trim()); })
15
+ .map(({ text }) => text.replace(SLOT_REGEXP, (substring, _name, key) => {
16
+ const slot = slots.find((_slot) => _slot.key === key);
17
+ return (slot === null || slot === void 0 ? void 0 : slot.name) ? `{${slot.name}}` : substring;
18
+ }));
19
+ export const getSlotType = (slots, slot) => {
20
+ var _a, _b;
21
+ let type = slot.name;
22
+ const lowerCaseType = (_b = (_a = slot.type.value) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
23
+ if (!!slot.type.value && lowerCaseType !== LOWER_CASE_CUSTOM_SLOT_TYPE) {
24
+ const builtinSlot = slots.find((_slot) => _slot.label.toLowerCase() === lowerCaseType);
25
+ if (!builtinSlot) {
26
+ type = slot.type.value; // Platform specific slot
27
+ }
28
+ else {
29
+ ({ type } = builtinSlot);
30
+ }
31
+ }
32
+ return type;
33
+ };
34
+ //# sourceMappingURL=intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../src/utils/intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,2BAA2B,EAAE,WAAW,EAAE,YAAY,EAAE,qBAAoB;AAElG,MA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