@sparted/shared-library 0.0.12 → 0.0.14

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 (132) hide show
  1. package/_virtual/_tslib.js +11 -38
  2. package/_virtual/_tslib.js.map +1 -1
  3. package/array/array-to-map.js +6 -9
  4. package/array/array-to-map.js.map +1 -1
  5. package/array/get-values-from-keys.js +2 -2
  6. package/array/get-values-from-keys.js.map +1 -1
  7. package/date/constants.d.ts +4 -0
  8. package/date/constants.js +7 -0
  9. package/date/constants.js.map +1 -0
  10. package/date/convert.d.ts +2 -0
  11. package/date/convert.js +7 -0
  12. package/date/convert.js.map +1 -0
  13. package/date/format-minutes.d.ts +1 -0
  14. package/date/format-minutes.js +12 -0
  15. package/date/format-minutes.js.map +1 -0
  16. package/date/get-time-diff-as-string.d.ts +47 -0
  17. package/date/get-time-diff-as-string.js +124 -0
  18. package/date/get-time-diff-as-string.js.map +1 -0
  19. package/date/index.d.ts +4 -0
  20. package/date/index.js +4 -0
  21. package/date/index.js.map +1 -0
  22. package/formatting/format-number.d.ts +1 -0
  23. package/formatting/format-number.js +14 -0
  24. package/formatting/format-number.js.map +1 -0
  25. package/formatting/index.d.ts +1 -0
  26. package/formatting/index.js +2 -0
  27. package/formatting/index.js.map +1 -0
  28. package/fp/run-while.js +6 -7
  29. package/fp/run-while.js.map +1 -1
  30. package/http/encode-search-object.d.ts +7 -0
  31. package/http/encode-search-object.js +27 -0
  32. package/http/encode-search-object.js.map +1 -0
  33. package/http/fetch-with-timeout.d.ts +8 -0
  34. package/http/fetch-with-timeout.js +18 -0
  35. package/http/fetch-with-timeout.js.map +1 -0
  36. package/http/index.d.ts +2 -0
  37. package/http/index.js +3 -0
  38. package/http/index.js.map +1 -0
  39. package/index.d.ts +6 -0
  40. package/index.js +13 -0
  41. package/index.js.map +1 -1
  42. package/linked-list/apply-diff-linked-list.d.ts +2 -0
  43. package/linked-list/apply-diff-linked-list.js +27 -0
  44. package/linked-list/apply-diff-linked-list.js.map +1 -0
  45. package/linked-list/create-linked-list.d.ts +2 -0
  46. package/linked-list/create-linked-list.js +66 -0
  47. package/linked-list/create-linked-list.js.map +1 -0
  48. package/linked-list/find-linked-list.d.ts +2 -0
  49. package/linked-list/find-linked-list.js +24 -0
  50. package/linked-list/find-linked-list.js.map +1 -0
  51. package/linked-list/get-linked-list.d.ts +2 -0
  52. package/linked-list/get-linked-list.js +9 -0
  53. package/linked-list/get-linked-list.js.map +1 -0
  54. package/linked-list/index.d.ts +2 -0
  55. package/linked-list/index.js +2 -0
  56. package/linked-list/index.js.map +1 -0
  57. package/linked-list/insert-linked-list.d.ts +2 -0
  58. package/linked-list/insert-linked-list.js +28 -0
  59. package/linked-list/insert-linked-list.js.map +1 -0
  60. package/linked-list/linked-list-utils.d.ts +23 -0
  61. package/linked-list/linked-list-utils.js +96 -0
  62. package/linked-list/linked-list-utils.js.map +1 -0
  63. package/linked-list/reduce-linked-list.d.ts +2 -0
  64. package/linked-list/reduce-linked-list.js +17 -0
  65. package/linked-list/reduce-linked-list.js.map +1 -0
  66. package/linked-list/remove-linked-list.d.ts +2 -0
  67. package/linked-list/remove-linked-list.js +24 -0
  68. package/linked-list/remove-linked-list.js.map +1 -0
  69. package/linked-list/type.d.ts +34 -0
  70. package/linked-list/update-linked-list.d.ts +2 -0
  71. package/linked-list/update-linked-list.js +20 -0
  72. package/linked-list/update-linked-list.js.map +1 -0
  73. package/linked-list/walk-list-item-record.d.ts +15 -0
  74. package/linked-list/while-linked-list.d.ts +2 -0
  75. package/linked-list/while-linked-list.js +28 -0
  76. package/linked-list/while-linked-list.js.map +1 -0
  77. package/math/clamp-number.d.ts +2 -0
  78. package/math/clamp-number.js +9 -0
  79. package/math/clamp-number.js.map +1 -0
  80. package/math/index.d.ts +4 -0
  81. package/math/index.js +5 -0
  82. package/math/index.js.map +1 -0
  83. package/math/interpolate.d.ts +2 -0
  84. package/math/interpolate.js +16 -0
  85. package/math/interpolate.js.map +1 -0
  86. package/math/number-range.d.ts +6 -0
  87. package/math/number-range.js +12 -0
  88. package/math/number-range.js.map +1 -0
  89. package/math/random-number.d.ts +2 -0
  90. package/math/random-number.js +9 -0
  91. package/math/random-number.js.map +1 -0
  92. package/object/index.d.ts +1 -0
  93. package/object/index.js +2 -0
  94. package/object/index.js.map +1 -0
  95. package/object/merge-deep.d.ts +2 -0
  96. package/object/merge-deep.js +21 -0
  97. package/object/merge-deep.js.map +1 -0
  98. package/package.json +2 -1
  99. package/parsing/parse-boolean.js +1 -1
  100. package/parsing/parse-boolean.js.map +1 -1
  101. package/parsing/parse-enum.js +3 -3
  102. package/parsing/parse-enum.js.map +1 -1
  103. package/parsing/parse-number.js +2 -2
  104. package/parsing/parse-number.js.map +1 -1
  105. package/predicates/is-function.js +1 -1
  106. package/predicates/is-function.js.map +1 -1
  107. package/predicates/is-null.js +1 -1
  108. package/predicates/is-null.js.map +1 -1
  109. package/predicates/is-object.js +1 -1
  110. package/predicates/is-object.js.map +1 -1
  111. package/predicates/is-primitive.js +4 -4
  112. package/predicates/is-primitive.js.map +1 -1
  113. package/predicates/is-undefined.js +1 -1
  114. package/predicates/is-undefined.js.map +1 -1
  115. package/predicates/is-uuid.d.ts +1 -0
  116. package/promise/delay.d.ts +1 -0
  117. package/promise/delay.js +6 -0
  118. package/promise/delay.js.map +1 -0
  119. package/promise/execute-or-resolve-default.js +2 -2
  120. package/promise/execute-or-resolve-default.js.map +1 -1
  121. package/promise/execute-with-delay.d.ts +1 -1
  122. package/promise/execute-with-delay.js +6 -13
  123. package/promise/execute-with-delay.js.map +1 -1
  124. package/promise/index.d.ts +1 -0
  125. package/promise/index.js +1 -0
  126. package/promise/index.js.map +1 -1
  127. package/string/replace-in-template.js +8 -10
  128. package/string/replace-in-template.js.map +1 -1
  129. package/types/general.d.ts +1 -0
  130. package/types/index.d.ts +1 -0
  131. package/types/object.d.ts +13 -0
  132. package/types/search.d.ts +24 -0
@@ -0,0 +1,9 @@
1
+ import { assertNumberRange } from './number-range.js';
2
+
3
+ const randomNumber = ({ min, max }) => {
4
+ assertNumberRange({ min, max });
5
+ return Math.floor(Math.random() * (max - min) + min);
6
+ };
7
+
8
+ export { randomNumber };
9
+ //# sourceMappingURL=random-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-number.js","sources":["../../src/math/random-number.ts"],"sourcesContent":["import { assertNumberRange } from './number-range';\nimport type { NumberRange } from './number-range';\n\nexport const randomNumber = ({ min, max }: NumberRange) => {\n assertNumberRange({ min, max });\n\n return Math.floor(\n Math.random() * (max - min) + min,\n );\n};\n"],"names":[],"mappings":";;AAGa,MAAA,YAAY,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAe,KAAI;AACxD,IAAA,iBAAiB,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAEhC,IAAA,OAAO,IAAI,CAAC,KAAK,CACf,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAClC,CAAC;AACJ;;;;"}
@@ -0,0 +1 @@
1
+ export * from './merge-deep';
@@ -0,0 +1,2 @@
1
+ export { mergeDeep } from './merge-deep.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import type { DeepPartial } from '../types';
2
+ export declare const mergeDeep: <T>(a: T, b: DeepPartial<T>) => T;
@@ -0,0 +1,21 @@
1
+ // https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript/8511350#8511350
2
+ const isObject = (a) => typeof a === 'object' && a !== null;
3
+ const isValueType = (a) => (!isObject(a) || Array.isArray(a));
4
+ const mergeDeep = (a, b) => {
5
+ if (isValueType(a) || isValueType(b)) {
6
+ return b;
7
+ }
8
+ return Object.keys(b).reduce((acc, key) => {
9
+ if (!(key in a)) {
10
+ return acc;
11
+ }
12
+ if (b[key] === a[key]) {
13
+ return acc;
14
+ }
15
+ const merged = mergeDeep(a[key], b[key]);
16
+ return Object.assign(Object.assign({}, acc), { [key]: merged });
17
+ }, a);
18
+ };
19
+
20
+ export { mergeDeep };
21
+ //# sourceMappingURL=merge-deep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-deep.js","sources":["../../src/object/merge-deep.ts"],"sourcesContent":["import type { DeepPartial, ValueType } from '../types';\n\n// https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript/8511350#8511350\nconst isObject = (a: any) => typeof a === 'object' && a !== null;\nconst isValueType = (a: any): a is ValueType => (\n !isObject(a) || Array.isArray(a)\n);\n\nexport const mergeDeep = <T>(a: T, b: DeepPartial<T>): T => {\n if (isValueType(a) || isValueType(b)) {\n return b as T;\n }\n\n return (Object.keys(b) as (keyof T)[]).reduce((acc, key) => {\n if (!(key in a)) {\n return acc;\n }\n\n if (b[key] === a[key]) {\n return acc;\n }\n\n const merged = mergeDeep(a[key], (b[key] as DeepPartial<T[keyof T]>));\n\n return { ...acc, [key]: merged };\n }, a);\n};\n"],"names":[],"mappings":"AAEA;AACA,MAAM,QAAQ,GAAG,CAAC,CAAM,KAAK,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;AACjE,MAAM,WAAW,GAAG,CAAC,CAAM,MACzB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CACjC,CAAC;MAEW,SAAS,GAAG,CAAI,CAAI,EAAE,CAAiB,KAAO;IACzD,IAAI,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE;AACpC,QAAA,OAAO,CAAM,CAAC;AACf,KAAA;AAED,IAAA,OAAQ,MAAM,CAAC,IAAI,CAAC,CAAC,CAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACzD,QAAA,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE;AACf,YAAA,OAAO,GAAG,CAAC;AACZ,SAAA;QAED,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE;AACrB,YAAA,OAAO,GAAG,CAAC;AACZ,SAAA;AAED,QAAA,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC,CAAC,GAAG,CAA6B,CAAC,CAAC;AAEtE,QAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAY,GAAG,CAAE,EAAA,EAAA,CAAC,GAAG,GAAG,MAAM,EAAG,CAAA,CAAA;KAClC,EAAE,CAAC,CAAC,CAAC;AACR;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": "Thomas <duprethomasfr@gmail.com>",
6
6
  "license": "MIT",
@@ -24,6 +24,7 @@
24
24
  "jest": "^29.0.3",
25
25
  "jest-environment-jsdom": "^29.0.3",
26
26
  "jest-extended": "^3.1.0",
27
+ "jest-fetch-mock": "^3.0.3",
27
28
  "rollup": "^2.79.1",
28
29
  "rollup-plugin-typescript2": "^0.34.0",
29
30
  "ts-jest": "^29.0.2",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Parse a string to a boolean. Throw error if string is neither "true" nor "false"
3
3
  */
4
- var parseBoolean = function (value) {
4
+ const parseBoolean = (value) => {
5
5
  if (value !== 'true' && value !== 'false') {
6
6
  throw new Error('Cannot parse value');
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parse-boolean.js","sources":["../../src/parsing/parse-boolean.ts"],"sourcesContent":["/**\n * Parse a string to a boolean. Throw error if string is neither \"true\" nor \"false\"\n */\n export const parseBoolean = (value: string): boolean => {\n if (value !== 'true' && value !== 'false') {\n throw new Error('Cannot parse value');\n }\n\n return value === 'true';\n};\n"],"names":[],"mappings":"AAAA;;AAEG;AACK,IAAM,YAAY,GAAG,UAAC,KAAa,EAAA;AACzC,IAAA,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,EAAE;AACzC,QAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvC,KAAA;IAED,OAAO,KAAK,KAAK,MAAM,CAAC;AAC1B;;;;"}
1
+ {"version":3,"file":"parse-boolean.js","sources":["../../src/parsing/parse-boolean.ts"],"sourcesContent":["/**\n * Parse a string to a boolean. Throw error if string is neither \"true\" nor \"false\"\n */\n export const parseBoolean = (value: string): boolean => {\n if (value !== 'true' && value !== 'false') {\n throw new Error('Cannot parse value');\n }\n\n return value === 'true';\n};\n"],"names":[],"mappings":"AAAA;;AAEG;AACW,MAAA,YAAY,GAAG,CAAC,KAAa,KAAa;AACtD,IAAA,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,EAAE;AACzC,QAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvC,KAAA;IAED,OAAO,KAAK,KAAK,MAAM,CAAC;AAC1B;;;;"}
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Factory to build enum to parse a string to an enum. Throw error if string is not an enum value
3
3
  */
4
- var createEnumParser = function (enumType) { return (function (value) {
5
- var enumValues = Object.values(enumType);
4
+ const createEnumParser = (enumType) => ((value) => {
5
+ const enumValues = Object.values(enumType);
6
6
  if (!enumValues.includes(value)) {
7
7
  throw new Error('Can\'t parse this value');
8
8
  }
9
9
  return value;
10
- }); };
10
+ });
11
11
 
12
12
  export { createEnumParser };
13
13
  //# sourceMappingURL=parse-enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-enum.js","sources":["../../src/parsing/parse-enum.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Factory to build enum to parse a string to an enum. Throw error if string is not an enum value\n */\n export const createEnumParser = <E extends Record<string, Primitive>>(enumType: E) => (\n (value: string) => {\n const enumValues = Object.values(enumType);\n\n if (!enumValues.includes(value as any)) {\n throw new Error('Can\\'t parse this value');\n }\n\n return value as unknown as E;\n }\n);"],"names":[],"mappings":"AAEA;;AAEG;AACW,IAAA,gBAAgB,GAAG,UAAsC,QAAW,EAAK,EAAA,QACrF,UAAC,KAAa,EAAA;IACZ,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAE3C,IAAA,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAY,CAAC,EAAE;AACtC,QAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC5C,KAAA;AAED,IAAA,OAAO,KAAqB,CAAC;AAC/B,CAAC,EAToF;;;;"}
1
+ {"version":3,"file":"parse-enum.js","sources":["../../src/parsing/parse-enum.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Factory to build enum to parse a string to an enum. Throw error if string is not an enum value\n */\n export const createEnumParser = <E extends Record<string, Primitive>>(enumType: E) => (\n (value: string) => {\n const enumValues = Object.values(enumType);\n\n if (!enumValues.includes(value as any)) {\n throw new Error('Can\\'t parse this value');\n }\n\n return value as unknown as E;\n }\n);"],"names":[],"mappings":"AAEA;;AAEG;AACK,MAAM,gBAAgB,GAAG,CAAsC,QAAW,MAChF,CAAC,KAAa,KAAI;IAChB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAE3C,IAAA,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAY,CAAC,EAAE;AACtC,QAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC5C,KAAA;AAED,IAAA,OAAO,KAAqB,CAAC;AAC/B,CAAC;;;;"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Parse a string to a number. Throw error if string is NaN
3
3
  */
4
- var parseNumber = function (value) {
5
- var number = parseInt(value, 10);
4
+ const parseNumber = (value) => {
5
+ const number = parseInt(value, 10);
6
6
  if (Number.isNaN(number)) {
7
7
  throw new Error('Cannot parse value');
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parse-number.js","sources":["../../src/parsing/parse-number.ts"],"sourcesContent":["/**\n * Parse a string to a number. Throw error if string is NaN\n */\n export const parseNumber = (value: string): number => {\n const number = parseInt(value, 10);\n\n if (Number.isNaN(number)) {\n throw new Error('Cannot parse value');\n }\n\n return number;\n};"],"names":[],"mappings":"AAAA;;AAEG;AACK,IAAM,WAAW,GAAG,UAAC,KAAa,EAAA;IACxC,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEnC,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACxB,QAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvC,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
1
+ {"version":3,"file":"parse-number.js","sources":["../../src/parsing/parse-number.ts"],"sourcesContent":["/**\n * Parse a string to a number. Throw error if string is NaN\n */\n export const parseNumber = (value: string): number => {\n const number = parseInt(value, 10);\n\n if (Number.isNaN(number)) {\n throw new Error('Cannot parse value');\n }\n\n return number;\n};"],"names":[],"mappings":"AAAA;;AAEG;AACW,MAAA,WAAW,GAAG,CAAC,KAAa,KAAY;IACpD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEnC,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACxB,QAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvC,KAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
@@ -1,4 +1,4 @@
1
- var isFunction = function (value) {
1
+ const isFunction = (value) => {
2
2
  return typeof value === 'function';
3
3
  };
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"is-function.js","sources":["../../src/predicates/is-function.ts"],"sourcesContent":["export const isFunction = (value: any): value is Function => {\n return typeof value === 'function';\n};\n"],"names":[],"mappings":"AAAO,IAAM,UAAU,GAAG,UAAC,KAAU,EAAA;AACnC,IAAA,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC;;;;"}
1
+ {"version":3,"file":"is-function.js","sources":["../../src/predicates/is-function.ts"],"sourcesContent":["export const isFunction = (value: any): value is Function => {\n return typeof value === 'function';\n};\n"],"names":[],"mappings":"AAAa,MAAA,UAAU,GAAG,CAAC,KAAU,KAAuB;AAC1D,IAAA,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC;;;;"}
@@ -1,4 +1,4 @@
1
- var isNull = function (value) {
1
+ const isNull = (value) => {
2
2
  return value === null;
3
3
  };
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"is-null.js","sources":["../../src/predicates/is-null.ts"],"sourcesContent":["export const isNull = (value: any): value is null => {\n return value === null;\n};\n"],"names":[],"mappings":"AAAO,IAAM,MAAM,GAAG,UAAC,KAAU,EAAA;IAC/B,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB;;;;"}
1
+ {"version":3,"file":"is-null.js","sources":["../../src/predicates/is-null.ts"],"sourcesContent":["export const isNull = (value: any): value is null => {\n return value === null;\n};\n"],"names":[],"mappings":"AAAa,MAAA,MAAM,GAAG,CAAC,KAAU,KAAmB;IAClD,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB;;;;"}
@@ -1,4 +1,4 @@
1
- var isObject = function (value) {
1
+ const isObject = (value) => {
2
2
  return typeof value === 'object';
3
3
  };
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"is-object.js","sources":["../../src/predicates/is-object.ts"],"sourcesContent":["export const isObject = (value: any): value is Object => {\n return typeof value === 'object';\n};\n"],"names":[],"mappings":"AAAO,IAAM,QAAQ,GAAG,UAAC,KAAU,EAAA;AACjC,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC;;;;"}
1
+ {"version":3,"file":"is-object.js","sources":["../../src/predicates/is-object.ts"],"sourcesContent":["export const isObject = (value: any): value is Object => {\n return typeof value === 'object';\n};\n"],"names":[],"mappings":"AAAa,MAAA,QAAQ,GAAG,CAAC,KAAU,KAAqB;AACtD,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC;;;;"}
@@ -1,16 +1,16 @@
1
- var PRIMITIVE_TYPES = [
1
+ const PRIMITIVE_TYPES = [
2
2
  'string',
3
3
  'boolean',
4
4
  'number',
5
5
  ];
6
- var isPrimitive = function (value) {
6
+ const isPrimitive = (value) => {
7
7
  return PRIMITIVE_TYPES.includes(typeof value);
8
8
  };
9
- var isArrayOfPrimitive = function (value) {
9
+ const isArrayOfPrimitive = (value) => {
10
10
  if (!Array.isArray(value)) {
11
11
  return false;
12
12
  }
13
- return value.every(function (arrayValue) { return isPrimitive(arrayValue); });
13
+ return value.every((arrayValue) => isPrimitive(arrayValue));
14
14
  };
15
15
 
16
16
  export { isArrayOfPrimitive, isPrimitive };
@@ -1 +1 @@
1
- {"version":3,"file":"is-primitive.js","sources":["../../src/predicates/is-primitive.ts"],"sourcesContent":["import { Primitive } from '../types/general';\n\nconst PRIMITIVE_TYPES = [\n 'string',\n 'boolean',\n 'number',\n];\n\nexport const isPrimitive = (value: any): value is Primitive => {\n return PRIMITIVE_TYPES.includes(typeof value);\n};\n\nexport const isArrayOfPrimitive = (value: any): value is Array<Primitive> => {\n if (!Array.isArray(value)) {\n return false;\n }\n\n return value.every((arrayValue) => isPrimitive(arrayValue));\n};\n"],"names":[],"mappings":"AAEA,IAAM,eAAe,GAAG;IACtB,QAAQ;IACR,SAAS;IACT,QAAQ;CACT,CAAC;AAEK,IAAM,WAAW,GAAG,UAAC,KAAU,EAAA;AACpC,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAChD,EAAE;AAEK,IAAM,kBAAkB,GAAG,UAAC,KAAU,EAAA;AAC3C,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;AAED,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,UAAC,UAAU,EAAA,EAAK,OAAA,WAAW,CAAC,UAAU,CAAC,CAAvB,EAAuB,CAAC,CAAC;AAC9D;;;;"}
1
+ {"version":3,"file":"is-primitive.js","sources":["../../src/predicates/is-primitive.ts"],"sourcesContent":["import { Primitive } from '../types/general';\n\nconst PRIMITIVE_TYPES = [\n 'string',\n 'boolean',\n 'number',\n];\n\nexport const isPrimitive = (value: any): value is Primitive => {\n return PRIMITIVE_TYPES.includes(typeof value);\n};\n\nexport const isArrayOfPrimitive = (value: any): value is Array<Primitive> => {\n if (!Array.isArray(value)) {\n return false;\n }\n\n return value.every((arrayValue) => isPrimitive(arrayValue));\n};\n"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,SAAS;IACT,QAAQ;CACT,CAAC;AAEW,MAAA,WAAW,GAAG,CAAC,KAAU,KAAwB;AAC5D,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAChD,EAAE;AAEW,MAAA,kBAAkB,GAAG,CAAC,KAAU,KAA+B;AAC1E,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;AAED,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,UAAU,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;AAC9D;;;;"}
@@ -1,4 +1,4 @@
1
- var isUndefined = function (value) {
1
+ const isUndefined = (value) => {
2
2
  return value === undefined;
3
3
  };
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"is-undefined.js","sources":["../../src/predicates/is-undefined.ts"],"sourcesContent":["export const isUndefined = (value: any): value is undefined => {\n return value === undefined;\n};\n"],"names":[],"mappings":"AAAO,IAAM,WAAW,GAAG,UAAC,KAAU,EAAA;IACpC,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B;;;;"}
1
+ {"version":3,"file":"is-undefined.js","sources":["../../src/predicates/is-undefined.ts"],"sourcesContent":["export const isUndefined = (value: any): value is undefined => {\n return value === undefined;\n};\n"],"names":[],"mappings":"AAAa,MAAA,WAAW,GAAG,CAAC,KAAU,KAAwB;IAC5D,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B;;;;"}
@@ -0,0 +1 @@
1
+ export declare const isUuidV4: (arg: any) => arg is string;
@@ -0,0 +1 @@
1
+ export declare const delay: (time: number) => Promise<unknown>;
@@ -0,0 +1,6 @@
1
+ const delay = (time) => new Promise((resolve) => {
2
+ setTimeout(resolve, time);
3
+ });
4
+
5
+ export { delay };
6
+ //# sourceMappingURL=delay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delay.js","sources":["../../src/promise/delay.ts"],"sourcesContent":["export const delay = (time: number) => new Promise((resolve) => {\n setTimeout(resolve, time);\n});\n"],"names":[],"mappings":"AAAO,MAAM,KAAK,GAAG,CAAC,IAAY,KAAK,IAAI,OAAO,CAAC,CAAC,OAAO,KAAI;AAC7D,IAAA,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
- var executeOrResolveDefault = function (callback, config) {
2
- var execute = config.execute, defaultValue = config.defaultValue;
1
+ const executeOrResolveDefault = (callback, config) => {
2
+ const { execute, defaultValue } = config;
3
3
  if (execute) {
4
4
  return callback();
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"execute-or-resolve-default.js","sources":["../../src/promise/execute-or-resolve-default.ts"],"sourcesContent":["export type ExecutionConfig<Default> = {\n execute: boolean,\n defaultValue: Default,\n};\n\nexport const executeOrResolveDefault = <T, Default>(callback: () => Promise<T>, config: ExecutionConfig<Default>): Promise<T | Default> => {\n const { execute, defaultValue } = config;\n\n if (execute) {\n return callback();\n }\n\n return Promise.resolve(defaultValue);\n};\n"],"names":[],"mappings":"AAKa,IAAA,uBAAuB,GAAG,UAAa,QAA0B,EAAE,MAAgC,EAAA;IACtG,IAAA,OAAO,GAAmB,MAAM,CAAA,OAAzB,EAAE,YAAY,GAAK,MAAM,CAAA,YAAX,CAAY;AAEzC,IAAA,IAAI,OAAO,EAAE;QACX,OAAO,QAAQ,EAAE,CAAC;AACnB,KAAA;AAED,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC;;;;"}
1
+ {"version":3,"file":"execute-or-resolve-default.js","sources":["../../src/promise/execute-or-resolve-default.ts"],"sourcesContent":["export type ExecutionConfig<Default> = {\n execute: boolean,\n defaultValue: Default,\n};\n\nexport const executeOrResolveDefault = <T, Default>(callback: () => Promise<T>, config: ExecutionConfig<Default>): Promise<T | Default> => {\n const { execute, defaultValue } = config;\n\n if (execute) {\n return callback();\n }\n\n return Promise.resolve(defaultValue);\n};\n"],"names":[],"mappings":"MAKa,uBAAuB,GAAG,CAAa,QAA0B,EAAE,MAAgC,KAA0B;AACxI,IAAA,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;AAEzC,IAAA,IAAI,OAAO,EAAE;QACX,OAAO,QAAQ,EAAE,CAAC;AACnB,KAAA;AAED,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC;;;;"}
@@ -1 +1 @@
1
- export declare const executeWithDelay: <T>(callback: () => T, delay: number) => Promise<T>;
1
+ export declare const executeWithDelay: <T>(callback: () => T, time: number) => Promise<T>;
@@ -1,17 +1,10 @@
1
- import { __awaiter, __generator } from '../_virtual/_tslib.js';
1
+ import { __awaiter } from '../_virtual/_tslib.js';
2
+ import { delay } from './delay.js';
2
3
 
3
- var executeWithDelay = function (callback, delay) { return __awaiter(void 0, void 0, void 0, function () {
4
- return __generator(this, function (_a) {
5
- switch (_a.label) {
6
- case 0: return [4 /*yield*/, new Promise(function (resolve) {
7
- setTimeout(resolve, delay);
8
- })];
9
- case 1:
10
- _a.sent();
11
- return [2 /*return*/, callback()];
12
- }
13
- });
14
- }); };
4
+ const executeWithDelay = (callback, time) => __awaiter(void 0, void 0, void 0, function* () {
5
+ yield delay(time);
6
+ return callback();
7
+ });
15
8
 
16
9
  export { executeWithDelay };
17
10
  //# sourceMappingURL=execute-with-delay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute-with-delay.js","sources":["../../src/promise/execute-with-delay.ts"],"sourcesContent":["export const executeWithDelay = async <T>(callback: () => T, delay: number): Promise<T> => {\n await new Promise((resolve) => {\n setTimeout(resolve, delay);\n });\n\n return callback();\n};\n"],"names":[],"mappings":";;AAAa,IAAA,gBAAgB,GAAG,UAAU,QAAiB,EAAE,KAAa,EAAA,EAAA,OAAA,SAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,YAAA;;;AACxE,YAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,IAAI,OAAO,CAAC,UAAC,OAAO,EAAA;AACxB,oBAAA,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7B,iBAAC,CAAC,CAAA,CAAA;;AAFF,gBAAA,EAAA,CAAA,IAAA,EAEE,CAAC;gBAEH,OAAO,CAAA,CAAA,aAAA,QAAQ,EAAE,CAAC,CAAA;;;;;;;"}
1
+ {"version":3,"file":"execute-with-delay.js","sources":["../../src/promise/execute-with-delay.ts"],"sourcesContent":["import { delay } from './delay';\n\nexport const executeWithDelay = async <T>(callback: () => T, time: number): Promise<T> => {\n await delay(time);\n return callback();\n};\n"],"names":[],"mappings":";;;MAEa,gBAAgB,GAAG,CAAU,QAAiB,EAAE,IAAY,KAAgB,SAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;AACvF,IAAA,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,QAAQ,EAAE,CAAC;AACpB,CAAC;;;;"}
@@ -1,2 +1,3 @@
1
1
  export * from './execute-or-resolve-default';
2
2
  export * from './execute-with-delay';
3
+ export * from './delay';
package/promise/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { executeOrResolveDefault } from './execute-or-resolve-default.js';
2
2
  export { executeWithDelay } from './execute-with-delay.js';
3
+ export { delay } from './delay.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,6 +1,6 @@
1
1
  import { isPrimitive, isArrayOfPrimitive } from '../predicates/is-primitive.js';
2
2
 
3
- var defaultConfig = {
3
+ const defaultConfig = {
4
4
  delimiter: {
5
5
  left: '{{',
6
6
  right: '}}',
@@ -13,20 +13,18 @@ var defaultConfig = {
13
13
  *
14
14
  * Uses the mustache syntax by default.
15
15
  */
16
- var replaceInTemplate = function (template, params, config) {
17
- if (config === void 0) { config = defaultConfig; }
18
- var delimiter = config.delimiter;
19
- var leftDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.left;
20
- var rightDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.right;
16
+ const replaceInTemplate = (template, params, config = defaultConfig) => {
17
+ const { delimiter } = config;
18
+ const leftDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.left;
19
+ const rightDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.right;
21
20
  return Object
22
21
  .entries(params)
23
- .reduce(function (acc, _a) {
24
- var key = _a[0], value = _a[1];
22
+ .reduce((acc, [key, value]) => {
25
23
  if (!isPrimitive(value) && !isArrayOfPrimitive(value)) {
26
24
  return acc;
27
25
  }
28
- var searchValue = "".concat(leftDelimiter).concat(key).concat(rightDelimiter);
29
- var replaceBy = Array.isArray(value) ? value.join(', ') : String(value);
26
+ const searchValue = `${leftDelimiter}${key}${rightDelimiter}`;
27
+ const replaceBy = Array.isArray(value) ? value.join(', ') : String(value);
30
28
  return acc.replace(searchValue, replaceBy);
31
29
  }, template);
32
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"replace-in-template.js","sources":["../../src/string/replace-in-template.ts"],"sourcesContent":["import { isArrayOfPrimitive, isPrimitive } from '../predicates';\n\nexport type ReplaceConfig = {\n delimiter: string | {\n left: string,\n right: string,\n },\n};\n\nconst defaultConfig: ReplaceConfig = {\n delimiter: {\n left: '{{',\n right: '}}',\n },\n};\n\n/**\n * Replace string inside a template. For now, only works with\n * an object containing promirives or array of primitives. If\n * it contains other objects, they will be ignored.\n *\n * Uses the mustache syntax by default.\n */\nexport const replaceInTemplate = (\n template: string,\n params: Record<string, any>,\n config: ReplaceConfig = defaultConfig,\n) => {\n const { delimiter } = config;\n const leftDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.left;\n const rightDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.right;\n\n return Object\n .entries(params)\n .reduce((acc, [key, value]) => {\n if (!isPrimitive(value) && !isArrayOfPrimitive(value)) {\n return acc;\n }\n\n const searchValue = `${leftDelimiter}${key}${rightDelimiter}`;\n const replaceBy = Array.isArray(value) ? value.join(', ') : String(value);\n\n return acc.replace(searchValue, replaceBy);\n }, template);\n};\n"],"names":[],"mappings":";;AASA,IAAM,aAAa,GAAkB;AACnC,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA;CACF,CAAC;AAEF;;;;;;AAMG;IACU,iBAAiB,GAAG,UAC/B,QAAgB,EAChB,MAA2B,EAC3B,MAAqC,EAAA;AAArC,IAAA,IAAA,MAAA,KAAA,KAAA,CAAA,EAAA,EAAA,MAAqC,GAAA,aAAA,CAAA,EAAA;AAE7B,IAAA,IAAA,SAAS,GAAK,MAAM,CAAA,SAAX,CAAY;AAC7B,IAAA,IAAM,aAAa,GAAG,OAAO,SAAS,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AACjF,IAAA,IAAM,cAAc,GAAG,OAAO,SAAS,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC;AAEnF,IAAA,OAAO,MAAM;SACV,OAAO,CAAC,MAAM,CAAC;AACf,SAAA,MAAM,CAAC,UAAC,GAAG,EAAE,EAAY,EAAA;YAAX,GAAG,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,KAAK,GAAA,EAAA,CAAA,CAAA,CAAA,CAAA;QACvB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;AACrD,YAAA,OAAO,GAAG,CAAC;AACZ,SAAA;QAED,IAAM,WAAW,GAAG,EAAG,CAAA,MAAA,CAAA,aAAa,SAAG,GAAG,CAAA,CAAA,MAAA,CAAG,cAAc,CAAE,CAAC;QAC9D,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1E,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;KAC5C,EAAE,QAAQ,CAAC,CAAC;AACjB;;;;"}
1
+ {"version":3,"file":"replace-in-template.js","sources":["../../src/string/replace-in-template.ts"],"sourcesContent":["import { isArrayOfPrimitive, isPrimitive } from '../predicates';\n\nexport type ReplaceConfig = {\n delimiter: string | {\n left: string,\n right: string,\n },\n};\n\nconst defaultConfig: ReplaceConfig = {\n delimiter: {\n left: '{{',\n right: '}}',\n },\n};\n\n/**\n * Replace string inside a template. For now, only works with\n * an object containing promirives or array of primitives. If\n * it contains other objects, they will be ignored.\n *\n * Uses the mustache syntax by default.\n */\nexport const replaceInTemplate = (\n template: string,\n params: Record<string, any>,\n config: ReplaceConfig = defaultConfig,\n) => {\n const { delimiter } = config;\n const leftDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.left;\n const rightDelimiter = typeof delimiter === 'string' ? delimiter : delimiter.right;\n\n return Object\n .entries(params)\n .reduce((acc, [key, value]) => {\n if (!isPrimitive(value) && !isArrayOfPrimitive(value)) {\n return acc;\n }\n\n const searchValue = `${leftDelimiter}${key}${rightDelimiter}`;\n const replaceBy = Array.isArray(value) ? value.join(', ') : String(value);\n\n return acc.replace(searchValue, replaceBy);\n }, template);\n};\n"],"names":[],"mappings":";;AASA,MAAM,aAAa,GAAkB;AACnC,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,KAAK,EAAE,IAAI;AACZ,KAAA;CACF,CAAC;AAEF;;;;;;AAMG;AACI,MAAM,iBAAiB,GAAG,CAC/B,QAAgB,EAChB,MAA2B,EAC3B,MAAA,GAAwB,aAAa,KACnC;AACF,IAAA,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;AAC7B,IAAA,MAAM,aAAa,GAAG,OAAO,SAAS,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AACjF,IAAA,MAAM,cAAc,GAAG,OAAO,SAAS,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC;AAEnF,IAAA,OAAO,MAAM;SACV,OAAO,CAAC,MAAM,CAAC;SACf,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;QAC5B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;AACrD,YAAA,OAAO,GAAG,CAAC;AACZ,SAAA;QAED,MAAM,WAAW,GAAG,CAAG,EAAA,aAAa,GAAG,GAAG,CAAA,EAAG,cAAc,CAAA,CAAE,CAAC;QAC9D,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1E,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;KAC5C,EAAE,QAAQ,CAAC,CAAC;AACjB;;;;"}
@@ -1,2 +1,3 @@
1
1
  export declare type Primitive = string | number | boolean;
2
2
  export declare type Nullable<T> = T | null;
3
+ export declare type ValueType = Primitive | null | void | Array<any> | ReadonlyArray<any>;
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './function';
2
2
  export * from './general';
3
3
  export * from './object';
4
+ export * from './search';
package/types/object.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ValueType } from './general';
1
2
  export declare type NonMethodKeys<T> = {
2
3
  [P in keyof T]: T[P] extends Function ? never : P;
3
4
  }[keyof T];
@@ -20,3 +21,15 @@ export declare type ClassType<T> = {
20
21
  new (...args: any[]): T;
21
22
  };
22
23
  export declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
24
+ export declare type DeepPartial<T> = T extends ValueType ? T : {
25
+ [P in keyof T]?: DeepPartial<T[P]>;
26
+ };
27
+ export declare type Intersection<A, B> = {
28
+ [P in keyof A & keyof B]: A[P] | B[P];
29
+ };
30
+ /**
31
+ * Helper type. Passes T out again, but boxes it in a way that it cannot
32
+ * "widen" the type by accident if it is a generic that should be inferred
33
+ * from elsewhere.
34
+ */
35
+ export declare type NoInfer<T> = [T][T extends any ? 0 : never];
@@ -0,0 +1,24 @@
1
+ export declare type SearchSortBy = string;
2
+ export declare type SearchSortOrder = 'asc' | 'desc';
3
+ export declare type SearchSort = {
4
+ [by: SearchSortBy]: SearchSortOrder;
5
+ };
6
+ export declare type SearchQueryProperty = string;
7
+ export declare type SearchQueryValue = string;
8
+ export declare type SearchQuery = {
9
+ [property: SearchQueryProperty]: SearchQueryValue;
10
+ };
11
+ export declare type SearchObject = {
12
+ offset: number;
13
+ limit: number;
14
+ sort?: Record<string, SearchSortOrder>;
15
+ query?: SearchQuery;
16
+ };
17
+ export declare type SearchResponse<T> = {
18
+ items: ReadonlyArray<T>;
19
+ offset: number;
20
+ limit: number;
21
+ total: number;
22
+ next: string | null;
23
+ previous: string | null;
24
+ };