@inrixia/helpers 3.0.0 → 3.1.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 (142) hide show
  1. package/dist/conv.d.ts +27 -27
  2. package/dist/conv.d.ts.map +1 -1
  3. package/dist/conv.js +41 -41
  4. package/dist/fn/Promize.d.ts +15 -15
  5. package/dist/fn/Promize.js +24 -24
  6. package/dist/fn/Semaphore.d.ts +6 -6
  7. package/dist/fn/Semaphore.js +30 -30
  8. package/dist/fn/Semaphore.js.map +1 -1
  9. package/dist/fn/asyncDebounce.d.ts +1 -1
  10. package/dist/fn/asyncDebounce.d.ts.map +1 -1
  11. package/dist/fn/asyncDebounce.js +25 -25
  12. package/dist/fn/asyncDebounce.js.map +1 -1
  13. package/dist/fn/debounce.d.ts +1 -1
  14. package/dist/fn/debounce.d.ts.map +1 -1
  15. package/dist/fn/debounce.js +12 -12
  16. package/dist/fn/loopError.d.ts +10 -10
  17. package/dist/fn/loopError.d.ts.map +1 -1
  18. package/dist/fn/loopError.js +13 -13
  19. package/dist/fn/memoize.d.ts +1 -1
  20. package/dist/fn/memoize.d.ts.map +1 -1
  21. package/dist/fn/memoize.js +17 -17
  22. package/dist/fn/memoize.js.map +1 -1
  23. package/dist/fn/retry.d.ts +6 -7
  24. package/dist/fn/retry.d.ts.map +1 -1
  25. package/dist/fn/retry.js +25 -25
  26. package/dist/fn/retry.js.map +1 -1
  27. package/dist/fn/runFor.d.ts +1 -1
  28. package/dist/fn/runFor.d.ts.map +1 -1
  29. package/dist/fn/runFor.js +10 -10
  30. package/dist/fn/runFor.js.map +1 -1
  31. package/dist/fn/toBase64Image.d.ts +1 -1
  32. package/dist/fn/toBase64Image.d.ts.map +1 -1
  33. package/dist/fn/toBase64Image.js +13 -13
  34. package/dist/fn/toRange.d.ts +8 -8
  35. package/dist/fn/toRange.d.ts.map +1 -1
  36. package/dist/fn/toRange.js +25 -25
  37. package/dist/fn/toRange.js.map +1 -1
  38. package/dist/fs/exists.d.ts +1 -1
  39. package/dist/fs/exists.d.ts.map +1 -1
  40. package/dist/fs/exists.js +11 -11
  41. package/dist/fs/exists.js.map +1 -1
  42. package/dist/geo.d.ts +18 -18
  43. package/dist/geo.d.ts.map +1 -1
  44. package/dist/geo.js +31 -31
  45. package/dist/index.d.ts +36 -3
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +36 -3
  48. package/dist/index.js.map +1 -1
  49. package/dist/math/angleDifference.d.ts +8 -8
  50. package/dist/math/angleDifference.d.ts.map +1 -1
  51. package/dist/math/angleDifference.js +15 -15
  52. package/dist/math/nPad.d.ts +13 -13
  53. package/dist/math/nPad.d.ts.map +1 -1
  54. package/dist/math/nPad.js +18 -18
  55. package/dist/math/qRnd.d.ts +7 -7
  56. package/dist/math/qRnd.d.ts.map +1 -1
  57. package/dist/math/qRnd.js +10 -10
  58. package/dist/math/to360.d.ts +6 -6
  59. package/dist/math/to360.d.ts.map +1 -1
  60. package/dist/math/to360.js +9 -9
  61. package/dist/obj/RecursiveUpdateOptions.d.ts +14 -14
  62. package/dist/obj/RecursiveUpdateOptions.d.ts.map +1 -1
  63. package/dist/obj/RecursiveUpdateOptions.js +22 -22
  64. package/dist/obj/RecursiveUpdateOptions.js.map +1 -1
  65. package/dist/obj/chunkArray.d.ts +8 -8
  66. package/dist/obj/chunkArray.d.ts.map +1 -1
  67. package/dist/obj/chunkArray.js +16 -16
  68. package/dist/obj/compare.d.ts +23 -23
  69. package/dist/obj/compare.d.ts.map +1 -1
  70. package/dist/obj/compare.js +58 -58
  71. package/dist/obj/compare.js.map +1 -1
  72. package/dist/obj/deepGet.d.ts +16 -16
  73. package/dist/obj/deepGet.d.ts.map +1 -1
  74. package/dist/obj/deepGet.js +20 -20
  75. package/dist/obj/deepMerge.d.ts +7 -7
  76. package/dist/obj/deepMerge.d.ts.map +1 -1
  77. package/dist/obj/deepMerge.js +22 -22
  78. package/dist/obj/deepMerge.js.map +1 -1
  79. package/dist/obj/envOrThrow.d.ts +4 -4
  80. package/dist/obj/envOrThrow.d.ts.map +1 -1
  81. package/dist/obj/envOrThrow.js +9 -9
  82. package/dist/obj/fillTemplate.d.ts +17 -17
  83. package/dist/obj/fillTemplate.d.ts.map +1 -1
  84. package/dist/obj/fillTemplate.js +26 -26
  85. package/dist/obj/fillTemplate.js.map +1 -1
  86. package/dist/obj/getEnv.d.ts +10 -10
  87. package/dist/obj/getEnv.js +42 -42
  88. package/dist/obj/getEnv.js.map +1 -1
  89. package/dist/obj/hash.d.ts +1 -1
  90. package/dist/obj/hash.d.ts.map +1 -1
  91. package/dist/obj/hash.js +11 -11
  92. package/dist/obj/inspect.d.ts +25 -25
  93. package/dist/obj/inspect.d.ts.map +1 -1
  94. package/dist/obj/inspect.js +35 -35
  95. package/dist/obj/objectify.d.ts +14 -14
  96. package/dist/obj/objectify.d.ts.map +1 -1
  97. package/dist/obj/objectify.js +13 -13
  98. package/dist/obj/rebuildTypes.d.ts +5 -5
  99. package/dist/obj/rebuildTypes.d.ts.map +1 -1
  100. package/dist/obj/rebuildTypes.js +23 -23
  101. package/dist/obj/rebuildTypes.js.map +1 -1
  102. package/dist/test.d.ts +26 -26
  103. package/dist/test.d.ts.map +1 -1
  104. package/dist/test.js +68 -68
  105. package/dist/test.js.map +1 -1
  106. package/dist/ts/isKeyOf.d.ts +5 -5
  107. package/dist/ts/isKeyOf.d.ts.map +1 -1
  108. package/dist/ts/isKeyOf.js +4 -4
  109. package/dist/ts/isTypeOf.d.ts +11 -11
  110. package/dist/ts/isTypeOf.d.ts.map +1 -1
  111. package/dist/ts/isTypeOf.js +11 -11
  112. package/dist/ts/math.d.ts +11 -11
  113. package/dist/ts/math.js +1 -1
  114. package/dist/ts/numRange.d.ts +11 -11
  115. package/dist/ts/numRange.js +1 -1
  116. package/dist/ts/typeOf.d.ts +23 -23
  117. package/dist/ts/typeOf.d.ts.map +1 -1
  118. package/dist/ts/typeOf.js +27 -27
  119. package/dist/ts/typeOf.js.map +1 -1
  120. package/dist/ts/types.d.ts +30 -30
  121. package/dist/ts/types.js +1 -1
  122. package/package.json +5 -29
  123. package/dist/fn/index.d.ts +0 -11
  124. package/dist/fn/index.d.ts.map +0 -1
  125. package/dist/fn/index.js +0 -11
  126. package/dist/fn/index.js.map +0 -1
  127. package/dist/fs/index.d.ts +0 -2
  128. package/dist/fs/index.d.ts.map +0 -1
  129. package/dist/fs/index.js +0 -2
  130. package/dist/fs/index.js.map +0 -1
  131. package/dist/math/index.d.ts +0 -5
  132. package/dist/math/index.d.ts.map +0 -1
  133. package/dist/math/index.js +0 -5
  134. package/dist/math/index.js.map +0 -1
  135. package/dist/obj/index.d.ts +0 -13
  136. package/dist/obj/index.d.ts.map +0 -1
  137. package/dist/obj/index.js +0 -13
  138. package/dist/obj/index.js.map +0 -1
  139. package/dist/ts/index.d.ts +0 -7
  140. package/dist/ts/index.d.ts.map +0 -1
  141. package/dist/ts/index.js +0 -7
  142. package/dist/ts/index.js.map +0 -1
package/dist/fn/runFor.js CHANGED
@@ -1,11 +1,11 @@
1
- export const runFor = async (fn, timeoutMs) => {
2
- const expires = Date.now() + timeoutMs;
3
- while (true) {
4
- if (fn())
5
- return;
6
- if (Date.now() > expires)
7
- return;
8
- await new Promise((res) => setTimeout(res));
9
- }
10
- };
1
+ export const runFor = async (fn, timeoutMs) => {
2
+ const expires = Date.now() + timeoutMs;
3
+ while (true) {
4
+ if (fn())
5
+ return;
6
+ if (Date.now() > expires)
7
+ return;
8
+ await new Promise((res) => setTimeout(res));
9
+ }
10
+ };
11
11
  //# sourceMappingURL=runFor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runFor.js","sourceRoot":"","sources":["../../src/fn/runFor.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,EAAE,EAA0B,EAAE,SAAiB,EAAE,EAAE;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IACvC,OAAO,IAAI,EAAE;QACZ,IAAI,EAAE,EAAE;YAAE,OAAO;QACjB,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;YAAE,OAAO;QACjC,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;KAC5C;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"runFor.js","sourceRoot":"","sources":["../../src/fn/runFor.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,EAAE,EAA0B,EAAE,SAAiB,EAAE,EAAE;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IACvC,OAAO,IAAI,EAAE,CAAC;QACb,IAAI,EAAE,EAAE;YAAE,OAAO;QACjB,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;YAAE,OAAO;QACjC,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;AACF,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const toBase64: (file: File) => Promise<string | ArrayBuffer>;
1
+ export declare const toBase64: (file: File) => Promise<string | ArrayBuffer>;
2
2
  //# sourceMappingURL=toBase64Image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toBase64Image.d.ts","sourceRoot":"","sources":["../../src/fn/toBase64Image.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SAAgB,IAAI,KAAG,QAAQ,MAAM,GAAG,WAAW,CAUvE,CAAC"}
1
+ {"version":3,"file":"toBase64Image.d.ts","sourceRoot":"","sources":["../../src/fn/toBase64Image.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GAAU,MAAM,IAAI,KAAG,OAAO,CAAC,MAAM,GAAG,WAAW,CAUvE,CAAC"}
@@ -1,14 +1,14 @@
1
- export const toBase64 = async (file) => {
2
- const base64Image = await new Promise((resolve, reject) => {
3
- const reader = new FileReader();
4
- reader.readAsDataURL(file);
5
- reader.onload = () => resolve(reader.result);
6
- reader.onerror = reject;
7
- }).catch((err) => err);
8
- if (base64Image instanceof Error)
9
- throw new Error(`Failed to convert file ${file.name} to base64.\n${base64Image.message}`);
10
- if (base64Image === undefined || base64Image === null)
11
- throw new Error(`Failed to convert file ${file.name} to base64.`);
12
- return base64Image;
13
- };
1
+ export const toBase64 = async (file) => {
2
+ const base64Image = await new Promise((resolve, reject) => {
3
+ const reader = new FileReader();
4
+ reader.readAsDataURL(file);
5
+ reader.onload = () => resolve(reader.result);
6
+ reader.onerror = reject;
7
+ }).catch((err) => err);
8
+ if (base64Image instanceof Error)
9
+ throw new Error(`Failed to convert file ${file.name} to base64.\n${base64Image.message}`);
10
+ if (base64Image === undefined || base64Image === null)
11
+ throw new Error(`Failed to convert file ${file.name} to base64.`);
12
+ return base64Image;
13
+ };
14
14
  //# sourceMappingURL=toBase64Image.js.map
@@ -1,9 +1,9 @@
1
- /**
2
- * @param array
3
- * @returns string containing ranges of numbers.
4
- * @example
5
- * const range = toRange([1, 2, 3, 12, 6, 7, 5, 27, 28, 29, 40, 41, 25, 42, 12])
6
- * // range = "1-3 & 5-7 & 12 & 25 & 27-29 & 40-42"
7
- */
8
- export declare const toRange: (array: number[]) => string;
1
+ /**
2
+ * @param array
3
+ * @returns string containing ranges of numbers.
4
+ * @example
5
+ * const range = toRange([1, 2, 3, 12, 6, 7, 5, 27, 28, 29, 40, 41, 25, 42, 12])
6
+ * // range = "1-3 & 5-7 & 12 & 25 & 27-29 & 40-42"
7
+ */
8
+ export declare const toRange: (array: number[]) => string;
9
9
  //# sourceMappingURL=toRange.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toRange.d.ts","sourceRoot":"","sources":["../../src/fn/toRange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,UAAW,MAAM,EAAE,KAAG,MAezC,CAAC"}
1
+ {"version":3,"file":"toRange.d.ts","sourceRoot":"","sources":["../../src/fn/toRange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,KAAG,MAezC,CAAC"}
@@ -1,26 +1,26 @@
1
- /**
2
- * @param array
3
- * @returns string containing ranges of numbers.
4
- * @example
5
- * const range = toRange([1, 2, 3, 12, 6, 7, 5, 27, 28, 29, 40, 41, 25, 42, 12])
6
- * // range = "1-3 & 5-7 & 12 & 25 & 27-29 & 40-42"
7
- */
8
- export const toRange = (array) => {
9
- array = array
10
- .filter((a, pos) => array.indexOf(a) === pos)
11
- .sort((a, b) => a - b)
12
- .map((a) => +a);
13
- let sum = `${array[0]}`;
14
- let lastValue = array[0];
15
- for (let i = 1; i <= array.length; i++) {
16
- if (!(array[i] - 1 === array[i - 1])) {
17
- if (array[i - 1] !== lastValue)
18
- sum += `-${array[i - 1]}`;
19
- if (array[i] !== undefined)
20
- sum += ` & ${array[i]}`;
21
- lastValue = array[i];
22
- }
23
- }
24
- return sum;
25
- };
1
+ /**
2
+ * @param array
3
+ * @returns string containing ranges of numbers.
4
+ * @example
5
+ * const range = toRange([1, 2, 3, 12, 6, 7, 5, 27, 28, 29, 40, 41, 25, 42, 12])
6
+ * // range = "1-3 & 5-7 & 12 & 25 & 27-29 & 40-42"
7
+ */
8
+ export const toRange = (array) => {
9
+ array = array
10
+ .filter((a, pos) => array.indexOf(a) === pos)
11
+ .sort((a, b) => a - b)
12
+ .map((a) => +a);
13
+ let sum = `${array[0]}`;
14
+ let lastValue = array[0];
15
+ for (let i = 1; i <= array.length; i++) {
16
+ if (!(array[i] - 1 === array[i - 1])) {
17
+ if (array[i - 1] !== lastValue)
18
+ sum += `-${array[i - 1]}`;
19
+ if (array[i] !== undefined)
20
+ sum += ` & ${array[i]}`;
21
+ lastValue = array[i];
22
+ }
23
+ }
24
+ return sum;
25
+ };
26
26
  //# sourceMappingURL=toRange.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toRange.js","sourceRoot":"","sources":["../../src/fn/toRange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAe,EAAU,EAAE;IAClD,KAAK,GAAG,KAAK;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;SAC5C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjB,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACrC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,SAAS;gBAAE,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC1D,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS;gBAAE,GAAG,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;SACrB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC"}
1
+ {"version":3,"file":"toRange.js","sourceRoot":"","sources":["../../src/fn/toRange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAe,EAAU,EAAE;IAClD,KAAK,GAAG,KAAK;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;SAC5C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjB,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,SAAS;gBAAE,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC1D,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS;gBAAE,GAAG,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACF,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const exists: (path: string) => Promise<boolean>;
1
+ export declare const exists: (path: string) => Promise<boolean>;
2
2
  //# sourceMappingURL=exists.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../src/fs/exists.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,SAAgB,MAAM,KAAG,QAAQ,OAAO,CAO1D,CAAC"}
1
+ {"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../src/fs/exists.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,OAAO,CAO1D,CAAC"}
package/dist/fs/exists.js CHANGED
@@ -1,12 +1,12 @@
1
- import fs from "fs/promises";
2
- import { constants } from "fs";
3
- export const exists = async (path) => {
4
- try {
5
- await fs.access(path, constants.F_OK);
6
- return true;
7
- }
8
- catch {
9
- return false;
10
- }
11
- };
1
+ import fs from "fs/promises";
2
+ import { constants } from "fs";
3
+ export const exists = async (path) => {
4
+ try {
5
+ await fs.access(path, constants.F_OK);
6
+ return true;
7
+ }
8
+ catch {
9
+ return false;
10
+ }
11
+ };
12
12
  //# sourceMappingURL=exists.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exists.js","sourceRoot":"","sources":["../../src/fs/exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,EAAE,IAAY,EAAoB,EAAE;IAC9D,IAAI;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;KACZ;IAAC,MAAM;QACP,OAAO,KAAK,CAAC;KACb;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"exists.js","sourceRoot":"","sources":["../../src/fs/exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,EAAE,IAAY,EAAoB,EAAE;IAC9D,IAAI,CAAC;QACJ,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,CAAC"}
package/dist/geo.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- /**
2
- * Converts latitude or longitude to degrees, minutes & seconds.
3
- * @param coord Latitude or longitude coordinate
4
- *
5
- * @returns Coordinate in degrees, minutes & seconds
6
- */
7
- export declare const toDMS: (coord: number) => {
8
- degrees: number;
9
- minutes: number;
10
- seconds: number;
11
- };
12
- export declare const toRad: (val: number) => number;
13
- /**
14
- * Returns the distance between two LatLong's in kilometers
15
- * @param pos1 [lat, long] coordinates
16
- * @param pos2 [lat, long] coordinates
17
- */
18
- export declare const getDistance: (pos1: [number, number], pos2: [number, number]) => number;
1
+ /**
2
+ * Converts latitude or longitude to degrees, minutes & seconds.
3
+ * @param coord Latitude or longitude coordinate
4
+ *
5
+ * @returns Coordinate in degrees, minutes & seconds
6
+ */
7
+ export declare const toDMS: (coord: number) => {
8
+ degrees: number;
9
+ minutes: number;
10
+ seconds: number;
11
+ };
12
+ export declare const toRad: (val: number) => number;
13
+ /**
14
+ * Returns the distance between two LatLong's in kilometers
15
+ * @param pos1 [lat, long] coordinates
16
+ * @param pos2 [lat, long] coordinates
17
+ */
18
+ export declare const getDistance: (pos1: [number, number], pos2: [number, number]) => number;
19
19
  //# sourceMappingURL=geo.d.ts.map
package/dist/geo.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"geo.d.ts","sourceRoot":"","sources":["../src/geo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,MAAM;aAAc,MAAM;aAAW,MAAM;aAAW,MAAM;CAOxF,CAAC;AAGF,eAAO,MAAM,KAAK,QAAS,MAAM,KAAG,MAA+B,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAU,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,MAS5E,CAAC"}
1
+ {"version":3,"file":"geo.d.ts","sourceRoot":"","sources":["../src/geo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAOxF,CAAC;AAGF,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,KAAG,MAA+B,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,MAS5E,CAAC"}
package/dist/geo.js CHANGED
@@ -1,32 +1,32 @@
1
- /**
2
- * Converts latitude or longitude to degrees, minutes & seconds.
3
- * @param coord Latitude or longitude coordinate
4
- *
5
- * @returns Coordinate in degrees, minutes & seconds
6
- */
7
- export const toDMS = (coord) => {
8
- const absolute = Math.abs(coord);
9
- const degrees = Math.floor(absolute);
10
- const minutesNotTruncated = (absolute - degrees) * 60;
11
- const minutes = Math.floor(minutesNotTruncated);
12
- const seconds = Math.floor((minutesNotTruncated - minutes) * 60);
13
- return { degrees, minutes, seconds };
14
- };
15
- // Converts numeric degrees to radians
16
- export const toRad = (val) => (val * Math.PI) / 180;
17
- /**
18
- * Returns the distance between two LatLong's in kilometers
19
- * @param pos1 [lat, long] coordinates
20
- * @param pos2 [lat, long] coordinates
21
- */
22
- export const getDistance = (pos1, pos2) => {
23
- const [lat1, lon1] = pos1;
24
- const [lat2, lon2] = pos2;
25
- const R = 6371; // km
26
- const dLat = toRad(lat2 - lat1);
27
- const dLon = toRad(lon2 - lon1);
28
- const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(toRad(lat1)) * Math.cos(toRad(lat2));
29
- const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
30
- return R * c;
31
- };
1
+ /**
2
+ * Converts latitude or longitude to degrees, minutes & seconds.
3
+ * @param coord Latitude or longitude coordinate
4
+ *
5
+ * @returns Coordinate in degrees, minutes & seconds
6
+ */
7
+ export const toDMS = (coord) => {
8
+ const absolute = Math.abs(coord);
9
+ const degrees = Math.floor(absolute);
10
+ const minutesNotTruncated = (absolute - degrees) * 60;
11
+ const minutes = Math.floor(minutesNotTruncated);
12
+ const seconds = Math.floor((minutesNotTruncated - minutes) * 60);
13
+ return { degrees, minutes, seconds };
14
+ };
15
+ // Converts numeric degrees to radians
16
+ export const toRad = (val) => (val * Math.PI) / 180;
17
+ /**
18
+ * Returns the distance between two LatLong's in kilometers
19
+ * @param pos1 [lat, long] coordinates
20
+ * @param pos2 [lat, long] coordinates
21
+ */
22
+ export const getDistance = (pos1, pos2) => {
23
+ const [lat1, lon1] = pos1;
24
+ const [lat2, lon2] = pos2;
25
+ const R = 6371; // km
26
+ const dLat = toRad(lat2 - lat1);
27
+ const dLon = toRad(lon2 - lon1);
28
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(toRad(lat1)) * Math.cos(toRad(lat2));
29
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
30
+ return R * c;
31
+ };
32
32
  //# sourceMappingURL=geo.js.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,37 @@
1
- export * from "./conv.js";
2
- export * from "./geo.js";
3
- export * from "./test.js";
1
+ export * from "./conv.js";
2
+ export * from "./fn/Promize.js";
3
+ export * from "./fn/Semaphore.js";
4
+ export * from "./fn/asyncDebounce.js";
5
+ export * from "./fn/debounce.js";
6
+ export * from "./fn/loopError.js";
7
+ export * from "./fn/memoize.js";
8
+ export * from "./fn/retry.js";
9
+ export * from "./fn/runFor.js";
10
+ export * from "./fn/toBase64Image.js";
11
+ export * from "./fn/toRange.js";
12
+ export * from "./fs/exists.js";
13
+ export * from "./geo.js";
14
+ export * from "./math/angleDifference.js";
15
+ export * from "./math/nPad.js";
16
+ export * from "./math/qRnd.js";
17
+ export * from "./math/to360.js";
18
+ export * from "./obj/RecursiveUpdateOptions.js";
19
+ export * from "./obj/chunkArray.js";
20
+ export * from "./obj/compare.js";
21
+ export * from "./obj/deepGet.js";
22
+ export * from "./obj/deepMerge.js";
23
+ export * from "./obj/envOrThrow.js";
24
+ export * from "./obj/fillTemplate.js";
25
+ export * from "./obj/getEnv.js";
26
+ export * from "./obj/hash.js";
27
+ export * from "./obj/inspect.js";
28
+ export * from "./obj/objectify.js";
29
+ export * from "./obj/rebuildTypes.js";
30
+ export * from "./test.js";
31
+ export * from "./ts/isKeyOf.js";
32
+ export * from "./ts/isTypeOf.js";
33
+ export * from "./ts/math.js";
34
+ export * from "./ts/numRange.js";
35
+ export * from "./ts/typeOf.js";
36
+ export * from "./ts/types.js";
4
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,37 @@
1
- export * from "./conv.js";
2
- export * from "./geo.js";
3
- export * from "./test.js";
1
+ export * from "./conv.js";
2
+ export * from "./fn/Promize.js";
3
+ export * from "./fn/Semaphore.js";
4
+ export * from "./fn/asyncDebounce.js";
5
+ export * from "./fn/debounce.js";
6
+ export * from "./fn/loopError.js";
7
+ export * from "./fn/memoize.js";
8
+ export * from "./fn/retry.js";
9
+ export * from "./fn/runFor.js";
10
+ export * from "./fn/toBase64Image.js";
11
+ export * from "./fn/toRange.js";
12
+ export * from "./fs/exists.js";
13
+ export * from "./geo.js";
14
+ export * from "./math/angleDifference.js";
15
+ export * from "./math/nPad.js";
16
+ export * from "./math/qRnd.js";
17
+ export * from "./math/to360.js";
18
+ export * from "./obj/RecursiveUpdateOptions.js";
19
+ export * from "./obj/chunkArray.js";
20
+ export * from "./obj/compare.js";
21
+ export * from "./obj/deepGet.js";
22
+ export * from "./obj/deepMerge.js";
23
+ export * from "./obj/envOrThrow.js";
24
+ export * from "./obj/fillTemplate.js";
25
+ export * from "./obj/getEnv.js";
26
+ export * from "./obj/hash.js";
27
+ export * from "./obj/inspect.js";
28
+ export * from "./obj/objectify.js";
29
+ export * from "./obj/rebuildTypes.js";
30
+ export * from "./test.js";
31
+ export * from "./ts/isKeyOf.js";
32
+ export * from "./ts/isTypeOf.js";
33
+ export * from "./ts/math.js";
34
+ export * from "./ts/numRange.js";
35
+ export * from "./ts/typeOf.js";
36
+ export * from "./ts/types.js";
4
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1,9 +1,9 @@
1
- /**
2
- * Calculates the difference between two angles (0°-360°), `angle1` & `angle2` returned result is in decimal degrees and is signed.
3
- * @param angle1 First angle to compare
4
- * @param angle2 Second angle to compare
5
- * @param signed If the result is signed or absolute
6
- * @returns The difference in degrees
7
- */
8
- export declare const angleDifference: (angle1: number, angle2: number, signed?: boolean) => number;
1
+ /**
2
+ * Calculates the difference between two angles (0°-360°), `angle1` & `angle2` returned result is in decimal degrees and is signed.
3
+ * @param angle1 First angle to compare
4
+ * @param angle2 Second angle to compare
5
+ * @param signed If the result is signed or absolute
6
+ * @returns The difference in degrees
7
+ */
8
+ export declare const angleDifference: (angle1: number, angle2: number, signed?: boolean) => number;
9
9
  //# sourceMappingURL=angleDifference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"angleDifference.d.ts","sourceRoot":"","sources":["../../src/math/angleDifference.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,WAAY,MAAM,UAAU,MAAM,uBAAkB,MAO/E,CAAC"}
1
+ {"version":3,"file":"angleDifference.d.ts","sourceRoot":"","sources":["../../src/math/angleDifference.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,gBAAa,KAAG,MAO/E,CAAC"}
@@ -1,16 +1,16 @@
1
- /**
2
- * Calculates the difference between two angles (0°-360°), `angle1` & `angle2` returned result is in decimal degrees and is signed.
3
- * @param angle1 First angle to compare
4
- * @param angle2 Second angle to compare
5
- * @param signed If the result is signed or absolute
6
- * @returns The difference in degrees
7
- */
8
- export const angleDifference = (angle1, angle2, signed = true) => {
9
- let difference = Math.abs(angle1 - angle2) % 360;
10
- difference = difference > 180 ? 360 - difference : difference;
11
- // Calculate sign
12
- if (signed)
13
- return (angle1 - angle2 >= 0 && angle1 - angle2 <= 180) || (angle1 - angle2 <= -180 && angle1 - angle2 >= -360) ? difference : difference * -1;
14
- return difference;
15
- };
1
+ /**
2
+ * Calculates the difference between two angles (0°-360°), `angle1` & `angle2` returned result is in decimal degrees and is signed.
3
+ * @param angle1 First angle to compare
4
+ * @param angle2 Second angle to compare
5
+ * @param signed If the result is signed or absolute
6
+ * @returns The difference in degrees
7
+ */
8
+ export const angleDifference = (angle1, angle2, signed = true) => {
9
+ let difference = Math.abs(angle1 - angle2) % 360;
10
+ difference = difference > 180 ? 360 - difference : difference;
11
+ // Calculate sign
12
+ if (signed)
13
+ return (angle1 - angle2 >= 0 && angle1 - angle2 <= 180) || (angle1 - angle2 <= -180 && angle1 - angle2 >= -360) ? difference : difference * -1;
14
+ return difference;
15
+ };
16
16
  //# sourceMappingURL=angleDifference.js.map
@@ -1,14 +1,14 @@
1
- /**
2
- * Pad a number with 0's
3
- * @param num Number to pad.
4
- * @param zeros Number of digits returned number should have.
5
- *
6
- * @returns Padded number
7
- * @example
8
- * let paddedNumber = nPad(5)
9
- * // paddedNumber = "05"
10
- * let triplePaddedNumber = nPad(6, 3)
11
- * // triplePaddedNumber = "006"
12
- */
13
- export declare const nPad: (num: number | string, zeros?: number) => string;
1
+ /**
2
+ * Pad a number with 0's
3
+ * @param num Number to pad.
4
+ * @param zeros Number of digits returned number should have.
5
+ *
6
+ * @returns Padded number
7
+ * @example
8
+ * let paddedNumber = nPad(5)
9
+ * // paddedNumber = "05"
10
+ * let triplePaddedNumber = nPad(6, 3)
11
+ * // triplePaddedNumber = "006"
12
+ */
13
+ export declare const nPad: (num: number | string, zeros?: number) => string;
14
14
  //# sourceMappingURL=nPad.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nPad.d.ts","sourceRoot":"","sources":["../../src/math/nPad.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI,QAAS,MAAM,GAAG,MAAM,qBAAc,MAItD,CAAC"}
1
+ {"version":3,"file":"nPad.d.ts","sourceRoot":"","sources":["../../src/math/nPad.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,cAAS,KAAG,MAItD,CAAC"}
package/dist/math/nPad.js CHANGED
@@ -1,19 +1,19 @@
1
- /**
2
- * Pad a number with 0's
3
- * @param num Number to pad.
4
- * @param zeros Number of digits returned number should have.
5
- *
6
- * @returns Padded number
7
- * @example
8
- * let paddedNumber = nPad(5)
9
- * // paddedNumber = "05"
10
- * let triplePaddedNumber = nPad(6, 3)
11
- * // triplePaddedNumber = "006"
12
- */
13
- export const nPad = (num, zeros = 2) => {
14
- num = num.toString();
15
- while (num.length < zeros)
16
- num = "0" + num;
17
- return num;
18
- };
1
+ /**
2
+ * Pad a number with 0's
3
+ * @param num Number to pad.
4
+ * @param zeros Number of digits returned number should have.
5
+ *
6
+ * @returns Padded number
7
+ * @example
8
+ * let paddedNumber = nPad(5)
9
+ * // paddedNumber = "05"
10
+ * let triplePaddedNumber = nPad(6, 3)
11
+ * // triplePaddedNumber = "006"
12
+ */
13
+ export const nPad = (num, zeros = 2) => {
14
+ num = num.toString();
15
+ while (num.length < zeros)
16
+ num = "0" + num;
17
+ return num;
18
+ };
19
19
  //# sourceMappingURL=nPad.js.map
@@ -1,8 +1,8 @@
1
- /**
2
- * Rounds a number to `digits` decimal places.
3
- * @param num Number to round
4
- * @param digits Decimal places to round to
5
- * @returns Rounded number
6
- */
7
- export declare const qRnd: (num: number, digits?: number) => number;
1
+ /**
2
+ * Rounds a number to `digits` decimal places.
3
+ * @param num Number to round
4
+ * @param digits Decimal places to round to
5
+ * @returns Rounded number
6
+ */
7
+ export declare const qRnd: (num: number, digits?: number) => number;
8
8
  //# sourceMappingURL=qRnd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"qRnd.d.ts","sourceRoot":"","sources":["../../src/math/qRnd.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,IAAI,QAAS,MAAM,sBAAe,MAG9C,CAAC"}
1
+ {"version":3,"file":"qRnd.d.ts","sourceRoot":"","sources":["../../src/math/qRnd.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,EAAE,eAAU,KAAG,MAG9C,CAAC"}
package/dist/math/qRnd.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * Rounds a number to `digits` decimal places.
3
- * @param num Number to round
4
- * @param digits Decimal places to round to
5
- * @returns Rounded number
6
- */
7
- export const qRnd = (num, digits = 0) => {
8
- digits = 10 ** digits;
9
- return ~~(num * digits) / digits;
10
- };
1
+ /**
2
+ * Rounds a number to `digits` decimal places.
3
+ * @param num Number to round
4
+ * @param digits Decimal places to round to
5
+ * @returns Rounded number
6
+ */
7
+ export const qRnd = (num, digits = 0) => {
8
+ digits = 10 ** digits;
9
+ return ~~(num * digits) / digits;
10
+ };
11
11
  //# sourceMappingURL=qRnd.js.map
@@ -1,7 +1,7 @@
1
- /**
2
- * Converts `angle` to 0°-360°
3
- * @param angle
4
- * @returns `angle` in 0-360°
5
- */
6
- export declare const to360: (angle: number) => number;
1
+ /**
2
+ * Converts `angle` to 0°-360°
3
+ * @param angle
4
+ * @returns `angle` in 0-360°
5
+ */
6
+ export declare const to360: (angle: number) => number;
7
7
  //# sourceMappingURL=to360.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to360.d.ts","sourceRoot":"","sources":["../../src/math/to360.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,KAAK,UAAW,MAAM,KAAG,MAGrC,CAAC"}
1
+ {"version":3,"file":"to360.d.ts","sourceRoot":"","sources":["../../src/math/to360.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,MAGrC,CAAC"}
@@ -1,10 +1,10 @@
1
- /**
2
- * Converts `angle` to 0°-360°
3
- * @param angle
4
- * @returns `angle` in 0-360°
5
- */
6
- export const to360 = (angle) => {
7
- angle = angle % 360;
8
- return angle < 0 ? angle + 360 : angle;
9
- };
1
+ /**
2
+ * Converts `angle` to 0°-360°
3
+ * @param angle
4
+ * @returns `angle` in 0-360°
5
+ */
6
+ export const to360 = (angle) => {
7
+ angle = angle % 360;
8
+ return angle < 0 ? angle + 360 : angle;
9
+ };
10
10
  //# sourceMappingURL=to360.js.map