vest-utils 0.0.1-rc → 0.0.4-dev-afe5de

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 (264) hide show
  1. package/dist/cjs/vest-utils.development.js +348 -0
  2. package/dist/cjs/vest-utils.production.js +1 -1
  3. package/dist/es/vest-utils.development.js +305 -0
  4. package/dist/es/vest-utils.production.js +1 -1
  5. package/dist/umd/vest-utils.development.js +352 -4
  6. package/dist/umd/vest-utils.production.js +1 -1
  7. package/package.json +4 -662
  8. package/src/{exports/__tests__ → __tests__}/bindNot.test.ts +1 -1
  9. package/src/{exports/__tests__ → __tests__}/bus.test.ts +0 -0
  10. package/src/{exports/__tests__ → __tests__}/cache.test.ts +1 -1
  11. package/src/{exports/__tests__ → __tests__}/defaultTo.test.ts +1 -1
  12. package/src/{exports/__tests__ → __tests__}/genId.test.ts +0 -0
  13. package/src/__tests__/greaterThan.test.ts +59 -0
  14. package/src/{exports/__tests__ → __tests__}/invariant.test.ts +1 -1
  15. package/src/__tests__/isArray.test.ts +15 -0
  16. package/src/__tests__/isNull.test.ts +25 -0
  17. package/src/__tests__/isNumeric.test.ts +26 -0
  18. package/src/__tests__/isUndefined.test.ts +26 -0
  19. package/src/__tests__/lengthEquals.test.ts +56 -0
  20. package/src/__tests__/longerThan.test.ts +56 -0
  21. package/src/{exports/__tests__ → __tests__}/mapFirst.test.ts +1 -1
  22. package/src/__tests__/numberEquals.test.ts +59 -0
  23. package/src/{exports/__tests__ → __tests__}/optionalFunctionValue.test.ts +1 -1
  24. package/src/{exports/__tests__ → __tests__}/partition.test.ts +1 -1
  25. package/src/{exports/__tests__ → __tests__}/throwError.test.ts +1 -1
  26. package/src/{exports/asArray.ts → asArray.ts} +0 -0
  27. package/src/{exports/assign.ts → assign.ts} +0 -0
  28. package/src/{exports/bindNot.ts → bindNot.ts} +0 -0
  29. package/src/{exports/bus.ts → bus.ts} +0 -0
  30. package/src/{exports/cache.ts → cache.ts} +0 -0
  31. package/src/{exports/callEach.ts → callEach.ts} +0 -0
  32. package/src/{exports/defaultTo.ts → defaultTo.ts} +0 -0
  33. package/src/{exports/throwError.ts → deferThrow.ts} +1 -1
  34. package/src/{exports/either.ts → either.ts} +0 -0
  35. package/src/{exports/genId.ts → genId.ts} +0 -0
  36. package/src/globals.d.ts +3 -3
  37. package/src/greaterThan.ts +8 -0
  38. package/src/{exports/hasOwnProperty.ts → hasOwnProperty.ts} +0 -0
  39. package/src/{exports/invariant.ts → invariant.ts} +0 -0
  40. package/src/isArrayValue.ts +11 -0
  41. package/src/isBooleanValue.ts +3 -0
  42. package/src/isEmpty.ts +17 -0
  43. package/src/{exports/isFunction.ts → isFunction.ts} +0 -0
  44. package/src/isNull.ts +7 -0
  45. package/src/{exports/isNullish.ts → isNullish.ts} +1 -2
  46. package/src/isNumeric.ts +11 -0
  47. package/src/isPositive.ts +5 -0
  48. package/src/{exports/isPromise.ts → isPromise.ts} +0 -0
  49. package/src/isStringValue.ts +3 -0
  50. package/src/isUndefined.ts +7 -0
  51. package/src/{exports/last.ts → last.ts} +0 -0
  52. package/src/lengthEquals.ts +11 -0
  53. package/src/longerThan.ts +8 -0
  54. package/src/{exports/mapFirst.ts → mapFirst.ts} +0 -0
  55. package/src/{exports/nestedArray.ts → nestedArray.ts} +2 -3
  56. package/src/numberEquals.ts +11 -0
  57. package/src/{exports/optionalFunctionValue.ts → optionalFunctionValue.ts} +1 -1
  58. package/src/{exports/partition.ts → partition.ts} +0 -0
  59. package/src/vest-utils.ts +32 -0
  60. package/types/vest-utils.d.ts +96 -1
  61. package/asArray/package.json +0 -9
  62. package/assign/package.json +0 -9
  63. package/bindNot/package.json +0 -9
  64. package/bus/package.json +0 -9
  65. package/cache/package.json +0 -9
  66. package/callEach/package.json +0 -9
  67. package/defaultTo/package.json +0 -9
  68. package/dist/cjs/asArray.development.js +0 -7
  69. package/dist/cjs/asArray.js +0 -7
  70. package/dist/cjs/asArray.production.js +0 -1
  71. package/dist/cjs/assign.development.js +0 -5
  72. package/dist/cjs/assign.js +0 -7
  73. package/dist/cjs/assign.production.js +0 -1
  74. package/dist/cjs/bindNot.development.js +0 -13
  75. package/dist/cjs/bindNot.js +0 -7
  76. package/dist/cjs/bindNot.production.js +0 -1
  77. package/dist/cjs/bus.development.js +0 -27
  78. package/dist/cjs/bus.js +0 -7
  79. package/dist/cjs/bus.production.js +0 -1
  80. package/dist/cjs/cache.development.js +0 -72
  81. package/dist/cjs/cache.js +0 -7
  82. package/dist/cjs/cache.production.js +0 -1
  83. package/dist/cjs/callEach.development.js +0 -7
  84. package/dist/cjs/callEach.js +0 -7
  85. package/dist/cjs/callEach.production.js +0 -1
  86. package/dist/cjs/defaultTo.development.js +0 -20
  87. package/dist/cjs/defaultTo.js +0 -7
  88. package/dist/cjs/defaultTo.production.js +0 -1
  89. package/dist/cjs/either.development.js +0 -7
  90. package/dist/cjs/either.js +0 -7
  91. package/dist/cjs/either.production.js +0 -1
  92. package/dist/cjs/genId.development.js +0 -10
  93. package/dist/cjs/genId.js +0 -7
  94. package/dist/cjs/genId.production.js +0 -1
  95. package/dist/cjs/hasOwnProperty.development.js +0 -10
  96. package/dist/cjs/hasOwnProperty.js +0 -7
  97. package/dist/cjs/hasOwnProperty.production.js +0 -1
  98. package/dist/cjs/invariant.development.js +0 -36
  99. package/dist/cjs/invariant.js +0 -7
  100. package/dist/cjs/invariant.production.js +0 -1
  101. package/dist/cjs/isBooleanValue.development.js +0 -9
  102. package/dist/cjs/isBooleanValue.js +0 -7
  103. package/dist/cjs/isBooleanValue.production.js +0 -1
  104. package/dist/cjs/isFunction.development.js +0 -7
  105. package/dist/cjs/isFunction.js +0 -7
  106. package/dist/cjs/isFunction.production.js +0 -1
  107. package/dist/cjs/isNullish.development.js +0 -37
  108. package/dist/cjs/isNullish.js +0 -7
  109. package/dist/cjs/isNullish.production.js +0 -1
  110. package/dist/cjs/isPromise.development.js +0 -11
  111. package/dist/cjs/isPromise.js +0 -7
  112. package/dist/cjs/isPromise.production.js +0 -1
  113. package/dist/cjs/isStringValue.development.js +0 -9
  114. package/dist/cjs/isStringValue.js +0 -7
  115. package/dist/cjs/isStringValue.production.js +0 -1
  116. package/dist/cjs/last.development.js +0 -12
  117. package/dist/cjs/last.js +0 -7
  118. package/dist/cjs/last.production.js +0 -1
  119. package/dist/cjs/mapFirst.development.js +0 -20
  120. package/dist/cjs/mapFirst.js +0 -7
  121. package/dist/cjs/mapFirst.production.js +0 -1
  122. package/dist/cjs/nestedArray.development.js +0 -99
  123. package/dist/cjs/nestedArray.js +0 -7
  124. package/dist/cjs/nestedArray.production.js +0 -1
  125. package/dist/cjs/optionalFunctionValue.development.js +0 -15
  126. package/dist/cjs/optionalFunctionValue.js +0 -7
  127. package/dist/cjs/optionalFunctionValue.production.js +0 -1
  128. package/dist/cjs/partition.development.js +0 -10
  129. package/dist/cjs/partition.js +0 -7
  130. package/dist/cjs/partition.production.js +0 -1
  131. package/dist/cjs/throwError.development.js +0 -11
  132. package/dist/cjs/throwError.js +0 -7
  133. package/dist/cjs/throwError.production.js +0 -1
  134. package/dist/es/asArray.development.js +0 -5
  135. package/dist/es/asArray.production.js +0 -1
  136. package/dist/es/assign.development.js +0 -3
  137. package/dist/es/assign.production.js +0 -1
  138. package/dist/es/bindNot.development.js +0 -11
  139. package/dist/es/bindNot.production.js +0 -1
  140. package/dist/es/bus.development.js +0 -23
  141. package/dist/es/bus.production.js +0 -1
  142. package/dist/es/cache.development.js +0 -66
  143. package/dist/es/cache.production.js +0 -1
  144. package/dist/es/callEach.development.js +0 -5
  145. package/dist/es/callEach.production.js +0 -1
  146. package/dist/es/defaultTo.development.js +0 -18
  147. package/dist/es/defaultTo.production.js +0 -1
  148. package/dist/es/either.development.js +0 -5
  149. package/dist/es/either.production.js +0 -1
  150. package/dist/es/genId.development.js +0 -8
  151. package/dist/es/genId.production.js +0 -1
  152. package/dist/es/hasOwnProperty.development.js +0 -8
  153. package/dist/es/hasOwnProperty.production.js +0 -1
  154. package/dist/es/invariant.development.js +0 -32
  155. package/dist/es/invariant.production.js +0 -1
  156. package/dist/es/isBooleanValue.development.js +0 -5
  157. package/dist/es/isBooleanValue.production.js +0 -1
  158. package/dist/es/isFunction.development.js +0 -5
  159. package/dist/es/isFunction.production.js +0 -1
  160. package/dist/es/isNullish.development.js +0 -28
  161. package/dist/es/isNullish.production.js +0 -1
  162. package/dist/es/isPromise.development.js +0 -9
  163. package/dist/es/isPromise.production.js +0 -1
  164. package/dist/es/isStringValue.development.js +0 -5
  165. package/dist/es/isStringValue.production.js +0 -1
  166. package/dist/es/last.development.js +0 -10
  167. package/dist/es/last.production.js +0 -1
  168. package/dist/es/mapFirst.development.js +0 -18
  169. package/dist/es/mapFirst.production.js +0 -1
  170. package/dist/es/nestedArray.development.js +0 -87
  171. package/dist/es/nestedArray.production.js +0 -1
  172. package/dist/es/optionalFunctionValue.development.js +0 -13
  173. package/dist/es/optionalFunctionValue.production.js +0 -1
  174. package/dist/es/partition.development.js +0 -8
  175. package/dist/es/partition.production.js +0 -1
  176. package/dist/es/throwError.development.js +0 -7
  177. package/dist/es/throwError.production.js +0 -1
  178. package/dist/umd/asArray.development.js +0 -13
  179. package/dist/umd/asArray.production.js +0 -1
  180. package/dist/umd/assign.development.js +0 -11
  181. package/dist/umd/assign.production.js +0 -1
  182. package/dist/umd/bindNot.development.js +0 -19
  183. package/dist/umd/bindNot.production.js +0 -1
  184. package/dist/umd/bus.development.js +0 -33
  185. package/dist/umd/bus.production.js +0 -1
  186. package/dist/umd/cache.development.js +0 -76
  187. package/dist/umd/cache.production.js +0 -1
  188. package/dist/umd/callEach.development.js +0 -13
  189. package/dist/umd/callEach.production.js +0 -1
  190. package/dist/umd/defaultTo.development.js +0 -26
  191. package/dist/umd/defaultTo.production.js +0 -1
  192. package/dist/umd/either.development.js +0 -13
  193. package/dist/umd/either.production.js +0 -1
  194. package/dist/umd/genId.development.js +0 -16
  195. package/dist/umd/genId.production.js +0 -1
  196. package/dist/umd/hasOwnProperty.development.js +0 -16
  197. package/dist/umd/hasOwnProperty.production.js +0 -1
  198. package/dist/umd/invariant.development.js +0 -42
  199. package/dist/umd/invariant.production.js +0 -1
  200. package/dist/umd/isBooleanValue.development.js +0 -15
  201. package/dist/umd/isBooleanValue.production.js +0 -1
  202. package/dist/umd/isFunction.development.js +0 -13
  203. package/dist/umd/isFunction.production.js +0 -1
  204. package/dist/umd/isNullish.development.js +0 -41
  205. package/dist/umd/isNullish.production.js +0 -1
  206. package/dist/umd/isPromise.development.js +0 -17
  207. package/dist/umd/isPromise.production.js +0 -1
  208. package/dist/umd/isStringValue.development.js +0 -15
  209. package/dist/umd/isStringValue.production.js +0 -1
  210. package/dist/umd/last.development.js +0 -18
  211. package/dist/umd/last.production.js +0 -1
  212. package/dist/umd/mapFirst.development.js +0 -26
  213. package/dist/umd/mapFirst.production.js +0 -1
  214. package/dist/umd/nestedArray.development.js +0 -103
  215. package/dist/umd/nestedArray.production.js +0 -1
  216. package/dist/umd/optionalFunctionValue.development.js +0 -21
  217. package/dist/umd/optionalFunctionValue.production.js +0 -1
  218. package/dist/umd/partition.development.js +0 -16
  219. package/dist/umd/partition.production.js +0 -1
  220. package/dist/umd/throwError.development.js +0 -17
  221. package/dist/umd/throwError.production.js +0 -1
  222. package/either/package.json +0 -9
  223. package/genId/package.json +0 -9
  224. package/hasOwnProperty/package.json +0 -9
  225. package/invariant/package.json +0 -9
  226. package/isBooleanValue/package.json +0 -9
  227. package/isFunction/package.json +0 -9
  228. package/isNullish/package.json +0 -9
  229. package/isPromise/package.json +0 -9
  230. package/isStringValue/package.json +0 -9
  231. package/last/package.json +0 -9
  232. package/mapFirst/package.json +0 -9
  233. package/nestedArray/package.json +0 -9
  234. package/optionalFunctionValue/package.json +0 -9
  235. package/partition/package.json +0 -9
  236. package/src/exports/isBooleanValue.ts +0 -3
  237. package/src/exports/isStringValue.ts +0 -3
  238. package/throwError/package.json +0 -9
  239. package/tsconfig.json +0 -6
  240. package/types/asArray.d.ts +0 -2
  241. package/types/assign.d.ts +0 -7
  242. package/types/bindNot.d.ts +0 -2
  243. package/types/bus.d.ts +0 -9
  244. package/types/cache.d.ts +0 -9
  245. package/types/callEach.d.ts +0 -2
  246. package/types/defaultTo.d.ts +0 -2
  247. package/types/either.d.ts +0 -2
  248. package/types/genId.d.ts +0 -5
  249. package/types/hasOwnProperty.d.ts +0 -5
  250. package/types/invariant.d.ts +0 -4
  251. package/types/isBooleanValue.d.ts +0 -2
  252. package/types/isFunction.d.ts +0 -2
  253. package/types/isNullish.d.ts +0 -3
  254. package/types/isPromise.d.ts +0 -2
  255. package/types/isStringValue.d.ts +0 -2
  256. package/types/last.d.ts +0 -2
  257. package/types/mapFirst.d.ts +0 -2
  258. package/types/nestedArray.d.ts +0 -7
  259. package/types/optionalFunctionValue.d.ts +0 -2
  260. package/types/partition.d.ts +0 -5
  261. package/types/throwError.d.ts +0 -2
  262. package/types/utilityTypes.d.ts +0 -8
  263. package/types/vest-utilities.d.ts +0 -1
  264. package/utilityTypes/package.json +0 -9
@@ -1,87 +0,0 @@
1
- import bindNot from 'vest-utils/bindNot';
2
-
3
- // The module is named "isArrayValue" since it
4
- // is conflicting with a nested npm dependency.
5
- // We may need to revisit this in the future.
6
- function isArray(value) {
7
- return Boolean(Array.isArray(value));
8
- }
9
- bindNot(isArray);
10
-
11
- function isNull(value) {
12
- return value === null;
13
- }
14
- var isNotNull = bindNot(isNull);
15
-
16
- function asArray(possibleArg) {
17
- return [].concat(possibleArg);
18
- }
19
-
20
- function isFunction(value) {
21
- return typeof value === 'function';
22
- }
23
-
24
- function optionalFunctionValue(value) {
25
- var args = [];
26
- for (var _i = 1; _i < arguments.length; _i++) {
27
- args[_i - 1] = arguments[_i];
28
- }
29
- return isFunction(value) ? value.apply(void 0, args) : value;
30
- }
31
-
32
- function defaultTo(value, defaultValue) {
33
- var _a;
34
- return (_a = optionalFunctionValue(value)) !== null && _a !== void 0 ? _a : optionalFunctionValue(defaultValue);
35
- }
36
-
37
- function last(values) {
38
- var valuesArray = asArray(values);
39
- return valuesArray[valuesArray.length - 1];
40
- }
41
-
42
- // This is kind of a map/filter in one function.
43
- // Normally, behaves like a nested-array map,
44
- // but returning `null` will drop the element from the array
45
- function transform(array, cb) {
46
- var res = [];
47
- for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
48
- var v = array_1[_i];
49
- if (isArray(v)) {
50
- res.push(transform(v, cb));
51
- }
52
- else {
53
- var output = cb(v);
54
- if (isNotNull(output)) {
55
- res.push(output);
56
- }
57
- }
58
- }
59
- return res;
60
- }
61
- function valueAtPath(array, path) {
62
- return getCurrent(array, path)[last(path)];
63
- }
64
- function setValueAtPath(array, path, value) {
65
- var current = getCurrent(array, path);
66
- current[last(path)] = value;
67
- return array;
68
- }
69
- function flatten(values) {
70
- return asArray(values).reduce(function (acc, value) {
71
- if (isArray(value)) {
72
- return acc.concat(flatten(value));
73
- }
74
- return asArray(acc).concat(value);
75
- }, []);
76
- }
77
- function getCurrent(array, path) {
78
- var current = array;
79
- for (var _i = 0, _a = path.slice(0, -1); _i < _a.length; _i++) {
80
- var p = _a[_i];
81
- current[p] = defaultTo(current[p], []);
82
- current = current[p];
83
- }
84
- return current;
85
- }
86
-
87
- export { flatten, getCurrent, setValueAtPath, transform, valueAtPath };
@@ -1 +0,0 @@
1
- import n from"vest-utils/bindNot";function r(n){return!!Array.isArray(n)}n(r);var t=n((function(n){return null===n}));function u(n){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return"function"==typeof n?n.apply(void 0,r):n}function o(n){return(n=[].concat(n))[n.length-1]}function c(n,u){for(var o=[],e=0;e<n.length;e++){var a=n[e];r(a)?o.push(c(a,u)):(a=u(a),t(a)&&o.push(a))}return o}function e(n){return[].concat(n).reduce((function(n,t){return r(t)?n.concat(e(t)):[].concat(n).concat(t)}),[])}function a(n,r){var t=0;for(r=r.slice(0,-1);t<r.length;t++){var o,c=r[t],e=n,a=c,f=[];f=null!==(o=u(n[c]))&&void 0!==o?o:u(f),e[a]=f,n=n[c]}return n}function f(n,r,t){return a(n,r)[o(r)]=t,n}function i(n,r){return a(n,r)[o(r)]}export{e as flatten,a as getCurrent,f as setValueAtPath,c as transform,i as valueAtPath};
@@ -1,13 +0,0 @@
1
- function isFunction(value) {
2
- return typeof value === 'function';
3
- }
4
-
5
- function optionalFunctionValue(value) {
6
- var args = [];
7
- for (var _i = 1; _i < arguments.length; _i++) {
8
- args[_i - 1] = arguments[_i];
9
- }
10
- return isFunction(value) ? value.apply(void 0, args) : value;
11
- }
12
-
13
- export default optionalFunctionValue;
@@ -1 +0,0 @@
1
- export default function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return"function"==typeof t?t.apply(void 0,n):t}
@@ -1,8 +0,0 @@
1
- function partition(array, predicate) {
2
- return array.reduce(function (partitions, value, number) {
3
- partitions[predicate(value, number, array) ? 0 : 1].push(value);
4
- return partitions;
5
- }, [[], []]);
6
- }
7
-
8
- export default partition;
@@ -1 +0,0 @@
1
- export default function(u,e){return u.reduce((function(n,r,t){return n[e(r,t,u)?0:1].push(r),n}),[[],[]])}
@@ -1,7 +0,0 @@
1
- function deferThrow(message) {
2
- setTimeout(function () {
3
- throw new Error(message);
4
- }, 0);
5
- }
6
-
7
- export { deferThrow };
@@ -1 +0,0 @@
1
- export function deferThrow(o){setTimeout((function(){throw Error(o)}),0)}
@@ -1,13 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.asArray = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function asArray(possibleArg) {
8
- return [].concat(possibleArg);
9
- }
10
-
11
- return asArray;
12
-
13
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(n){return[].concat(n)}:"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).asArray=function(n){return[].concat(n)}}(this,(function(){return function(n){return[].concat(n)}}));
@@ -1,11 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.assign = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- var assign = Object.assign;
8
-
9
- return assign;
10
-
11
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).assign=n()}(this,(function(){return Object.assign}));
@@ -1,19 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bindNot = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function bindNot(fn) {
8
- return function () {
9
- var args = [];
10
- for (var _i = 0; _i < arguments.length; _i++) {
11
- args[_i] = arguments[_i];
12
- }
13
- return !fn.apply(void 0, args);
14
- };
15
- }
16
-
17
- return bindNot;
18
-
19
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(void 0,e)}}:"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).bindNot=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(void 0,e)}}}(this,(function(){return function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(void 0,e)}}}));
@@ -1,33 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bus = {}));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- function createBus() {
8
- var listeners = {};
9
- return {
10
- emit: function (event, data) {
11
- listener(event).forEach(function (handler) {
12
- handler(data);
13
- });
14
- },
15
- on: function (event, handler) {
16
- listeners[event] = listener(event).concat(handler);
17
- return {
18
- off: function () {
19
- listeners[event] = listener(event).filter(function (h) { return h !== handler; });
20
- }
21
- };
22
- }
23
- };
24
- function listener(event) {
25
- return listeners[event] || [];
26
- }
27
- }
28
-
29
- exports.createBus = createBus;
30
-
31
- Object.defineProperty(exports, '__esModule', { value: true });
32
-
33
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).bus={})}(this,(function(e){e.createBus=function(){var e={};return{emit:function(n,t){(e[n]||[]).forEach((function(e){e(t)}))},on:function(n,t){return e[n]=(e[n]||[]).concat(t),{off:function(){e[n]=(e[n]||[]).filter((function(e){return e!==t}))}}}}},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,76 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vest-utils/bindNot')) :
3
- typeof define === 'function' && define.amd ? define(['vest-utils/bindNot'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.cache = factory(global.bindNot));
5
- }(this, (function (bindNot) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var bindNot__default = /*#__PURE__*/_interopDefaultLegacy(bindNot);
10
-
11
- function isNumeric(value) {
12
- var str = String(value);
13
- var num = Number(value);
14
- var result = !isNaN(parseFloat(str)) && !isNaN(Number(value)) && isFinite(num);
15
- return Boolean(result);
16
- }
17
- bindNot__default['default'](isNumeric);
18
-
19
- function numberEquals(value, eq) {
20
- return isNumeric(value) && isNumeric(eq) && Number(value) === Number(eq);
21
- }
22
- bindNot__default['default'](numberEquals);
23
-
24
- function lengthEquals(value, arg1) {
25
- return numberEquals(value.length, arg1);
26
- }
27
- bindNot__default['default'](lengthEquals);
28
-
29
- function greaterThan(value, gt) {
30
- return isNumeric(value) && isNumeric(gt) && Number(value) > Number(gt);
31
- }
32
-
33
- function longerThan(value, arg1) {
34
- return greaterThan(value.length, arg1);
35
- }
36
-
37
- /**
38
- * Creates a cache function
39
- */
40
- function createCache(maxSize) {
41
- if (maxSize === void 0) { maxSize = 1; }
42
- var cacheStorage = [];
43
- var cache = function (deps, cacheAction) {
44
- var cacheHit = cache.get(deps);
45
- // cache hit is not null
46
- if (cacheHit)
47
- return cacheHit[1];
48
- var result = cacheAction();
49
- cacheStorage.unshift([deps.concat(), result]);
50
- if (longerThan(cacheStorage, maxSize))
51
- cacheStorage.length = maxSize;
52
- return result;
53
- };
54
- // invalidate an item in the cache by its dependencies
55
- cache.invalidate = function (deps) {
56
- var index = findIndex(deps);
57
- if (index > -1)
58
- cacheStorage.splice(index, 1);
59
- };
60
- // Retrieves an item from the cache.
61
- cache.get = function (deps) {
62
- return cacheStorage[findIndex(deps)] || null;
63
- };
64
- return cache;
65
- function findIndex(deps) {
66
- return cacheStorage.findIndex(function (_a) {
67
- var cachedDeps = _a[0];
68
- return lengthEquals(deps, cachedDeps.length) &&
69
- deps.every(function (dep, i) { return dep === cachedDeps[i]; });
70
- });
71
- }
72
- }
73
-
74
- return createCache;
75
-
76
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("vest-utils/bindNot")):"function"==typeof define&&define.amd?define(["vest-utils/bindNot"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).cache=n(e.bindNot)}(this,(function(e){function n(e){var n=Number(e);return!(isNaN(parseFloat(String(e)))||isNaN(Number(e))||!isFinite(n))}function t(e,t){return n(e)&&n(t)&&Number(e)===Number(t)}function u(e,n){return t(e.length,n)}return(e=e&&"object"==typeof e&&"default"in e?e:{default:e}).default(n),e.default(t),e.default(u),function(e){function t(e){return i.findIndex((function(n){var t=n[0];return u(e,t.length)&&e.every((function(e,n){return e===t[n]}))}))}void 0===e&&(e=1);var i=[],r=function(t,u){var o=r.get(t);return o?o[1]:(u=u(),i.unshift([t.concat(),u]),t=i.length,o=e,n(t)&&n(o)&&Number(t)>Number(o)&&(i.length=e),u)};return r.invalidate=function(e){-1<(e=t(e))&&i.splice(e,1)},r.get=function(e){return i[t(e)]||null},r}}));
@@ -1,13 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.callEach = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function callEach(arr) {
8
- return arr.forEach(function (fn) { return fn(); });
9
- }
10
-
11
- return callEach;
12
-
13
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(n){return n.forEach((function(n){return n()}))}:"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).callEach=function(n){return n.forEach((function(n){return n()}))}}(this,(function(){return function(n){return n.forEach((function(n){return n()}))}}));
@@ -1,26 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.defaultTo = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function isFunction(value) {
8
- return typeof value === 'function';
9
- }
10
-
11
- function optionalFunctionValue(value) {
12
- var args = [];
13
- for (var _i = 1; _i < arguments.length; _i++) {
14
- args[_i - 1] = arguments[_i];
15
- }
16
- return isFunction(value) ? value.apply(void 0, args) : value;
17
- }
18
-
19
- function defaultTo(value, defaultValue) {
20
- var _a;
21
- return (_a = optionalFunctionValue(value)) !== null && _a !== void 0 ? _a : optionalFunctionValue(defaultValue);
22
- }
23
-
24
- return defaultTo;
25
-
26
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).defaultTo=n()}(this,(function(){function e(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return"function"==typeof e?e.apply(void 0,n):e}return function(n,o){var t;return null!==(t=e(n))&&void 0!==t?t:e(o)}}));
@@ -1,13 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.either = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function either(a, b) {
8
- return !!a !== !!b;
9
- }
10
-
11
- return either;
12
-
13
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(e,n){return!!e!=!!n}:"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).either=function(e,n){return!!e!=!!n}}(this,(function(){return function(e,n){return!!e!=!!n}}));
@@ -1,16 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.genId = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- /**
8
- * @returns a unique numeric id.
9
- */
10
- var genId = (function (n) { return function () {
11
- return "".concat(n++);
12
- }; })(0);
13
-
14
- return genId;
15
-
16
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).genId=n()}(this,(function(){return e=0,function(){return"".concat(e++)};var e}));
@@ -1,16 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global['function hasOwnProperty() { [native code] }'] = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- /**
8
- * A safe hasOwnProperty access
9
- */
10
- function hasOwnProperty(obj, key) {
11
- return Object.prototype.hasOwnProperty.call(obj, key);
12
- }
13
-
14
- return hasOwnProperty;
15
-
16
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self)["function hasOwnProperty() { [native code] }"]=t()}(this,(function(){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}));
@@ -1,42 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.invariant = {}));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- function isFunction(value) {
8
- return typeof value === 'function';
9
- }
10
-
11
- function optionalFunctionValue(value) {
12
- var args = [];
13
- for (var _i = 1; _i < arguments.length; _i++) {
14
- args[_i - 1] = arguments[_i];
15
- }
16
- return isFunction(value) ? value.apply(void 0, args) : value;
17
- }
18
-
19
- function invariant(condition,
20
- // eslint-disable-next-line @typescript-eslint/ban-types
21
- message) {
22
- if (condition) {
23
- return;
24
- }
25
- // If message is a string object (rather than string literal)
26
- // Throw the value directly as a string
27
- // Alternatively, throw an error with the message
28
- throw message instanceof String
29
- ? message.valueOf()
30
- : new Error(message ? optionalFunctionValue(message) : message);
31
- }
32
- // eslint-disable-next-line @typescript-eslint/ban-types
33
- function StringObject(value) {
34
- return new String(optionalFunctionValue(value));
35
- }
36
-
37
- exports.StringObject = StringObject;
38
- exports.default = invariant;
39
-
40
- Object.defineProperty(exports, '__esModule', { value: true });
41
-
42
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).invariant={})}(this,(function(e){function n(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return"function"==typeof e?e.apply(void 0,n):e}e.StringObject=function(e){return new String(n(e))},e.default=function(e,t){if(!e)throw t instanceof String?t.valueOf():Error(t?n(t):t)},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,15 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.isBooleanValue = {}));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- function isBoolean(value) {
8
- return !!value === value;
9
- }
10
-
11
- exports.isBoolean = isBoolean;
12
-
13
- Object.defineProperty(exports, '__esModule', { value: true });
14
-
15
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).isBooleanValue={})}(this,(function(e){e.isBoolean=function(e){return!!e===e},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,13 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.isFunction = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function isFunction(value) {
8
- return typeof value === 'function';
9
- }
10
-
11
- return isFunction;
12
-
13
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(n){return"function"==typeof n}:"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).isFunction=function(n){return"function"==typeof n}}(this,(function(){return function(n){return"function"==typeof n}}));
@@ -1,41 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vest-utils/bindNot')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vest-utils/bindNot'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.isNullish = {}, global.bindNot$1));
5
- }(this, (function (exports, bindNot$1) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var bindNot__default = /*#__PURE__*/_interopDefaultLegacy(bindNot$1);
10
-
11
- function isNull(value) {
12
- return value === null;
13
- }
14
- bindNot__default['default'](isNull);
15
-
16
- function isUndefined(value) {
17
- return value === undefined;
18
- }
19
- bindNot__default['default'](isUndefined);
20
-
21
- function bindNot(fn) {
22
- return function () {
23
- var args = [];
24
- for (var _i = 0; _i < arguments.length; _i++) {
25
- args[_i] = arguments[_i];
26
- }
27
- return !fn.apply(void 0, args);
28
- };
29
- }
30
-
31
- function isNullish(value) {
32
- return isNull(value) || isUndefined(value);
33
- }
34
- var isNotNullish = bindNot(isNullish);
35
-
36
- exports.isNotNullish = isNotNullish;
37
- exports.isNullish = isNullish;
38
-
39
- Object.defineProperty(exports, '__esModule', { value: true });
40
-
41
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vest-utils/bindNot")):"function"==typeof define&&define.amd?define(["exports","vest-utils/bindNot"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).isNullish={},e.bindNot$1)}(this,(function(e,t){function n(e){return void 0===e}function i(e){return null===e||n(e)}var o;(t=t&&"object"==typeof t&&"default"in t?t:{default:t}).default((function(e){return null===e})),t.default(n),o=i,t=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!o.apply(void 0,e)},e.isNotNullish=t,e.isNullish=i,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,17 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.isPromise = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function isFunction(value) {
8
- return typeof value === 'function';
9
- }
10
-
11
- function isPromise(value) {
12
- return value && isFunction(value.then);
13
- }
14
-
15
- return isPromise;
16
-
17
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(e){return e&&"function"==typeof e.then}:"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).isPromise=function(e){return e&&"function"==typeof e.then}}(this,(function(){return function(e){return e&&"function"==typeof e.then}}));
@@ -1,15 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.isStringValue = {}));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- function isStringValue(v) {
8
- return String(v) === v;
9
- }
10
-
11
- exports.isStringValue = isStringValue;
12
-
13
- Object.defineProperty(exports, '__esModule', { value: true });
14
-
15
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).isStringValue={})}(this,(function(e){e.isStringValue=function(e){return String(e)===e},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,18 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.last = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function asArray(possibleArg) {
8
- return [].concat(possibleArg);
9
- }
10
-
11
- function last(values) {
12
- var valuesArray = asArray(values);
13
- return valuesArray[valuesArray.length - 1];
14
- }
15
-
16
- return last;
17
-
18
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=function(n){return(n=[].concat(n))[n.length-1]}:"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).last=function(n){return(n=[].concat(n))[n.length-1]}}(this,(function(){return function(n){return(n=[].concat(n))[n.length-1]}}));
@@ -1,26 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.mapFirst = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function mapFirst(array, callback) {
8
- var broke = false;
9
- var breakoutValue = null;
10
- for (var i = 0; i < array.length; i++) {
11
- callback(array[i], breakout, i);
12
- if (broke) {
13
- return breakoutValue;
14
- }
15
- }
16
- function breakout(conditional, value) {
17
- if (conditional) {
18
- broke = true;
19
- breakoutValue = value;
20
- }
21
- }
22
- }
23
-
24
- return mapFirst;
25
-
26
- })));