@takeshape/util 11.45.5 → 11.46.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.
Files changed (242) hide show
  1. package/dist/cjs/common/arrays.js +42 -0
  2. package/dist/cjs/common/assert.js +9 -0
  3. package/dist/cjs/common/async-noop.js +5 -0
  4. package/dist/cjs/common/billing.js +35 -0
  5. package/dist/cjs/common/clone.js +76 -0
  6. package/dist/cjs/common/delay.js +28 -0
  7. package/dist/cjs/common/draftjs-templates.js +131 -0
  8. package/dist/cjs/common/draftjs.js +807 -0
  9. package/dist/cjs/common/get-image-url.js +8 -0
  10. package/dist/cjs/common/highlight-code.js +33 -0
  11. package/dist/cjs/common/http.js +19 -0
  12. package/dist/cjs/common/index.js +50 -0
  13. package/dist/cjs/common/map.js +7 -0
  14. package/dist/cjs/common/memoize.js +13 -0
  15. package/dist/cjs/common/merge.js +64 -0
  16. package/dist/cjs/common/mime.js +68 -0
  17. package/dist/cjs/common/names.js +13 -0
  18. package/dist/cjs/common/naming.js +65 -0
  19. package/dist/cjs/common/path-to-string.js +10 -0
  20. package/dist/cjs/common/persisted-queries.js +4 -0
  21. package/dist/cjs/common/predicate.js +15 -0
  22. package/dist/cjs/common/set-in.js +13 -0
  23. package/dist/cjs/common/sets.js +19 -0
  24. package/dist/cjs/common/sleep.js +9 -0
  25. package/dist/cjs/common/sort-object.js +16 -0
  26. package/dist/cjs/common/strings.js +74 -0
  27. package/dist/cjs/common/templates.js +109 -0
  28. package/dist/cjs/common/timezone.js +606 -0
  29. package/dist/cjs/common/tracing.js +2 -0
  30. package/dist/cjs/common/types.js +63 -0
  31. package/dist/cjs/common/unix-to-iso.js +15 -0
  32. package/dist/cjs/common/urls.js +9 -0
  33. package/dist/cjs/common/validation.js +5 -0
  34. package/dist/cjs/common/value.js +8 -0
  35. package/dist/cjs/common/visit.js +60 -0
  36. package/dist/cjs/node/encryption.js +31 -0
  37. package/dist/cjs/node/gzip.js +10 -0
  38. package/dist/cjs/node/index.js +19 -0
  39. package/dist/cjs/node/search-params.js +23 -0
  40. package/dist/cjs/package.json +1 -0
  41. package/dist/esm/common/arrays.js +33 -0
  42. package/dist/esm/common/assert.js +5 -0
  43. package/dist/esm/common/async-noop.js +2 -0
  44. package/dist/esm/common/billing.js +29 -0
  45. package/dist/esm/common/clone.js +71 -0
  46. package/dist/esm/common/delay.js +22 -0
  47. package/dist/esm/common/draftjs-templates.js +122 -0
  48. package/dist/esm/common/draftjs.js +792 -0
  49. package/{es → dist/esm/common}/get-image-url.js +2 -7
  50. package/dist/esm/common/highlight-code.js +26 -0
  51. package/dist/esm/common/http.js +15 -0
  52. package/dist/esm/common/index.js +34 -0
  53. package/{es → dist/esm/common}/map.js +2 -2
  54. package/dist/esm/common/memoize.js +6 -0
  55. package/dist/esm/common/merge.js +54 -0
  56. package/dist/esm/common/mime.js +60 -0
  57. package/dist/esm/common/names.js +9 -0
  58. package/dist/esm/common/naming.js +54 -0
  59. package/dist/esm/common/path-to-string.js +6 -0
  60. package/{es → dist/esm/common}/persisted-queries.js +1 -1
  61. package/{es → dist/esm/common}/predicate.js +4 -4
  62. package/dist/esm/common/set-in.js +7 -0
  63. package/dist/esm/common/sets.js +14 -0
  64. package/dist/esm/common/sleep.js +5 -0
  65. package/dist/esm/common/sort-object.js +12 -0
  66. package/dist/esm/common/strings.js +60 -0
  67. package/dist/esm/common/templates.js +95 -0
  68. package/dist/esm/common/timezone.js +602 -0
  69. package/dist/esm/common/tracing.js +1 -0
  70. package/dist/esm/common/types.js +50 -0
  71. package/dist/esm/common/unix-to-iso.js +9 -0
  72. package/dist/esm/common/urls.js +5 -0
  73. package/dist/esm/common/validation.js +2 -0
  74. package/dist/esm/common/value.js +4 -0
  75. package/dist/esm/common/visit.js +52 -0
  76. package/dist/esm/node/encryption.js +25 -0
  77. package/dist/esm/node/gzip.js +4 -0
  78. package/dist/esm/node/index.js +3 -0
  79. package/dist/esm/node/search-params.js +17 -0
  80. package/dist/esm/package.json +1 -0
  81. package/dist/tsconfig.types.tsbuildinfo +1 -0
  82. package/dist/{arrays.d.ts → types/common/arrays.d.ts} +0 -1
  83. package/dist/{assert.d.ts → types/common/assert.d.ts} +0 -1
  84. package/dist/{async-noop.d.ts → types/common/async-noop.d.ts} +0 -1
  85. package/dist/types/common/billing.d.ts +365 -0
  86. package/dist/{clone.d.ts → types/common/clone.d.ts} +0 -1
  87. package/dist/{delay.d.ts → types/common/delay.d.ts} +0 -1
  88. package/dist/{draftjs-templates.d.ts → types/common/draftjs-templates.d.ts} +1 -2
  89. package/dist/{draftjs.d.ts → types/common/draftjs.d.ts} +1 -2
  90. package/dist/{get-image-url.d.ts → types/common/get-image-url.d.ts} +0 -1
  91. package/dist/types/common/highlight-code.d.ts +14 -0
  92. package/dist/{http.d.ts → types/common/http.d.ts} +0 -1
  93. package/dist/types/common/index.d.ts +34 -0
  94. package/dist/{map.d.ts → types/common/map.d.ts} +0 -1
  95. package/dist/{memoize.d.ts → types/common/memoize.d.ts} +0 -1
  96. package/dist/{merge.d.ts → types/common/merge.d.ts} +0 -1
  97. package/dist/{mime.d.ts → types/common/mime.d.ts} +0 -1
  98. package/dist/{names.d.ts → types/common/names.d.ts} +0 -1
  99. package/dist/{naming.d.ts → types/common/naming.d.ts} +0 -1
  100. package/dist/{path-to-string.d.ts → types/common/path-to-string.d.ts} +0 -1
  101. package/dist/{persisted-queries.d.ts → types/common/persisted-queries.d.ts} +0 -1
  102. package/dist/{predicate.d.ts → types/common/predicate.d.ts} +0 -1
  103. package/dist/{set-in.d.ts → types/common/set-in.d.ts} +0 -1
  104. package/dist/{sets.d.ts → types/common/sets.d.ts} +0 -1
  105. package/dist/{sleep.d.ts → types/common/sleep.d.ts} +0 -1
  106. package/dist/{sort-object.d.ts → types/common/sort-object.d.ts} +0 -1
  107. package/dist/{strings.d.ts → types/common/strings.d.ts} +1 -2
  108. package/dist/{templates.d.ts → types/common/templates.d.ts} +1 -2
  109. package/dist/{timezone.d.ts → types/common/timezone.d.ts} +0 -1
  110. package/dist/{tracing.d.ts → types/common/tracing.d.ts} +1 -2
  111. package/dist/{types.d.ts → types/common/types.d.ts} +0 -1
  112. package/dist/{unix-to-iso.d.ts → types/common/unix-to-iso.d.ts} +0 -1
  113. package/dist/{urls.d.ts → types/common/urls.d.ts} +0 -1
  114. package/dist/{validation.d.ts → types/common/validation.d.ts} +0 -1
  115. package/dist/{value.d.ts → types/common/value.d.ts} +0 -1
  116. package/dist/{visit.d.ts → types/common/visit.d.ts} +0 -1
  117. package/dist/{encryption.d.ts → types/node/encryption.d.ts} +0 -1
  118. package/dist/{gzip.d.ts → types/node/gzip.d.ts} +1 -2
  119. package/dist/types/node/index.d.ts +3 -0
  120. package/dist/{search-params.d.ts → types/node/search-params.d.ts} +1 -2
  121. package/package.json +33 -21
  122. package/dist/arrays.d.ts.map +0 -1
  123. package/dist/arrays.js +0 -44
  124. package/dist/assert.d.ts.map +0 -1
  125. package/dist/assert.js +0 -11
  126. package/dist/async-noop.d.ts.map +0 -1
  127. package/dist/async-noop.js +0 -8
  128. package/dist/billing.d.ts +0 -366
  129. package/dist/billing.d.ts.map +0 -1
  130. package/dist/billing.js +0 -48
  131. package/dist/browser.d.ts +0 -2
  132. package/dist/browser.d.ts.map +0 -1
  133. package/dist/browser.js +0 -16
  134. package/dist/clone.d.ts.map +0 -1
  135. package/dist/clone.js +0 -101
  136. package/dist/common.d.ts +0 -32
  137. package/dist/common.d.ts.map +0 -1
  138. package/dist/common.js +0 -346
  139. package/dist/delay.d.ts.map +0 -1
  140. package/dist/delay.js +0 -34
  141. package/dist/draftjs-templates.d.ts.map +0 -1
  142. package/dist/draftjs-templates.js +0 -157
  143. package/dist/draftjs.d.ts.map +0 -1
  144. package/dist/draftjs.js +0 -836
  145. package/dist/encryption.d.ts.map +0 -1
  146. package/dist/encryption.js +0 -33
  147. package/dist/get-image-url.d.ts.map +0 -1
  148. package/dist/get-image-url.js +0 -15
  149. package/dist/gzip.d.ts.map +0 -1
  150. package/dist/gzip.js +0 -11
  151. package/dist/highlight-code.d.ts +0 -15
  152. package/dist/highlight-code.d.ts.map +0 -1
  153. package/dist/highlight-code.js +0 -35
  154. package/dist/http.d.ts.map +0 -1
  155. package/dist/http.js +0 -18
  156. package/dist/index.d.ts +0 -6
  157. package/dist/index.d.ts.map +0 -1
  158. package/dist/index.js +0 -60
  159. package/dist/map.d.ts.map +0 -1
  160. package/dist/map.js +0 -9
  161. package/dist/memoize.d.ts.map +0 -1
  162. package/dist/memoize.js +0 -13
  163. package/dist/merge.d.ts.map +0 -1
  164. package/dist/merge.js +0 -67
  165. package/dist/mime.d.ts.map +0 -1
  166. package/dist/mime.js +0 -37
  167. package/dist/names.d.ts.map +0 -1
  168. package/dist/names.js +0 -15
  169. package/dist/naming.d.ts.map +0 -1
  170. package/dist/naming.js +0 -91
  171. package/dist/path-to-string.d.ts.map +0 -1
  172. package/dist/path-to-string.js +0 -13
  173. package/dist/persisted-queries.d.ts.map +0 -1
  174. package/dist/persisted-queries.js +0 -7
  175. package/dist/predicate.d.ts.map +0 -1
  176. package/dist/predicate.js +0 -17
  177. package/dist/search-params.d.ts.map +0 -1
  178. package/dist/search-params.js +0 -25
  179. package/dist/set-in.d.ts.map +0 -1
  180. package/dist/set-in.js +0 -11
  181. package/dist/sets.d.ts.map +0 -1
  182. package/dist/sets.js +0 -21
  183. package/dist/sleep.d.ts.map +0 -1
  184. package/dist/sleep.js +0 -11
  185. package/dist/sort-object.d.ts.map +0 -1
  186. package/dist/sort-object.js +0 -21
  187. package/dist/strings.d.ts.map +0 -1
  188. package/dist/strings.js +0 -87
  189. package/dist/templates.d.ts.map +0 -1
  190. package/dist/templates.js +0 -120
  191. package/dist/timezone.d.ts.map +0 -1
  192. package/dist/timezone.js +0 -17
  193. package/dist/tracing.d.ts.map +0 -1
  194. package/dist/tracing.js +0 -5
  195. package/dist/types.d.ts.map +0 -1
  196. package/dist/types.js +0 -92
  197. package/dist/unix-to-iso.d.ts.map +0 -1
  198. package/dist/unix-to-iso.js +0 -17
  199. package/dist/urls.d.ts.map +0 -1
  200. package/dist/urls.js +0 -11
  201. package/dist/validation.d.ts.map +0 -1
  202. package/dist/validation.js +0 -8
  203. package/dist/value.d.ts.map +0 -1
  204. package/dist/value.js +0 -11
  205. package/dist/visit.d.ts.map +0 -1
  206. package/dist/visit.js +0 -61
  207. package/es/arrays.js +0 -33
  208. package/es/assert.js +0 -5
  209. package/es/async-noop.js +0 -2
  210. package/es/billing.js +0 -40
  211. package/es/browser.js +0 -1
  212. package/es/clone.js +0 -94
  213. package/es/common.js +0 -31
  214. package/es/delay.js +0 -26
  215. package/es/draftjs-templates.js +0 -147
  216. package/es/draftjs.js +0 -819
  217. package/es/encryption.js +0 -26
  218. package/es/gzip.js +0 -4
  219. package/es/highlight-code.js +0 -26
  220. package/es/http.js +0 -11
  221. package/es/index.js +0 -6
  222. package/es/memoize.js +0 -6
  223. package/es/merge.js +0 -58
  224. package/es/mime.js +0 -29
  225. package/es/names.js +0 -9
  226. package/es/naming.js +0 -78
  227. package/es/path-to-string.js +0 -6
  228. package/es/search-params.js +0 -17
  229. package/es/set-in.js +0 -6
  230. package/es/sets.js +0 -14
  231. package/es/sleep.js +0 -5
  232. package/es/sort-object.js +0 -14
  233. package/es/strings.js +0 -72
  234. package/es/templates.js +0 -105
  235. package/es/timezone.js +0 -10
  236. package/es/tracing.js +0 -1
  237. package/es/types.js +0 -80
  238. package/es/unix-to-iso.js +0 -9
  239. package/es/urls.js +0 -5
  240. package/es/validation.js +0 -2
  241. package/es/value.js +0 -4
  242. package/es/visit.js +0 -53
package/dist/browser.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _common = require("./common");
7
- Object.keys(_common).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _common[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _common[key];
14
- }
15
- });
16
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/clone.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA8BxC;AAED;;;;;GAKG;AACH,KAAK,WAAW,GAAG,CACjB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,KACpD,OAAO,CAAC;AAEb;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,EACvD,KAAK,EAAE,WAAW,KACf,OAAO,CAAC;AAEb,eAAO,MAAM,MAAM,eAAmB,CAAC;AAMvC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,uBAAuB,GAAG,OAAO,CAwC1F"}
package/dist/clone.js DELETED
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.REMOVE = void 0;
7
- exports.deepClone = deepClone;
8
- exports.deepCloneWith = deepCloneWith;
9
- var _types = require("./types");
10
- /**
11
- * Clone any JSON serializable value similar to JSON.parse(JSON.stringify()) but better performance
12
- */
13
- function deepClone(value) {
14
- if (!value) {
15
- return value;
16
- }
17
- if (Array.isArray(value)) {
18
- const {
19
- length
20
- } = value;
21
- const result = new Array(length);
22
- for (let i = 0; i < length; i++) {
23
- result[i] = deepClone(value[i]);
24
- }
25
- return result;
26
- }
27
- if ((0, _types.isIterableObject)(value)) {
28
- const obj = value;
29
- const result = {};
30
- for (const key of Object.keys(obj)) {
31
- const value = obj[key];
32
- if (value !== undefined) {
33
- result[key] = deepClone(value);
34
- }
35
- }
36
- return result;
37
- }
38
- return value;
39
- }
40
-
41
- /**
42
- * @param value the value to clone
43
- * @param key the key/index this value is stored under if parent is an object or array
44
- * @param parent the parent object or array if applicable
45
- * @return a new value to use instead of the value argument. Return REMOVE to remove value from the parent. Return undefined to continue to clone recursively.
46
- */
47
-
48
- /**
49
- * The callback for deepCloneWith which is called for every value in a object
50
- * @param value the value to clone
51
- * @param key the key/index this value is stored under if parent is an object or array
52
- * @param parent the parent object or array if applicable
53
- * @param clone a function used to continue to recusively clone
54
- * @return a new value to use instead of the value argument. Return REMOVE to remove value from the parent. Return undefined to continue to clone recursively.
55
- */
56
-
57
- const REMOVE = exports.REMOVE = Symbol('REMOVE');
58
- function arrayFilter(value) {
59
- return value !== REMOVE;
60
- }
61
-
62
- /**
63
- * Clone any JSON serializable value and transform using a callback
64
- * @param value the value to clone
65
- * @param customizer a callback that is called for every key/index
66
- */
67
- function deepCloneWith(value, customizer) {
68
- const clone = (value, key, parent) => {
69
- const newValue = customizer(value, key, parent, clone);
70
- if (newValue !== undefined) {
71
- return newValue;
72
- }
73
- if (Array.isArray(value)) {
74
- const {
75
- length
76
- } = value;
77
- const arr = new Array(length);
78
- let edited = false;
79
- for (let i = 0; i < length; i++) {
80
- const newValue = clone(value[i], i, value);
81
- if (newValue === REMOVE) {
82
- edited = true;
83
- }
84
- arr[i] = newValue;
85
- }
86
- return edited ? arr.filter(arrayFilter) : arr;
87
- }
88
- if ((0, _types.isIterableObject)(value)) {
89
- const newObject = {};
90
- for (const key of Object.keys(value)) {
91
- const newValue = clone(value[key], key, value);
92
- if (newValue !== undefined && newValue !== REMOVE) {
93
- newObject[key] = newValue;
94
- }
95
- }
96
- return newObject;
97
- }
98
- return value;
99
- };
100
- return clone(value, undefined, undefined);
101
- }
package/dist/common.d.ts DELETED
@@ -1,32 +0,0 @@
1
- export * from './types';
2
- export * from './mime';
3
- export * from './http';
4
- export * from './delay';
5
- export * from './strings';
6
- export * from './unix-to-iso';
7
- export * from './arrays';
8
- export * from './value';
9
- export * from './clone';
10
- export * from './predicate';
11
- export * from './tracing';
12
- export * from './merge';
13
- export * from './map';
14
- export * from './visit';
15
- export * from './draftjs';
16
- export * from './templates';
17
- export * from './highlight-code';
18
- export * from './billing';
19
- export * from './timezone';
20
- export * from './async-noop';
21
- export * from './set-in';
22
- export * from './sets';
23
- export * from './sleep';
24
- export * from './validation';
25
- export * from './sort-object';
26
- export * from './path-to-string';
27
- export * from './persisted-queries';
28
- export * from './assert';
29
- export * from './urls';
30
- export * from './memoize';
31
- export * from './names';
32
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
package/dist/common.js DELETED
@@ -1,346 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _types = require("./types");
7
- Object.keys(_types).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _types[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _types[key];
14
- }
15
- });
16
- });
17
- var _mime = require("./mime");
18
- Object.keys(_mime).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _mime[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _mime[key];
25
- }
26
- });
27
- });
28
- var _http = require("./http");
29
- Object.keys(_http).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _http[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _http[key];
36
- }
37
- });
38
- });
39
- var _delay = require("./delay");
40
- Object.keys(_delay).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _delay[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _delay[key];
47
- }
48
- });
49
- });
50
- var _strings = require("./strings");
51
- Object.keys(_strings).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _strings[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _strings[key];
58
- }
59
- });
60
- });
61
- var _unixToIso = require("./unix-to-iso");
62
- Object.keys(_unixToIso).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _unixToIso[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _unixToIso[key];
69
- }
70
- });
71
- });
72
- var _arrays = require("./arrays");
73
- Object.keys(_arrays).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _arrays[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function () {
79
- return _arrays[key];
80
- }
81
- });
82
- });
83
- var _value = require("./value");
84
- Object.keys(_value).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _value[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function () {
90
- return _value[key];
91
- }
92
- });
93
- });
94
- var _clone = require("./clone");
95
- Object.keys(_clone).forEach(function (key) {
96
- if (key === "default" || key === "__esModule") return;
97
- if (key in exports && exports[key] === _clone[key]) return;
98
- Object.defineProperty(exports, key, {
99
- enumerable: true,
100
- get: function () {
101
- return _clone[key];
102
- }
103
- });
104
- });
105
- var _predicate = require("./predicate");
106
- Object.keys(_predicate).forEach(function (key) {
107
- if (key === "default" || key === "__esModule") return;
108
- if (key in exports && exports[key] === _predicate[key]) return;
109
- Object.defineProperty(exports, key, {
110
- enumerable: true,
111
- get: function () {
112
- return _predicate[key];
113
- }
114
- });
115
- });
116
- var _tracing = require("./tracing");
117
- Object.keys(_tracing).forEach(function (key) {
118
- if (key === "default" || key === "__esModule") return;
119
- if (key in exports && exports[key] === _tracing[key]) return;
120
- Object.defineProperty(exports, key, {
121
- enumerable: true,
122
- get: function () {
123
- return _tracing[key];
124
- }
125
- });
126
- });
127
- var _merge = require("./merge");
128
- Object.keys(_merge).forEach(function (key) {
129
- if (key === "default" || key === "__esModule") return;
130
- if (key in exports && exports[key] === _merge[key]) return;
131
- Object.defineProperty(exports, key, {
132
- enumerable: true,
133
- get: function () {
134
- return _merge[key];
135
- }
136
- });
137
- });
138
- var _map = require("./map");
139
- Object.keys(_map).forEach(function (key) {
140
- if (key === "default" || key === "__esModule") return;
141
- if (key in exports && exports[key] === _map[key]) return;
142
- Object.defineProperty(exports, key, {
143
- enumerable: true,
144
- get: function () {
145
- return _map[key];
146
- }
147
- });
148
- });
149
- var _visit = require("./visit");
150
- Object.keys(_visit).forEach(function (key) {
151
- if (key === "default" || key === "__esModule") return;
152
- if (key in exports && exports[key] === _visit[key]) return;
153
- Object.defineProperty(exports, key, {
154
- enumerable: true,
155
- get: function () {
156
- return _visit[key];
157
- }
158
- });
159
- });
160
- var _draftjs = require("./draftjs");
161
- Object.keys(_draftjs).forEach(function (key) {
162
- if (key === "default" || key === "__esModule") return;
163
- if (key in exports && exports[key] === _draftjs[key]) return;
164
- Object.defineProperty(exports, key, {
165
- enumerable: true,
166
- get: function () {
167
- return _draftjs[key];
168
- }
169
- });
170
- });
171
- var _templates = require("./templates");
172
- Object.keys(_templates).forEach(function (key) {
173
- if (key === "default" || key === "__esModule") return;
174
- if (key in exports && exports[key] === _templates[key]) return;
175
- Object.defineProperty(exports, key, {
176
- enumerable: true,
177
- get: function () {
178
- return _templates[key];
179
- }
180
- });
181
- });
182
- var _highlightCode = require("./highlight-code");
183
- Object.keys(_highlightCode).forEach(function (key) {
184
- if (key === "default" || key === "__esModule") return;
185
- if (key in exports && exports[key] === _highlightCode[key]) return;
186
- Object.defineProperty(exports, key, {
187
- enumerable: true,
188
- get: function () {
189
- return _highlightCode[key];
190
- }
191
- });
192
- });
193
- var _billing = require("./billing");
194
- Object.keys(_billing).forEach(function (key) {
195
- if (key === "default" || key === "__esModule") return;
196
- if (key in exports && exports[key] === _billing[key]) return;
197
- Object.defineProperty(exports, key, {
198
- enumerable: true,
199
- get: function () {
200
- return _billing[key];
201
- }
202
- });
203
- });
204
- var _timezone = require("./timezone");
205
- Object.keys(_timezone).forEach(function (key) {
206
- if (key === "default" || key === "__esModule") return;
207
- if (key in exports && exports[key] === _timezone[key]) return;
208
- Object.defineProperty(exports, key, {
209
- enumerable: true,
210
- get: function () {
211
- return _timezone[key];
212
- }
213
- });
214
- });
215
- var _asyncNoop = require("./async-noop");
216
- Object.keys(_asyncNoop).forEach(function (key) {
217
- if (key === "default" || key === "__esModule") return;
218
- if (key in exports && exports[key] === _asyncNoop[key]) return;
219
- Object.defineProperty(exports, key, {
220
- enumerable: true,
221
- get: function () {
222
- return _asyncNoop[key];
223
- }
224
- });
225
- });
226
- var _setIn = require("./set-in");
227
- Object.keys(_setIn).forEach(function (key) {
228
- if (key === "default" || key === "__esModule") return;
229
- if (key in exports && exports[key] === _setIn[key]) return;
230
- Object.defineProperty(exports, key, {
231
- enumerable: true,
232
- get: function () {
233
- return _setIn[key];
234
- }
235
- });
236
- });
237
- var _sets = require("./sets");
238
- Object.keys(_sets).forEach(function (key) {
239
- if (key === "default" || key === "__esModule") return;
240
- if (key in exports && exports[key] === _sets[key]) return;
241
- Object.defineProperty(exports, key, {
242
- enumerable: true,
243
- get: function () {
244
- return _sets[key];
245
- }
246
- });
247
- });
248
- var _sleep = require("./sleep");
249
- Object.keys(_sleep).forEach(function (key) {
250
- if (key === "default" || key === "__esModule") return;
251
- if (key in exports && exports[key] === _sleep[key]) return;
252
- Object.defineProperty(exports, key, {
253
- enumerable: true,
254
- get: function () {
255
- return _sleep[key];
256
- }
257
- });
258
- });
259
- var _validation = require("./validation");
260
- Object.keys(_validation).forEach(function (key) {
261
- if (key === "default" || key === "__esModule") return;
262
- if (key in exports && exports[key] === _validation[key]) return;
263
- Object.defineProperty(exports, key, {
264
- enumerable: true,
265
- get: function () {
266
- return _validation[key];
267
- }
268
- });
269
- });
270
- var _sortObject = require("./sort-object");
271
- Object.keys(_sortObject).forEach(function (key) {
272
- if (key === "default" || key === "__esModule") return;
273
- if (key in exports && exports[key] === _sortObject[key]) return;
274
- Object.defineProperty(exports, key, {
275
- enumerable: true,
276
- get: function () {
277
- return _sortObject[key];
278
- }
279
- });
280
- });
281
- var _pathToString = require("./path-to-string");
282
- Object.keys(_pathToString).forEach(function (key) {
283
- if (key === "default" || key === "__esModule") return;
284
- if (key in exports && exports[key] === _pathToString[key]) return;
285
- Object.defineProperty(exports, key, {
286
- enumerable: true,
287
- get: function () {
288
- return _pathToString[key];
289
- }
290
- });
291
- });
292
- var _persistedQueries = require("./persisted-queries");
293
- Object.keys(_persistedQueries).forEach(function (key) {
294
- if (key === "default" || key === "__esModule") return;
295
- if (key in exports && exports[key] === _persistedQueries[key]) return;
296
- Object.defineProperty(exports, key, {
297
- enumerable: true,
298
- get: function () {
299
- return _persistedQueries[key];
300
- }
301
- });
302
- });
303
- var _assert = require("./assert");
304
- Object.keys(_assert).forEach(function (key) {
305
- if (key === "default" || key === "__esModule") return;
306
- if (key in exports && exports[key] === _assert[key]) return;
307
- Object.defineProperty(exports, key, {
308
- enumerable: true,
309
- get: function () {
310
- return _assert[key];
311
- }
312
- });
313
- });
314
- var _urls = require("./urls");
315
- Object.keys(_urls).forEach(function (key) {
316
- if (key === "default" || key === "__esModule") return;
317
- if (key in exports && exports[key] === _urls[key]) return;
318
- Object.defineProperty(exports, key, {
319
- enumerable: true,
320
- get: function () {
321
- return _urls[key];
322
- }
323
- });
324
- });
325
- var _memoize = require("./memoize");
326
- Object.keys(_memoize).forEach(function (key) {
327
- if (key === "default" || key === "__esModule") return;
328
- if (key in exports && exports[key] === _memoize[key]) return;
329
- Object.defineProperty(exports, key, {
330
- enumerable: true,
331
- get: function () {
332
- return _memoize[key];
333
- }
334
- });
335
- });
336
- var _names = require("./names");
337
- Object.keys(_names).forEach(function (key) {
338
- if (key === "default" || key === "__esModule") return;
339
- if (key in exports && exports[key] === _names[key]) return;
340
- Object.defineProperty(exports, key, {
341
- enumerable: true,
342
- get: function () {
343
- return _names[key];
344
- }
345
- });
346
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../src/delay.ts"],"names":[],"mappings":"AAAA,wBAAsB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAIrE;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AASF,wBAAsB,OAAO,CAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,OAAgC,GACxC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE5F"}
package/dist/delay.js DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.backoff = backoff;
7
- exports.delay = delay;
8
- exports.randomDelay = randomDelay;
9
- async function delay(timeout, value) {
10
- return new Promise(resolve => {
11
- setTimeout(resolve, timeout, value);
12
- });
13
- }
14
- function randomInt(minimum, maximum) {
15
- const co = Math.random() * (maximum - minimum + 1);
16
- return Math.floor(co + minimum);
17
- }
18
-
19
- // Decorrelated jitter backoff:
20
- // https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
21
- async function backoff(baseDelay, maxDelay, attempt = {
22
- num: 1,
23
- lastDelay: 0
24
- }) {
25
- const msec = Math.min(maxDelay, randomInt(baseDelay, (attempt.lastDelay || baseDelay) * 3));
26
- await delay(msec);
27
- return {
28
- num: attempt.num + 1,
29
- lastDelay: msec
30
- };
31
- }
32
- async function randomDelay(minimum, maximum, value) {
33
- return delay(randomInt(minimum, maximum), value);
34
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"draftjs-templates.d.ts","sourceRoot":"","sources":["../../src/draftjs-templates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAGnD,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,oBAAoB,CAAC;IACnC,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,kBAAkB,KAAG,qBAAqB,GAAG,SAmEpF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,WAAY,sBAAsB,KAAG,qBAcpE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,mBAAmB,KAAG,qBAsD9D,CAAC"}
@@ -1,157 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getDraftjsPullquote = exports.getDraftjsOembed = exports.getDraftjsImage = void 0;
7
- var _shortid = _interopRequireDefault(require("shortid"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- /*
10
- * The intention is to move all this to the client package in the end, but right now it's here
11
- * to be shared between the draftjs / mdx implementations, which span the client / server differently.
12
- */
13
-
14
- const getDraftjsImage = params => {
15
- const {
16
- captionText,
17
- creditText,
18
- alignment,
19
- size,
20
- assetId,
21
- linkUrl,
22
- linkIsExternal,
23
- depth,
24
- key,
25
- path
26
- } = params;
27
- const blockKey = _shortid.default.generate();
28
- return {
29
- contentBlock: {
30
- key: _shortid.default.generate(),
31
- text: ' ',
32
- type: 'atomic',
33
- depth,
34
- inlineStyleRanges: [],
35
- entityRanges: [{
36
- offset: 0,
37
- length: 1,
38
- key
39
- }],
40
- data: {}
41
- },
42
- entities: {
43
- [key]: {
44
- type: 'image',
45
- mutability: 'IMMUTABLE',
46
- data: {
47
- id: assetId,
48
- path,
49
- caption: {
50
- blocks: [{
51
- key: blockKey,
52
- text: captionText,
53
- type: 'unstyled',
54
- depth,
55
- inlineStyleRanges: [],
56
- entityRanges: [],
57
- data: {}
58
- }],
59
- entityMap: {}
60
- },
61
- credit: {
62
- blocks: [{
63
- key: blockKey,
64
- text: creditText,
65
- type: 'unstyled',
66
- depth,
67
- inlineStyleRanges: [],
68
- entityRanges: [],
69
- data: {}
70
- }],
71
- entityMap: {}
72
- },
73
- link: {
74
- url: linkUrl,
75
- external: linkIsExternal
76
- },
77
- alignment,
78
- size,
79
- contentTypeId: 'ASSET'
80
- }
81
- }
82
- }
83
- };
84
- };
85
- exports.getDraftjsImage = getDraftjsImage;
86
- const getDraftjsPullquote = params => {
87
- const {
88
- text,
89
- depth
90
- } = params;
91
- return {
92
- contentBlock: {
93
- key: _shortid.default.generate(),
94
- text,
95
- type: 'pullquote',
96
- depth,
97
- inlineStyleRanges: [],
98
- entityRanges: [],
99
- data: {}
100
- },
101
- entities: {}
102
- };
103
- };
104
- exports.getDraftjsPullquote = getDraftjsPullquote;
105
- const getDraftjsOembed = params => {
106
- const {
107
- key,
108
- depth,
109
- html,
110
- width = 550,
111
- height = undefined,
112
- url = undefined,
113
- author_name = undefined,
114
- author_url = undefined,
115
- type = undefined,
116
- cache_age = undefined,
117
- provider_name = undefined,
118
- provider_url = undefined,
119
- version = undefined
120
- } = params;
121
- return {
122
- contentBlock: {
123
- key: _shortid.default.generate(),
124
- text: ' ',
125
- type: 'atomic',
126
- depth,
127
- inlineStyleRanges: [],
128
- entityRanges: [{
129
- offset: 0,
130
- length: 1,
131
- key
132
- }],
133
- data: {}
134
- },
135
- // Only html is required
136
- entities: {
137
- [key]: {
138
- type: 'oembed',
139
- mutability: 'IMMUTABLE',
140
- data: {
141
- url,
142
- author_name,
143
- author_url,
144
- html,
145
- width,
146
- height,
147
- type,
148
- cache_age,
149
- provider_name,
150
- provider_url,
151
- version
152
- }
153
- }
154
- }
155
- };
156
- };
157
- exports.getDraftjsOembed = getDraftjsOembed;