@stryke/fs 0.33.32 → 0.33.34

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 (190) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -1
  3. package/dist/buffer.cjs +60 -1
  4. package/dist/buffer.mjs +56 -1
  5. package/dist/buffer.mjs.map +1 -1
  6. package/dist/chmod-x.cjs +93 -1
  7. package/dist/chmod-x.mjs +87 -1
  8. package/dist/chmod-x.mjs.map +1 -1
  9. package/dist/command-exists.cjs +102 -1
  10. package/dist/command-exists.mjs +100 -1
  11. package/dist/command-exists.mjs.map +1 -1
  12. package/dist/compress.cjs +29 -1
  13. package/dist/compress.mjs +28 -1
  14. package/dist/compress.mjs.map +1 -1
  15. package/dist/constants.mjs +1 -1
  16. package/dist/convert/src/array-buffer-to-string.cjs +19 -1
  17. package/dist/convert/src/array-buffer-to-string.mjs +18 -1
  18. package/dist/convert/src/array-buffer-to-string.mjs.map +1 -1
  19. package/dist/convert/src/to-array.cjs +15 -1
  20. package/dist/convert/src/to-array.mjs +14 -1
  21. package/dist/convert/src/to-array.mjs.map +1 -1
  22. package/dist/convert/src/uint8-array-to-string.cjs +15 -1
  23. package/dist/convert/src/uint8-array-to-string.mjs +15 -1
  24. package/dist/convert/src/uint8-array-to-string.mjs.map +1 -1
  25. package/dist/copy-file.cjs +87 -1
  26. package/dist/copy-file.mjs +83 -1
  27. package/dist/copy-file.mjs.map +1 -1
  28. package/dist/exists.cjs +27 -1
  29. package/dist/exists.mjs +25 -1
  30. package/dist/exists.mjs.map +1 -1
  31. package/dist/get-parent-path.cjs +35 -1
  32. package/dist/get-parent-path.mjs +34 -1
  33. package/dist/get-parent-path.mjs.map +1 -1
  34. package/dist/get-workspace-root.cjs +158 -1
  35. package/dist/get-workspace-root.mjs +150 -1
  36. package/dist/get-workspace-root.mjs.map +1 -1
  37. package/dist/helpers/src/get-unique.cjs +14 -1
  38. package/dist/helpers/src/get-unique.mjs +13 -1
  39. package/dist/helpers/src/get-unique.mjs.map +1 -1
  40. package/dist/helpers.cjs +83 -1
  41. package/dist/helpers.mjs +77 -1
  42. package/dist/helpers.mjs.map +1 -1
  43. package/dist/index.cjs +122 -1
  44. package/dist/index.mjs +25 -1
  45. package/dist/install.cjs +35 -1
  46. package/dist/install.mjs +33 -1
  47. package/dist/install.mjs.map +1 -1
  48. package/dist/is-file.cjs +51 -1
  49. package/dist/is-file.mjs +47 -1
  50. package/dist/is-file.mjs.map +1 -1
  51. package/dist/json/src/storm-json.cjs +117 -1
  52. package/dist/json/src/storm-json.mjs +115 -1
  53. package/dist/json/src/storm-json.mjs.map +1 -1
  54. package/dist/json/src/utils/code-frames.cjs +77 -3
  55. package/dist/json/src/utils/code-frames.mjs +76 -3
  56. package/dist/json/src/utils/code-frames.mjs.map +1 -1
  57. package/dist/json/src/utils/parse-error.cjs +34 -1
  58. package/dist/json/src/utils/parse-error.mjs +33 -1
  59. package/dist/json/src/utils/parse-error.mjs.map +1 -1
  60. package/dist/json/src/utils/parse.cjs +45 -1
  61. package/dist/json/src/utils/parse.mjs +45 -1
  62. package/dist/json/src/utils/parse.mjs.map +1 -1
  63. package/dist/json/src/utils/stringify.cjs +67 -1
  64. package/dist/json/src/utils/stringify.mjs +67 -1
  65. package/dist/json/src/utils/stringify.mjs.map +1 -1
  66. package/dist/json/src/utils/strip-comments.cjs +86 -4
  67. package/dist/json/src/utils/strip-comments.mjs +86 -4
  68. package/dist/json/src/utils/strip-comments.mjs.map +1 -1
  69. package/dist/json.cjs +74 -1
  70. package/dist/json.mjs +71 -1
  71. package/dist/json.mjs.map +1 -1
  72. package/dist/list-files.cjs +86 -1
  73. package/dist/list-files.mjs +79 -1
  74. package/dist/list-files.mjs.map +1 -1
  75. package/dist/package-fns.cjs +148 -1
  76. package/dist/package-fns.mjs +141 -1
  77. package/dist/package-fns.mjs.map +1 -1
  78. package/dist/path/src/append.cjs +57 -1
  79. package/dist/path/src/append.mjs +56 -1
  80. package/dist/path/src/append.mjs.map +1 -1
  81. package/dist/path/src/correct-path.cjs +138 -1
  82. package/dist/path/src/correct-path.mjs +134 -1
  83. package/dist/path/src/correct-path.mjs.map +1 -1
  84. package/dist/path/src/cwd.cjs +17 -1
  85. package/dist/path/src/cwd.mjs +16 -1
  86. package/dist/path/src/cwd.mjs.map +1 -1
  87. package/dist/path/src/file-path-fns.cjs +169 -1
  88. package/dist/path/src/file-path-fns.mjs +164 -1
  89. package/dist/path/src/file-path-fns.mjs.map +1 -1
  90. package/dist/path/src/is-parent-path.cjs +32 -1
  91. package/dist/path/src/is-parent-path.mjs +32 -1
  92. package/dist/path/src/is-parent-path.mjs.map +1 -1
  93. package/dist/path/src/is-root-dir.cjs +14 -1
  94. package/dist/path/src/is-root-dir.mjs +13 -1
  95. package/dist/path/src/is-root-dir.mjs.map +1 -1
  96. package/dist/path/src/is-type.cjs +68 -1
  97. package/dist/path/src/is-type.mjs +66 -1
  98. package/dist/path/src/is-type.mjs.map +1 -1
  99. package/dist/path/src/join-paths.cjs +106 -1
  100. package/dist/path/src/join-paths.mjs +106 -1
  101. package/dist/path/src/join-paths.mjs.map +1 -1
  102. package/dist/path/src/regex.cjs +18 -1
  103. package/dist/path/src/regex.mjs +11 -1
  104. package/dist/path/src/regex.mjs.map +1 -1
  105. package/dist/path/src/replace.cjs +24 -1
  106. package/dist/path/src/replace.mjs +24 -1
  107. package/dist/path/src/replace.mjs.map +1 -1
  108. package/dist/path/src/resolve-parent-path.cjs +18 -1
  109. package/dist/path/src/resolve-parent-path.mjs +18 -1
  110. package/dist/path/src/resolve-parent-path.mjs.map +1 -1
  111. package/dist/path/src/slash.cjs +15 -1
  112. package/dist/path/src/slash.mjs +14 -1
  113. package/dist/path/src/slash.mjs.map +1 -1
  114. package/dist/read-file.cjs +47 -1
  115. package/dist/read-file.mjs +43 -1
  116. package/dist/read-file.mjs.map +1 -1
  117. package/dist/registry.cjs +142 -1
  118. package/dist/registry.mjs +137 -1
  119. package/dist/registry.mjs.map +1 -1
  120. package/dist/remove-file.cjs +27 -1
  121. package/dist/remove-file.mjs +25 -1
  122. package/dist/remove-file.mjs.map +1 -1
  123. package/dist/resolve.cjs +228 -3
  124. package/dist/resolve.mjs +217 -3
  125. package/dist/resolve.mjs.map +1 -1
  126. package/dist/semver-fns.cjs +129 -1
  127. package/dist/semver-fns.mjs +119 -1
  128. package/dist/semver-fns.mjs.map +1 -1
  129. package/dist/string-format/src/package.cjs +92 -1
  130. package/dist/string-format/src/package.mjs +91 -1
  131. package/dist/string-format/src/package.mjs.map +1 -1
  132. package/dist/toml.cjs +66 -3
  133. package/dist/toml.mjs +61 -3
  134. package/dist/toml.mjs.map +1 -1
  135. package/dist/tsconfig.cjs +37 -1
  136. package/dist/tsconfig.mjs +35 -1
  137. package/dist/tsconfig.mjs.map +1 -1
  138. package/dist/type-checks/src/get-object-tag.cjs +15 -1
  139. package/dist/type-checks/src/get-object-tag.mjs +14 -1
  140. package/dist/type-checks/src/get-object-tag.mjs.map +1 -1
  141. package/dist/type-checks/src/index.cjs +14 -1
  142. package/dist/type-checks/src/index.mjs +16 -1
  143. package/dist/type-checks/src/is-buffer.cjs +12 -1
  144. package/dist/type-checks/src/is-buffer.mjs +11 -1
  145. package/dist/type-checks/src/is-buffer.mjs.map +1 -1
  146. package/dist/type-checks/src/is-collection.cjs +1 -1
  147. package/dist/type-checks/src/is-collection.mjs +3 -1
  148. package/dist/type-checks/src/is-empty.cjs +20 -1
  149. package/dist/type-checks/src/is-empty.mjs +20 -1
  150. package/dist/type-checks/src/is-empty.mjs.map +1 -1
  151. package/dist/type-checks/src/is-error.cjs +29 -1
  152. package/dist/type-checks/src/is-error.mjs +29 -1
  153. package/dist/type-checks/src/is-error.mjs.map +1 -1
  154. package/dist/type-checks/src/is-null.cjs +12 -1
  155. package/dist/type-checks/src/is-null.mjs +11 -1
  156. package/dist/type-checks/src/is-null.mjs.map +1 -1
  157. package/dist/type-checks/src/is-number.cjs +18 -1
  158. package/dist/type-checks/src/is-number.mjs +17 -1
  159. package/dist/type-checks/src/is-number.mjs.map +1 -1
  160. package/dist/type-checks/src/is-object.cjs +19 -1
  161. package/dist/type-checks/src/is-object.mjs +19 -1
  162. package/dist/type-checks/src/is-object.mjs.map +1 -1
  163. package/dist/type-checks/src/is-plain-object.cjs +64 -1
  164. package/dist/type-checks/src/is-plain-object.mjs +63 -1
  165. package/dist/type-checks/src/is-plain-object.mjs.map +1 -1
  166. package/dist/type-checks/src/is-set-string.cjs +20 -1
  167. package/dist/type-checks/src/is-set-string.mjs +20 -1
  168. package/dist/type-checks/src/is-set-string.mjs.map +1 -1
  169. package/dist/type-checks/src/is-set.cjs +19 -1
  170. package/dist/type-checks/src/is-set.mjs +19 -1
  171. package/dist/type-checks/src/is-set.mjs.map +1 -1
  172. package/dist/type-checks/src/is-string.cjs +12 -1
  173. package/dist/type-checks/src/is-string.mjs +11 -1
  174. package/dist/type-checks/src/is-string.mjs.map +1 -1
  175. package/dist/type-checks/src/is-undefined.cjs +8 -1
  176. package/dist/type-checks/src/is-undefined.mjs +7 -1
  177. package/dist/type-checks/src/is-undefined.mjs.map +1 -1
  178. package/dist/type-checks/src/type-detect.cjs +15 -1
  179. package/dist/type-checks/src/type-detect.mjs +16 -1
  180. package/dist/type-checks/src/type-detect.mjs.map +1 -1
  181. package/dist/types/src/base.cjs +6 -1
  182. package/dist/types/src/base.mjs +5 -1
  183. package/dist/types/src/base.mjs.map +1 -1
  184. package/dist/write-file.cjs +40 -1
  185. package/dist/write-file.mjs +38 -1
  186. package/dist/write-file.mjs.map +1 -1
  187. package/dist/yaml.cjs +29 -1
  188. package/dist/yaml.mjs +27 -1
  189. package/dist/yaml.mjs.map +1 -1
  190. package/package.json +6 -6
@@ -1 +1,92 @@
1
- function e(e){return/^.[^\n\r@\u2028\u2029]*@.*$/.test(e)}function t(t){return e(t)?t.substring(0,t.lastIndexOf(`@`)):t}function n(e){return/^[^\n\r/\u2028\u2029]*\/.[^\n\r/\u2028\u2029]*\/.*$/.test(e)?e.substring(0,e.lastIndexOf(`/`)):t(e)}exports.getPackageName=n;
1
+
2
+ //#region ../string-format/src/package.ts
3
+ /**
4
+ * Check if a package name has a version
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * hasPackageVersion("lodash@4.17.21");
9
+ * // => true
10
+ * hasPackageVersion("@stryke/core@4.17.21");
11
+ * // => true
12
+ * hasPackageVersion("lodash");
13
+ * // => false
14
+ * hasPackageVersion("@stryke/core");
15
+ * // => false
16
+ * hasPackageVersion("lodash/module");
17
+ * // => false
18
+ * hasPackageVersion("@stryke/core/module");
19
+ * // => false
20
+ * hasPackageVersion("lodash/module@4.17.21");
21
+ * // => true
22
+ * hasPackageVersion("@stryke/core/module@4.17.21");
23
+ * // => true
24
+ * ```
25
+ *
26
+ * @param value - The package name with version
27
+ * @returns Whether the package name has a version
28
+ */
29
+ function hasPackageVersion(value) {
30
+ return /^.[^\n\r@\u2028\u2029]*@.*$/.test(value);
31
+ }
32
+ /**
33
+ * Remove the version from a package name (if it exists)
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * removePackageVersion("lodash@4.17.21");
38
+ * // => "lodash"
39
+ * removePackageVersion("@stryke/core@4.17.21");
40
+ * // => "@stryke/core"
41
+ * removePackageVersion("lodash");
42
+ * // => "lodash"
43
+ * removePackageVersion("@stryke/core");
44
+ * // => "@stryke/core"
45
+ * getPackageName("lodash/module");
46
+ * // => "lodash/module"
47
+ * getPackageName("@stryke/core/module");
48
+ * // => "@stryke/core/module"
49
+ * getPackageName("lodash/module@4.17.21");
50
+ * // => "lodash/module"
51
+ * getPackageName("@stryke/core/module@4.17.21");
52
+ * // => "@stryke/core/module"
53
+ * ```
54
+ *
55
+ * @param value - The package name with version
56
+ * @returns The package name without version
57
+ */
58
+ function removePackageVersion(value) {
59
+ return hasPackageVersion(value) ? value.substring(0, value.lastIndexOf("@")) : value;
60
+ }
61
+ /**
62
+ * Get the package name from a scoped package string
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * getPackageName("lodash@4.17.21");
67
+ * // => "lodash"
68
+ * getPackageName("@stryke/core@4.17.21");
69
+ * // => "@stryke/core"
70
+ * getPackageName("lodash");
71
+ * // => "lodash"
72
+ * getPackageName("@stryke/core");
73
+ * // => "@stryke/core"
74
+ * getPackageName("lodash/module");
75
+ * // => "lodash"
76
+ * getPackageName("@stryke/core/module");
77
+ * // => "@stryke/core"
78
+ * getPackageName("lodash/module@4.17.21");
79
+ * // => "lodash"
80
+ * getPackageName("@stryke/core/module@4.17.21");
81
+ * // => "@stryke/core"
82
+ * ```
83
+ *
84
+ * @param value - The scoped package string
85
+ * @returns The package name without the scope
86
+ */
87
+ function getPackageName(value) {
88
+ return /^[^\n\r/\u2028\u2029]*\/.[^\n\r/\u2028\u2029]*\/.*$/.test(value) ? value.substring(0, value.lastIndexOf("/")) : removePackageVersion(value);
89
+ }
90
+
91
+ //#endregion
92
+ exports.getPackageName = getPackageName;
@@ -1,2 +1,92 @@
1
- function e(e){return/^.[^\n\r@\u2028\u2029]*@.*$/.test(e)}function t(t){return e(t)?t.substring(0,t.lastIndexOf(`@`)):t}function n(e){return/^[^\n\r/\u2028\u2029]*\/.[^\n\r/\u2028\u2029]*\/.*$/.test(e)?e.substring(0,e.lastIndexOf(`/`)):t(e)}export{n as getPackageName};
1
+ //#region ../string-format/src/package.ts
2
+ /**
3
+ * Check if a package name has a version
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * hasPackageVersion("lodash@4.17.21");
8
+ * // => true
9
+ * hasPackageVersion("@stryke/core@4.17.21");
10
+ * // => true
11
+ * hasPackageVersion("lodash");
12
+ * // => false
13
+ * hasPackageVersion("@stryke/core");
14
+ * // => false
15
+ * hasPackageVersion("lodash/module");
16
+ * // => false
17
+ * hasPackageVersion("@stryke/core/module");
18
+ * // => false
19
+ * hasPackageVersion("lodash/module@4.17.21");
20
+ * // => true
21
+ * hasPackageVersion("@stryke/core/module@4.17.21");
22
+ * // => true
23
+ * ```
24
+ *
25
+ * @param value - The package name with version
26
+ * @returns Whether the package name has a version
27
+ */
28
+ function hasPackageVersion(value) {
29
+ return /^.[^\n\r@\u2028\u2029]*@.*$/.test(value);
30
+ }
31
+ /**
32
+ * Remove the version from a package name (if it exists)
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * removePackageVersion("lodash@4.17.21");
37
+ * // => "lodash"
38
+ * removePackageVersion("@stryke/core@4.17.21");
39
+ * // => "@stryke/core"
40
+ * removePackageVersion("lodash");
41
+ * // => "lodash"
42
+ * removePackageVersion("@stryke/core");
43
+ * // => "@stryke/core"
44
+ * getPackageName("lodash/module");
45
+ * // => "lodash/module"
46
+ * getPackageName("@stryke/core/module");
47
+ * // => "@stryke/core/module"
48
+ * getPackageName("lodash/module@4.17.21");
49
+ * // => "lodash/module"
50
+ * getPackageName("@stryke/core/module@4.17.21");
51
+ * // => "@stryke/core/module"
52
+ * ```
53
+ *
54
+ * @param value - The package name with version
55
+ * @returns The package name without version
56
+ */
57
+ function removePackageVersion(value) {
58
+ return hasPackageVersion(value) ? value.substring(0, value.lastIndexOf("@")) : value;
59
+ }
60
+ /**
61
+ * Get the package name from a scoped package string
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * getPackageName("lodash@4.17.21");
66
+ * // => "lodash"
67
+ * getPackageName("@stryke/core@4.17.21");
68
+ * // => "@stryke/core"
69
+ * getPackageName("lodash");
70
+ * // => "lodash"
71
+ * getPackageName("@stryke/core");
72
+ * // => "@stryke/core"
73
+ * getPackageName("lodash/module");
74
+ * // => "lodash"
75
+ * getPackageName("@stryke/core/module");
76
+ * // => "@stryke/core"
77
+ * getPackageName("lodash/module@4.17.21");
78
+ * // => "lodash"
79
+ * getPackageName("@stryke/core/module@4.17.21");
80
+ * // => "@stryke/core"
81
+ * ```
82
+ *
83
+ * @param value - The scoped package string
84
+ * @returns The package name without the scope
85
+ */
86
+ function getPackageName(value) {
87
+ return /^[^\n\r/\u2028\u2029]*\/.[^\n\r/\u2028\u2029]*\/.*$/.test(value) ? value.substring(0, value.lastIndexOf("/")) : removePackageVersion(value);
88
+ }
89
+
90
+ //#endregion
91
+ export { getPackageName };
2
92
  //# sourceMappingURL=package.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.mjs","names":[],"sources":["../../../../string-format/src/package.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Check if a package name has a version\n *\n * @example\n * ```typescript\n * hasPackageVersion(\"lodash@4.17.21\");\n * // => true\n * hasPackageVersion(\"@stryke/core@4.17.21\");\n * // => true\n * hasPackageVersion(\"lodash\");\n * // => false\n * hasPackageVersion(\"@stryke/core\");\n * // => false\n * hasPackageVersion(\"lodash/module\");\n * // => false\n * hasPackageVersion(\"@stryke/core/module\");\n * // => false\n * hasPackageVersion(\"lodash/module@4.17.21\");\n * // => true\n * hasPackageVersion(\"@stryke/core/module@4.17.21\");\n * // => true\n * ```\n *\n * @param value - The package name with version\n * @returns Whether the package name has a version\n */\nexport function hasPackageVersion(value: string): boolean {\n return /^.[^\\n\\r@\\u2028\\u2029]*@.*$/.test(value);\n}\n\n/**\n * Remove the version from a package name (if it exists)\n *\n * @example\n * ```typescript\n * removePackageVersion(\"lodash@4.17.21\");\n * // => \"lodash\"\n * removePackageVersion(\"@stryke/core@4.17.21\");\n * // => \"@stryke/core\"\n * removePackageVersion(\"lodash\");\n * // => \"lodash\"\n * removePackageVersion(\"@stryke/core\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module\");\n * // => \"lodash/module\"\n * getPackageName(\"@stryke/core/module\");\n * // => \"@stryke/core/module\"\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"lodash/module\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"@stryke/core/module\"\n * ```\n *\n * @param value - The package name with version\n * @returns The package name without version\n */\nexport function removePackageVersion(value: string) {\n return hasPackageVersion(value)\n ? value.substring(0, value.lastIndexOf(\"@\"))\n : value;\n}\n\n/**\n * Get the package name from a scoped package string\n *\n * @example\n * ```typescript\n * getPackageName(\"lodash@4.17.21\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core@4.17.21\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core/module\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"@stryke/core\"\n * ```\n *\n * @param value - The scoped package string\n * @returns The package name without the scope\n */\nexport function getPackageName(value: string) {\n return /^[^\\n\\r/\\u2028\\u2029]*\\/.[^\\n\\r/\\u2028\\u2029]*\\/.*$/.test(value)\n ? value.substring(0, value.lastIndexOf(\"/\"))\n : removePackageVersion(value);\n}\n\n/**\n * Get the package version from a scoped package string\n *\n * @example\n * ```typescript\n * getPackageName(\"lodash@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"@stryke/core@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"lodash\");\n * // => undefined\n * getPackageName(\"@stryke/core\");\n * // => undefined\n * getPackageName(\"lodash/module\");\n * // => undefined\n * getPackageName(\"@stryke/core/module\");\n * // => undefined\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"4.17.21\"\n * ```\n *\n * @param value - The scoped package string\n * @returns The package version without the package name if it exists. If not, returns undefined.\n */\nexport function getPackageVersion(value: string): string | undefined {\n return hasPackageVersion(value) ? value.replace(/^.+@/, \"\") : undefined;\n}\n"],"mappings":"AA4CA,SAAgB,EAAkB,EAAwB,CACxD,MAAO,8BAA8B,KAAK,EAAM,CA6BlD,SAAgB,EAAqB,EAAe,CAClD,OAAO,EAAkB,EAAM,CAC3B,EAAM,UAAU,EAAG,EAAM,YAAY,IAAI,CAAC,CAC1C,EA6BN,SAAgB,EAAe,EAAe,CAC5C,MAAO,sDAAsD,KAAK,EAAM,CACpE,EAAM,UAAU,EAAG,EAAM,YAAY,IAAI,CAAC,CAC1C,EAAqB,EAAM"}
1
+ {"version":3,"file":"package.mjs","names":[],"sources":["../../../../string-format/src/package.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Check if a package name has a version\n *\n * @example\n * ```typescript\n * hasPackageVersion(\"lodash@4.17.21\");\n * // => true\n * hasPackageVersion(\"@stryke/core@4.17.21\");\n * // => true\n * hasPackageVersion(\"lodash\");\n * // => false\n * hasPackageVersion(\"@stryke/core\");\n * // => false\n * hasPackageVersion(\"lodash/module\");\n * // => false\n * hasPackageVersion(\"@stryke/core/module\");\n * // => false\n * hasPackageVersion(\"lodash/module@4.17.21\");\n * // => true\n * hasPackageVersion(\"@stryke/core/module@4.17.21\");\n * // => true\n * ```\n *\n * @param value - The package name with version\n * @returns Whether the package name has a version\n */\nexport function hasPackageVersion(value: string): boolean {\n return /^.[^\\n\\r@\\u2028\\u2029]*@.*$/.test(value);\n}\n\n/**\n * Remove the version from a package name (if it exists)\n *\n * @example\n * ```typescript\n * removePackageVersion(\"lodash@4.17.21\");\n * // => \"lodash\"\n * removePackageVersion(\"@stryke/core@4.17.21\");\n * // => \"@stryke/core\"\n * removePackageVersion(\"lodash\");\n * // => \"lodash\"\n * removePackageVersion(\"@stryke/core\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module\");\n * // => \"lodash/module\"\n * getPackageName(\"@stryke/core/module\");\n * // => \"@stryke/core/module\"\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"lodash/module\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"@stryke/core/module\"\n * ```\n *\n * @param value - The package name with version\n * @returns The package name without version\n */\nexport function removePackageVersion(value: string) {\n return hasPackageVersion(value)\n ? value.substring(0, value.lastIndexOf(\"@\"))\n : value;\n}\n\n/**\n * Get the package name from a scoped package string\n *\n * @example\n * ```typescript\n * getPackageName(\"lodash@4.17.21\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core@4.17.21\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core/module\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"@stryke/core\"\n * ```\n *\n * @param value - The scoped package string\n * @returns The package name without the scope\n */\nexport function getPackageName(value: string) {\n return /^[^\\n\\r/\\u2028\\u2029]*\\/.[^\\n\\r/\\u2028\\u2029]*\\/.*$/.test(value)\n ? value.substring(0, value.lastIndexOf(\"/\"))\n : removePackageVersion(value);\n}\n\n/**\n * Get the package version from a scoped package string\n *\n * @example\n * ```typescript\n * getPackageName(\"lodash@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"@stryke/core@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"lodash\");\n * // => undefined\n * getPackageName(\"@stryke/core\");\n * // => undefined\n * getPackageName(\"lodash/module\");\n * // => undefined\n * getPackageName(\"@stryke/core/module\");\n * // => undefined\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"4.17.21\"\n * ```\n *\n * @param value - The scoped package string\n * @returns The package version without the package name if it exists. If not, returns undefined.\n */\nexport function getPackageVersion(value: string): string | undefined {\n return hasPackageVersion(value) ? value.replace(/^.+@/, \"\") : undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,SAAgB,kBAAkB,OAAwB;AACxD,QAAO,8BAA8B,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BlD,SAAgB,qBAAqB,OAAe;AAClD,QAAO,kBAAkB,MAAM,GAC3B,MAAM,UAAU,GAAG,MAAM,YAAY,IAAI,CAAC,GAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BN,SAAgB,eAAe,OAAe;AAC5C,QAAO,sDAAsD,KAAK,MAAM,GACpE,MAAM,UAAU,GAAG,MAAM,YAAY,IAAI,CAAC,GAC1C,qBAAqB,MAAM"}
package/dist/toml.cjs CHANGED
@@ -1,3 +1,66 @@
1
- const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./read-file.cjs`),n=require(`./write-file.cjs`);let r=require(`defu`);r=e.__toESM(r);let i=require(`@ltd/j-toml`);function a(e,n){let r=t.readFileSync(e);return n?.specificationVersion?(0,i.parse)(r,n.specificationVersion,n?.multilineStringJoiner,n?.useBigInt,n?.xOptions):(0,i.parse)(r)}async function o(e,n){let r=await t.readFile(e);return n?.specificationVersion?(0,i.parse)(r,n.specificationVersion,n?.multilineStringJoiner,n?.useBigInt,n?.xOptions):(0,i.parse)(r)}function s(e,t,a){return n.writeFileSync(e,(0,i.stringify)(t,(0,r.default)(a??{},{newline:`
2
- `,newlineAround:`pairs`,indent:4,forceInlineArraySpacing:1})))}async function c(e,t,a){return n.writeFile(e,(0,i.stringify)(t,(0,r.default)(a??{},{newline:`
3
- `,newlineAround:`pairs`,indent:4,forceInlineArraySpacing:1})))}exports.readTomlFile=o,exports.readTomlFileSync=a,exports.writeTomlFile=c,exports.writeTomlFileSync=s;
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ const require_read_file = require('./read-file.cjs');
3
+ const require_write_file = require('./write-file.cjs');
4
+ let defu = require("defu");
5
+ defu = require_rolldown_runtime.__toESM(defu);
6
+ let __ltd_j_toml = require("@ltd/j-toml");
7
+
8
+ //#region src/toml.ts
9
+ /**
10
+ * Reads a TOML file and returns the object the TOML content represents.
11
+ *
12
+ * @param path - A path to a file.
13
+ * @param options - TOML parse options
14
+ * @returns Object the TOML content of the file represents
15
+ */
16
+ function readTomlFileSync(path, options) {
17
+ const content = require_read_file.readFileSync(path);
18
+ return options?.specificationVersion ? (0, __ltd_j_toml.parse)(content, options.specificationVersion, options?.multilineStringJoiner, options?.useBigInt, options?.xOptions) : (0, __ltd_j_toml.parse)(content);
19
+ }
20
+ /**
21
+ * Reads a TOML file and returns the object the TOML content represents.
22
+ *
23
+ * @param path - A path to a file.
24
+ * @param options - TOML parse options
25
+ * @returns Object the TOML content of the file represents
26
+ */
27
+ async function readTomlFile(path, options) {
28
+ const content = await require_read_file.readFile(path);
29
+ return options?.specificationVersion ? (0, __ltd_j_toml.parse)(content, options.specificationVersion, options?.multilineStringJoiner, options?.useBigInt, options?.xOptions) : (0, __ltd_j_toml.parse)(content);
30
+ }
31
+ /**
32
+ * Reads a TOML file and returns the object the TOML content represents.
33
+ *
34
+ * @param path - A path to a file.
35
+ * @param data - data which should be serialized/formatted to TOML and written to the file
36
+ * @param options - TOML parse options
37
+ */
38
+ function writeTomlFileSync(path, data, options) {
39
+ return require_write_file.writeFileSync(path, (0, __ltd_j_toml.stringify)(data, (0, defu.default)(options ?? {}, {
40
+ newline: "\n",
41
+ newlineAround: "pairs",
42
+ indent: 4,
43
+ forceInlineArraySpacing: 1
44
+ })));
45
+ }
46
+ /**
47
+ * Reads a TOML file and returns the object the TOML content represents.
48
+ *
49
+ * @param path - A path to a file.
50
+ * @param data - data which should be serialized/formatted to TOML and written to the file
51
+ * @param options - TOML parse options
52
+ */
53
+ async function writeTomlFile(path, data, options) {
54
+ return require_write_file.writeFile(path, (0, __ltd_j_toml.stringify)(data, (0, defu.default)(options ?? {}, {
55
+ newline: "\n",
56
+ newlineAround: "pairs",
57
+ indent: 4,
58
+ forceInlineArraySpacing: 1
59
+ })));
60
+ }
61
+
62
+ //#endregion
63
+ exports.readTomlFile = readTomlFile;
64
+ exports.readTomlFileSync = readTomlFileSync;
65
+ exports.writeTomlFile = writeTomlFile;
66
+ exports.writeTomlFileSync = writeTomlFileSync;
package/dist/toml.mjs CHANGED
@@ -1,4 +1,62 @@
1
- import{readFile as e,readFileSync as t}from"./read-file.mjs";import{writeFile as n,writeFileSync as r}from"./write-file.mjs";import i from"defu";import{parse as a,stringify as o}from"@ltd/j-toml";function s(e,n){let r=t(e);return n?.specificationVersion?a(r,n.specificationVersion,n?.multilineStringJoiner,n?.useBigInt,n?.xOptions):a(r)}async function c(t,n){let r=await e(t);return n?.specificationVersion?a(r,n.specificationVersion,n?.multilineStringJoiner,n?.useBigInt,n?.xOptions):a(r)}function l(e,t,n){return r(e,o(t,i(n??{},{newline:`
2
- `,newlineAround:`pairs`,indent:4,forceInlineArraySpacing:1})))}async function u(e,t,r){return n(e,o(t,i(r??{},{newline:`
3
- `,newlineAround:`pairs`,indent:4,forceInlineArraySpacing:1})))}export{c as readTomlFile,s as readTomlFileSync,u as writeTomlFile,l as writeTomlFileSync};
1
+ import { readFile, readFileSync } from "./read-file.mjs";
2
+ import { writeFile, writeFileSync } from "./write-file.mjs";
3
+ import defu from "defu";
4
+ import { parse, stringify } from "@ltd/j-toml";
5
+
6
+ //#region src/toml.ts
7
+ /**
8
+ * Reads a TOML file and returns the object the TOML content represents.
9
+ *
10
+ * @param path - A path to a file.
11
+ * @param options - TOML parse options
12
+ * @returns Object the TOML content of the file represents
13
+ */
14
+ function readTomlFileSync(path, options) {
15
+ const content = readFileSync(path);
16
+ return options?.specificationVersion ? parse(content, options.specificationVersion, options?.multilineStringJoiner, options?.useBigInt, options?.xOptions) : parse(content);
17
+ }
18
+ /**
19
+ * Reads a TOML file and returns the object the TOML content represents.
20
+ *
21
+ * @param path - A path to a file.
22
+ * @param options - TOML parse options
23
+ * @returns Object the TOML content of the file represents
24
+ */
25
+ async function readTomlFile(path, options) {
26
+ const content = await readFile(path);
27
+ return options?.specificationVersion ? parse(content, options.specificationVersion, options?.multilineStringJoiner, options?.useBigInt, options?.xOptions) : parse(content);
28
+ }
29
+ /**
30
+ * Reads a TOML file and returns the object the TOML content represents.
31
+ *
32
+ * @param path - A path to a file.
33
+ * @param data - data which should be serialized/formatted to TOML and written to the file
34
+ * @param options - TOML parse options
35
+ */
36
+ function writeTomlFileSync(path, data, options) {
37
+ return writeFileSync(path, stringify(data, defu(options ?? {}, {
38
+ newline: "\n",
39
+ newlineAround: "pairs",
40
+ indent: 4,
41
+ forceInlineArraySpacing: 1
42
+ })));
43
+ }
44
+ /**
45
+ * Reads a TOML file and returns the object the TOML content represents.
46
+ *
47
+ * @param path - A path to a file.
48
+ * @param data - data which should be serialized/formatted to TOML and written to the file
49
+ * @param options - TOML parse options
50
+ */
51
+ async function writeTomlFile(path, data, options) {
52
+ return writeFile(path, stringify(data, defu(options ?? {}, {
53
+ newline: "\n",
54
+ newlineAround: "pairs",
55
+ indent: 4,
56
+ forceInlineArraySpacing: 1
57
+ })));
58
+ }
59
+
60
+ //#endregion
61
+ export { readTomlFile, readTomlFileSync, writeTomlFile, writeTomlFileSync };
4
62
  //# sourceMappingURL=toml.mjs.map
package/dist/toml.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"toml.mjs","names":["parseToml","stringifyToml"],"sources":["../src/toml.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parse as parseToml, stringify as stringifyToml } from \"@ltd/j-toml\";\nimport defu from \"defu\";\nimport { readFile, readFileSync } from \"./read-file\";\nimport { writeFile, writeFileSync } from \"./write-file\";\n\nexport type XOptions = null | {\n readonly keys?: null | RegExp;\n readonly order?: boolean;\n readonly exact?: boolean;\n readonly multi?: boolean;\n readonly longer?: boolean;\n readonly string?: boolean;\n readonly comment?: boolean;\n readonly literal?: boolean;\n readonly null?: boolean;\n readonly tag?:\n | null\n | (<\n Table extends object & { [key: string | symbol]: any },\n Key extends string | symbol,\n Array extends any[],\n Index extends number,\n Tag extends string\n >(\n this: void,\n each:\n | { table: Table; key: Key; tag: Tag }\n | { array: Array; index: Index; tag: Tag }\n | { table: Table; key: Key; array: Array; index: Index; tag: Tag }\n ) => void);\n};\n\nexport interface TomlReadOptions {\n specificationVersion?: 1.0 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1;\n multilineStringJoiner?: string;\n useBigInt?: boolean | number;\n xOptions?: XOptions;\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param options - TOML parse options\n * @returns Object the TOML content of the file represents\n */\nexport function readTomlFileSync<T extends object = any>(\n path: string,\n options?: TomlReadOptions\n): T {\n const content = readFileSync(path);\n\n return (\n options?.specificationVersion\n ? parseToml(\n content,\n options.specificationVersion,\n options?.multilineStringJoiner,\n options?.useBigInt,\n options?.xOptions\n )\n : parseToml(content)\n ) as T;\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param options - TOML parse options\n * @returns Object the TOML content of the file represents\n */\nexport async function readTomlFile<T extends object = any>(\n path: string,\n options?: TomlReadOptions\n): Promise<T> {\n const content = await readFile(path);\n\n return (\n options?.specificationVersion\n ? parseToml(\n content,\n options.specificationVersion,\n options?.multilineStringJoiner,\n options?.useBigInt,\n options?.xOptions\n )\n : parseToml(content)\n ) as T;\n}\n\nexport interface TomlWriteOptions {\n integer?: number;\n newline?: \"\\n\" | \"\\r\\n\";\n newlineAround?: \"document\" | \"section\" | \"header\" | \"pairs\" | \"pair\";\n indent?: string | number;\n T?: \"T\" | \"t\" | \" \";\n Z?: \"Z\" | \"z\";\n xNull?: boolean;\n xBeforeNewlineInMultilineTable?: \",\" | \"\";\n forceInlineArraySpacing?: 0 | 1 | 2 | 3;\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized/formatted to TOML and written to the file\n * @param options - TOML parse options\n */\nexport function writeTomlFileSync<T extends object = any>(\n path: string,\n data: T,\n options?: TomlWriteOptions\n): void {\n return writeFileSync(\n path,\n stringifyToml(\n data as any,\n defu(options ?? {}, {\n newline: \"\\n\",\n newlineAround: \"pairs\",\n indent: 4,\n forceInlineArraySpacing: 1\n }) as TomlWriteOptions\n )\n );\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized/formatted to TOML and written to the file\n * @param options - TOML parse options\n */\nexport async function writeTomlFile<T extends object = any>(\n path: string,\n data: T,\n options?: TomlWriteOptions\n): Promise<void> {\n return writeFile(\n path,\n stringifyToml(\n data as any,\n defu(options ?? {}, {\n newline: \"\\n\",\n newlineAround: \"pairs\",\n indent: 4,\n forceInlineArraySpacing: 1\n }) as TomlWriteOptions\n )\n );\n}\n"],"mappings":"oMAgEA,SAAgB,EACd,EACA,EACG,CACH,IAAM,EAAU,EAAa,EAAK,CAElC,OACE,GAAS,qBACLA,EACE,EACA,EAAQ,qBACR,GAAS,sBACT,GAAS,UACT,GAAS,SACV,CACDA,EAAU,EAAQ,CAW1B,eAAsB,EACpB,EACA,EACY,CACZ,IAAM,EAAU,MAAM,EAAS,EAAK,CAEpC,OACE,GAAS,qBACLA,EACE,EACA,EAAQ,qBACR,GAAS,sBACT,GAAS,UACT,GAAS,SACV,CACDA,EAAU,EAAQ,CAuB1B,SAAgB,EACd,EACA,EACA,EACM,CACN,OAAO,EACL,EACAC,EACE,EACA,EAAK,GAAW,EAAE,CAAE,CAClB,QAAS;EACT,cAAe,QACf,OAAQ,EACR,wBAAyB,EAC1B,CAAC,CACH,CACF,CAUH,eAAsB,EACpB,EACA,EACA,EACe,CACf,OAAO,EACL,EACAA,EACE,EACA,EAAK,GAAW,EAAE,CAAE,CAClB,QAAS;EACT,cAAe,QACf,OAAQ,EACR,wBAAyB,EAC1B,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"toml.mjs","names":["parseToml","stringifyToml"],"sources":["../src/toml.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { parse as parseToml, stringify as stringifyToml } from \"@ltd/j-toml\";\nimport defu from \"defu\";\nimport { readFile, readFileSync } from \"./read-file\";\nimport { writeFile, writeFileSync } from \"./write-file\";\n\nexport type XOptions = null | {\n readonly keys?: null | RegExp;\n readonly order?: boolean;\n readonly exact?: boolean;\n readonly multi?: boolean;\n readonly longer?: boolean;\n readonly string?: boolean;\n readonly comment?: boolean;\n readonly literal?: boolean;\n readonly null?: boolean;\n readonly tag?:\n | null\n | (<\n Table extends object & { [key: string | symbol]: any },\n Key extends string | symbol,\n Array extends any[],\n Index extends number,\n Tag extends string\n >(\n this: void,\n each:\n | { table: Table; key: Key; tag: Tag }\n | { array: Array; index: Index; tag: Tag }\n | { table: Table; key: Key; array: Array; index: Index; tag: Tag }\n ) => void);\n};\n\nexport interface TomlReadOptions {\n specificationVersion?: 1.0 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1;\n multilineStringJoiner?: string;\n useBigInt?: boolean | number;\n xOptions?: XOptions;\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param options - TOML parse options\n * @returns Object the TOML content of the file represents\n */\nexport function readTomlFileSync<T extends object = any>(\n path: string,\n options?: TomlReadOptions\n): T {\n const content = readFileSync(path);\n\n return (\n options?.specificationVersion\n ? parseToml(\n content,\n options.specificationVersion,\n options?.multilineStringJoiner,\n options?.useBigInt,\n options?.xOptions\n )\n : parseToml(content)\n ) as T;\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param options - TOML parse options\n * @returns Object the TOML content of the file represents\n */\nexport async function readTomlFile<T extends object = any>(\n path: string,\n options?: TomlReadOptions\n): Promise<T> {\n const content = await readFile(path);\n\n return (\n options?.specificationVersion\n ? parseToml(\n content,\n options.specificationVersion,\n options?.multilineStringJoiner,\n options?.useBigInt,\n options?.xOptions\n )\n : parseToml(content)\n ) as T;\n}\n\nexport interface TomlWriteOptions {\n integer?: number;\n newline?: \"\\n\" | \"\\r\\n\";\n newlineAround?: \"document\" | \"section\" | \"header\" | \"pairs\" | \"pair\";\n indent?: string | number;\n T?: \"T\" | \"t\" | \" \";\n Z?: \"Z\" | \"z\";\n xNull?: boolean;\n xBeforeNewlineInMultilineTable?: \",\" | \"\";\n forceInlineArraySpacing?: 0 | 1 | 2 | 3;\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized/formatted to TOML and written to the file\n * @param options - TOML parse options\n */\nexport function writeTomlFileSync<T extends object = any>(\n path: string,\n data: T,\n options?: TomlWriteOptions\n): void {\n return writeFileSync(\n path,\n stringifyToml(\n data as any,\n defu(options ?? {}, {\n newline: \"\\n\",\n newlineAround: \"pairs\",\n indent: 4,\n forceInlineArraySpacing: 1\n }) as TomlWriteOptions\n )\n );\n}\n\n/**\n * Reads a TOML file and returns the object the TOML content represents.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized/formatted to TOML and written to the file\n * @param options - TOML parse options\n */\nexport async function writeTomlFile<T extends object = any>(\n path: string,\n data: T,\n options?: TomlWriteOptions\n): Promise<void> {\n return writeFile(\n path,\n stringifyToml(\n data as any,\n defu(options ?? {}, {\n newline: \"\\n\",\n newlineAround: \"pairs\",\n indent: 4,\n forceInlineArraySpacing: 1\n }) as TomlWriteOptions\n )\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgEA,SAAgB,iBACd,MACA,SACG;CACH,MAAM,UAAU,aAAa,KAAK;AAElC,QACE,SAAS,uBACLA,MACE,SACA,QAAQ,sBACR,SAAS,uBACT,SAAS,WACT,SAAS,SACV,GACDA,MAAU,QAAQ;;;;;;;;;AAW1B,eAAsB,aACpB,MACA,SACY;CACZ,MAAM,UAAU,MAAM,SAAS,KAAK;AAEpC,QACE,SAAS,uBACLA,MACE,SACA,QAAQ,sBACR,SAAS,uBACT,SAAS,WACT,SAAS,SACV,GACDA,MAAU,QAAQ;;;;;;;;;AAuB1B,SAAgB,kBACd,MACA,MACA,SACM;AACN,QAAO,cACL,MACAC,UACE,MACA,KAAK,WAAW,EAAE,EAAE;EAClB,SAAS;EACT,eAAe;EACf,QAAQ;EACR,yBAAyB;EAC1B,CAAC,CACH,CACF;;;;;;;;;AAUH,eAAsB,cACpB,MACA,MACA,SACe;AACf,QAAO,UACL,MACAA,UACE,MACA,KAAK,WAAW,EAAE,EAAE;EAClB,SAAS;EACT,eAAe;EACf,QAAQ;EACR,yBAAyB;EAC1B,CAAC,CACH,CACF"}
package/dist/tsconfig.cjs CHANGED
@@ -1 +1,37 @@
1
- const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./path/src/cwd.cjs`),n=require(`./path/src/is-type.cjs`),r=require(`./path/src/join-paths.cjs`),i=require(`./path/src/file-path-fns.cjs`),a=require(`./exists.cjs`),o=require(`./convert/src/to-array.cjs`),s=require(`./resolve.cjs`),c=require(`./json.cjs`);let l=require(`defu`);l=e.__toESM(l);async function u(e=t.cwd()){let d=i.findFileExtension(e)===`json`?e:r.joinPaths(e,`tsconfig.json`);if(!a.existsSync(d)&&(d=await s.resolve(e,{extensions:[`json`]}),!a.existsSync(d)))throw Error(`tsconfig.json not found at ${d}. Please ensure the file exists.`);let f=await c.readJsonFile(d);if(f?.compilerOptions?.baseUrl&&(f.compilerOptions.baseUrl=r.joinPaths(i.findFilePath(d),f.compilerOptions.baseUrl)),f?.extends)for(let e of o.toArray(f.extends)){let t=await u(n.isNpmScopedPackage(e)?e:r.joinPaths(i.findFilePath(d),e));t&&(f=(0,l.default)(f,t??{}))}return f.extends=void 0,f}exports.loadTsConfig=u;
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ const require_cwd = require('./path/src/cwd.cjs');
3
+ const require_is_type = require('./path/src/is-type.cjs');
4
+ const require_join_paths = require('./path/src/join-paths.cjs');
5
+ const require_file_path_fns = require('./path/src/file-path-fns.cjs');
6
+ const require_exists = require('./exists.cjs');
7
+ const require_to_array = require('./convert/src/to-array.cjs');
8
+ const require_resolve = require('./resolve.cjs');
9
+ const require_json = require('./json.cjs');
10
+ let defu = require("defu");
11
+ defu = require_rolldown_runtime.__toESM(defu);
12
+
13
+ //#region src/tsconfig.ts
14
+ /**
15
+ * Loads a tsconfig.json file and returns the parsed JSON object.
16
+ *
17
+ * @param filePath - The directory to start searching for the tsconfig.json file.
18
+ * @returns The parsed tsconfig.json object or null if not found.
19
+ */
20
+ async function loadTsConfig(filePath = require_cwd.cwd()) {
21
+ let tsconfigFilePath = require_file_path_fns.findFileExtension(filePath) === "json" ? filePath : require_join_paths.joinPaths(filePath, "tsconfig.json");
22
+ if (!require_exists.existsSync(tsconfigFilePath)) {
23
+ tsconfigFilePath = await require_resolve.resolve(filePath, { extensions: ["json"] });
24
+ if (!require_exists.existsSync(tsconfigFilePath)) throw new Error(`tsconfig.json not found at ${tsconfigFilePath}. Please ensure the file exists.`);
25
+ }
26
+ let config = await require_json.readJsonFile(tsconfigFilePath);
27
+ if (config?.compilerOptions?.baseUrl) config.compilerOptions.baseUrl = require_join_paths.joinPaths(require_file_path_fns.findFilePath(tsconfigFilePath), config.compilerOptions.baseUrl);
28
+ if (config?.extends) for (const extendsName of require_to_array.toArray(config.extends)) {
29
+ const parentConfig = await loadTsConfig(require_is_type.isNpmScopedPackage(extendsName) ? extendsName : require_join_paths.joinPaths(require_file_path_fns.findFilePath(tsconfigFilePath), extendsName));
30
+ if (parentConfig) config = (0, defu.default)(config, parentConfig ?? {});
31
+ }
32
+ config.extends = void 0;
33
+ return config;
34
+ }
35
+
36
+ //#endregion
37
+ exports.loadTsConfig = loadTsConfig;
package/dist/tsconfig.mjs CHANGED
@@ -1,2 +1,36 @@
1
- import{cwd as e}from"./path/src/cwd.mjs";import{isNpmScopedPackage as t}from"./path/src/is-type.mjs";import{joinPaths as n}from"./path/src/join-paths.mjs";import{findFileExtension as r,findFilePath as i}from"./path/src/file-path-fns.mjs";import{existsSync as a}from"./exists.mjs";import{toArray as o}from"./convert/src/to-array.mjs";import{resolve as s}from"./resolve.mjs";import{readJsonFile as c}from"./json.mjs";import l from"defu";async function u(d=e()){let f=r(d)===`json`?d:n(d,`tsconfig.json`);if(!a(f)&&(f=await s(d,{extensions:[`json`]}),!a(f)))throw Error(`tsconfig.json not found at ${f}. Please ensure the file exists.`);let p=await c(f);if(p?.compilerOptions?.baseUrl&&(p.compilerOptions.baseUrl=n(i(f),p.compilerOptions.baseUrl)),p?.extends)for(let e of o(p.extends)){let r=await u(t(e)?e:n(i(f),e));r&&(p=l(p,r??{}))}return p.extends=void 0,p}export{u as loadTsConfig};
1
+ import { cwd } from "./path/src/cwd.mjs";
2
+ import { isNpmScopedPackage } from "./path/src/is-type.mjs";
3
+ import { joinPaths } from "./path/src/join-paths.mjs";
4
+ import { findFileExtension, findFilePath } from "./path/src/file-path-fns.mjs";
5
+ import { existsSync } from "./exists.mjs";
6
+ import { toArray } from "./convert/src/to-array.mjs";
7
+ import { resolve } from "./resolve.mjs";
8
+ import { readJsonFile } from "./json.mjs";
9
+ import defu from "defu";
10
+
11
+ //#region src/tsconfig.ts
12
+ /**
13
+ * Loads a tsconfig.json file and returns the parsed JSON object.
14
+ *
15
+ * @param filePath - The directory to start searching for the tsconfig.json file.
16
+ * @returns The parsed tsconfig.json object or null if not found.
17
+ */
18
+ async function loadTsConfig(filePath = cwd()) {
19
+ let tsconfigFilePath = findFileExtension(filePath) === "json" ? filePath : joinPaths(filePath, "tsconfig.json");
20
+ if (!existsSync(tsconfigFilePath)) {
21
+ tsconfigFilePath = await resolve(filePath, { extensions: ["json"] });
22
+ if (!existsSync(tsconfigFilePath)) throw new Error(`tsconfig.json not found at ${tsconfigFilePath}. Please ensure the file exists.`);
23
+ }
24
+ let config = await readJsonFile(tsconfigFilePath);
25
+ if (config?.compilerOptions?.baseUrl) config.compilerOptions.baseUrl = joinPaths(findFilePath(tsconfigFilePath), config.compilerOptions.baseUrl);
26
+ if (config?.extends) for (const extendsName of toArray(config.extends)) {
27
+ const parentConfig = await loadTsConfig(isNpmScopedPackage(extendsName) ? extendsName : joinPaths(findFilePath(tsconfigFilePath), extendsName));
28
+ if (parentConfig) config = defu(config, parentConfig ?? {});
29
+ }
30
+ config.extends = void 0;
31
+ return config;
32
+ }
33
+
34
+ //#endregion
35
+ export { loadTsConfig };
2
36
  //# sourceMappingURL=tsconfig.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig.mjs","names":[],"sources":["../src/tsconfig.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { cwd } from \"@stryke/path/cwd\";\nimport { findFileExtension, findFilePath } from \"@stryke/path/file-path-fns\";\nimport { isNpmScopedPackage } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport { existsSync } from \"./exists\";\nimport { readJsonFile } from \"./json\";\nimport { resolve } from \"./resolve\";\n\n/**\n * Loads a tsconfig.json file and returns the parsed JSON object.\n *\n * @param filePath - The directory to start searching for the tsconfig.json file.\n * @returns The parsed tsconfig.json object or null if not found.\n */\nexport async function loadTsConfig(\n filePath: string = cwd()\n): Promise<TsConfigJson> {\n let tsconfigFilePath =\n findFileExtension(filePath) === \"json\"\n ? filePath\n : joinPaths(filePath, \"tsconfig.json\");\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = await resolve(filePath, { extensions: [\"json\"] });\n if (!existsSync(tsconfigFilePath)) {\n throw new Error(\n `tsconfig.json not found at ${tsconfigFilePath}. Please ensure the file exists.`\n );\n }\n }\n\n let config = await readJsonFile<TsConfigJson>(tsconfigFilePath);\n if (config?.compilerOptions?.baseUrl) {\n config.compilerOptions.baseUrl = joinPaths(\n findFilePath(tsconfigFilePath),\n config.compilerOptions.baseUrl\n );\n }\n\n if (config?.extends) {\n for (const extendsName of toArray(config.extends)) {\n const parentConfig = await loadTsConfig(\n isNpmScopedPackage(extendsName)\n ? extendsName\n : joinPaths(findFilePath(tsconfigFilePath), extendsName)\n );\n if (parentConfig) {\n config = defu(config, parentConfig ?? {});\n }\n }\n }\n\n config.extends = undefined;\n return config;\n}\n"],"mappings":"mbAmCA,eAAsB,EACpB,EAAmB,GAAK,CACD,CACvB,IAAI,EACF,EAAkB,EAAS,GAAK,OAC5B,EACA,EAAU,EAAU,gBAAgB,CAC1C,GAAI,CAAC,EAAW,EAAiB,GAC/B,EAAmB,MAAM,EAAQ,EAAU,CAAE,WAAY,CAAC,OAAO,CAAE,CAAC,CAChE,CAAC,EAAW,EAAiB,EAC/B,MAAU,MACR,8BAA8B,EAAiB,kCAChD,CAIL,IAAI,EAAS,MAAM,EAA2B,EAAiB,CAQ/D,GAPI,GAAQ,iBAAiB,UAC3B,EAAO,gBAAgB,QAAU,EAC/B,EAAa,EAAiB,CAC9B,EAAO,gBAAgB,QACxB,EAGC,GAAQ,QACV,IAAK,IAAM,KAAe,EAAQ,EAAO,QAAQ,CAAE,CACjD,IAAM,EAAe,MAAM,EACzB,EAAmB,EAAY,CAC3B,EACA,EAAU,EAAa,EAAiB,CAAE,EAAY,CAC3D,CACG,IACF,EAAS,EAAK,EAAQ,GAAgB,EAAE,CAAC,EAM/C,MADA,GAAO,QAAU,IAAA,GACV"}
1
+ {"version":3,"file":"tsconfig.mjs","names":[],"sources":["../src/tsconfig.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { cwd } from \"@stryke/path/cwd\";\nimport { findFileExtension, findFilePath } from \"@stryke/path/file-path-fns\";\nimport { isNpmScopedPackage } from \"@stryke/path/is-type\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { TsConfigJson } from \"@stryke/types/tsconfig\";\nimport defu from \"defu\";\nimport { existsSync } from \"./exists\";\nimport { readJsonFile } from \"./json\";\nimport { resolve } from \"./resolve\";\n\n/**\n * Loads a tsconfig.json file and returns the parsed JSON object.\n *\n * @param filePath - The directory to start searching for the tsconfig.json file.\n * @returns The parsed tsconfig.json object or null if not found.\n */\nexport async function loadTsConfig(\n filePath: string = cwd()\n): Promise<TsConfigJson> {\n let tsconfigFilePath =\n findFileExtension(filePath) === \"json\"\n ? filePath\n : joinPaths(filePath, \"tsconfig.json\");\n if (!existsSync(tsconfigFilePath)) {\n tsconfigFilePath = await resolve(filePath, { extensions: [\"json\"] });\n if (!existsSync(tsconfigFilePath)) {\n throw new Error(\n `tsconfig.json not found at ${tsconfigFilePath}. Please ensure the file exists.`\n );\n }\n }\n\n let config = await readJsonFile<TsConfigJson>(tsconfigFilePath);\n if (config?.compilerOptions?.baseUrl) {\n config.compilerOptions.baseUrl = joinPaths(\n findFilePath(tsconfigFilePath),\n config.compilerOptions.baseUrl\n );\n }\n\n if (config?.extends) {\n for (const extendsName of toArray(config.extends)) {\n const parentConfig = await loadTsConfig(\n isNpmScopedPackage(extendsName)\n ? extendsName\n : joinPaths(findFilePath(tsconfigFilePath), extendsName)\n );\n if (parentConfig) {\n config = defu(config, parentConfig ?? {});\n }\n }\n }\n\n config.extends = undefined;\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,eAAsB,aACpB,WAAmB,KAAK,EACD;CACvB,IAAI,mBACF,kBAAkB,SAAS,KAAK,SAC5B,WACA,UAAU,UAAU,gBAAgB;AAC1C,KAAI,CAAC,WAAW,iBAAiB,EAAE;AACjC,qBAAmB,MAAM,QAAQ,UAAU,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;AACpE,MAAI,CAAC,WAAW,iBAAiB,CAC/B,OAAM,IAAI,MACR,8BAA8B,iBAAiB,kCAChD;;CAIL,IAAI,SAAS,MAAM,aAA2B,iBAAiB;AAC/D,KAAI,QAAQ,iBAAiB,QAC3B,QAAO,gBAAgB,UAAU,UAC/B,aAAa,iBAAiB,EAC9B,OAAO,gBAAgB,QACxB;AAGH,KAAI,QAAQ,QACV,MAAK,MAAM,eAAe,QAAQ,OAAO,QAAQ,EAAE;EACjD,MAAM,eAAe,MAAM,aACzB,mBAAmB,YAAY,GAC3B,cACA,UAAU,aAAa,iBAAiB,EAAE,YAAY,CAC3D;AACD,MAAI,aACF,UAAS,KAAK,QAAQ,gBAAgB,EAAE,CAAC;;AAK/C,QAAO,UAAU;AACjB,QAAO"}
@@ -1 +1,15 @@
1
- const e=e=>e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e);exports.getObjectTag=e;
1
+
2
+ //#region ../type-checks/src/get-object-tag.ts
3
+ /**
4
+ * Gets the `toStringTag` of `obj`.
5
+ *
6
+ * @param value - The obj to query.
7
+ * @returns Returns the `toStringTag`.
8
+ */
9
+ const getObjectTag = (value) => {
10
+ if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
11
+ return Object.prototype.toString.call(value);
12
+ };
13
+
14
+ //#endregion
15
+ exports.getObjectTag = getObjectTag;
@@ -1,2 +1,15 @@
1
- const e=e=>e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e);export{e as getObjectTag};
1
+ //#region ../type-checks/src/get-object-tag.ts
2
+ /**
3
+ * Gets the `toStringTag` of `obj`.
4
+ *
5
+ * @param value - The obj to query.
6
+ * @returns Returns the `toStringTag`.
7
+ */
8
+ const getObjectTag = (value) => {
9
+ if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
10
+ return Object.prototype.toString.call(value);
11
+ };
12
+
13
+ //#endregion
14
+ export { getObjectTag };
2
15
  //# sourceMappingURL=get-object-tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-object-tag.mjs","names":[],"sources":["../../../../type-checks/src/get-object-tag.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\n};\n"],"mappings":"AAwBA,MAAa,EAAgB,GACvB,GAAS,KACJ,IAAU,IAAA,GAAY,qBAAuB,gBAE/C,OAAO,UAAU,SAAS,KAAK,EAAM"}
1
+ {"version":3,"file":"get-object-tag.mjs","names":[],"sources":["../../../../type-checks/src/get-object-tag.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Gets the `toStringTag` of `obj`.\n *\n * @param value - The obj to query.\n * @returns Returns the `toStringTag`.\n */\nexport const getObjectTag = (value: unknown): string => {\n if (value == null) {\n return value === undefined ? \"[object Undefined]\" : \"[object Null]\";\n }\n return Object.prototype.toString.call(value);\n};\n"],"mappings":";;;;;;;AAwBA,MAAa,gBAAgB,UAA2B;AACtD,KAAI,SAAS,KACX,QAAO,UAAU,SAAY,uBAAuB;AAEtD,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM"}
@@ -1 +1,14 @@
1
- const e=require(`./get-object-tag.cjs`),t=require(`./is-plain-object.cjs`),n=require(`./is-null.cjs`),r=require(`./is-number.cjs`),i=require(`./is-undefined.cjs`),a=require(`./is-empty.cjs`),o=require(`./is-set.cjs`),s=require(`./is-string.cjs`),c=require(`./is-set-string.cjs`),l=require(`./is-object.cjs`),u=require(`./is-buffer.cjs`);require(`./type-detect.cjs`),require(`./is-collection.cjs`);const d=require(`./is-error.cjs`);
1
+ const require_get_object_tag = require('./get-object-tag.cjs');
2
+ const require_is_plain_object = require('./is-plain-object.cjs');
3
+ const require_is_null = require('./is-null.cjs');
4
+ const require_is_number = require('./is-number.cjs');
5
+ const require_is_undefined = require('./is-undefined.cjs');
6
+ const require_is_empty = require('./is-empty.cjs');
7
+ const require_is_set = require('./is-set.cjs');
8
+ const require_is_string = require('./is-string.cjs');
9
+ const require_is_set_string = require('./is-set-string.cjs');
10
+ const require_is_object = require('./is-object.cjs');
11
+ const require_is_buffer = require('./is-buffer.cjs');
12
+ require('./type-detect.cjs');
13
+ require('./is-collection.cjs');
14
+ const require_is_error = require('./is-error.cjs');
@@ -1 +1,16 @@
1
- import{getObjectTag as e}from"./get-object-tag.mjs";import{isObjectLike as t,isPlainObject as n}from"./is-plain-object.mjs";import{isNull as r}from"./is-null.mjs";import{isNumber as i}from"./is-number.mjs";import{isUndefined as a}from"./is-undefined.mjs";import{isEmpty as o}from"./is-empty.mjs";import{isSet as s}from"./is-set.mjs";import{isString as c}from"./is-string.mjs";import{isSetString as l}from"./is-set-string.mjs";import{isObject as u}from"./is-object.mjs";import{isBufferExists as d}from"./is-buffer.mjs";import"./type-detect.mjs";import"./is-collection.mjs";import{isError as f}from"./is-error.mjs";export{};
1
+ import { getObjectTag } from "./get-object-tag.mjs";
2
+ import { isObjectLike, isPlainObject } from "./is-plain-object.mjs";
3
+ import { isNull } from "./is-null.mjs";
4
+ import { isNumber } from "./is-number.mjs";
5
+ import { isUndefined } from "./is-undefined.mjs";
6
+ import { isEmpty } from "./is-empty.mjs";
7
+ import { isSet } from "./is-set.mjs";
8
+ import { isString } from "./is-string.mjs";
9
+ import { isSetString } from "./is-set-string.mjs";
10
+ import { isObject } from "./is-object.mjs";
11
+ import { isBufferExists } from "./is-buffer.mjs";
12
+ import "./type-detect.mjs";
13
+ import "./is-collection.mjs";
14
+ import { isError } from "./is-error.mjs";
15
+
16
+ export { };
@@ -1 +1,12 @@
1
- const e=typeof Buffer<`u`,t=e?Buffer.isBuffer.bind(Buffer):function(e){return!1};exports.isBufferExists=e;
1
+
2
+ //#region ../type-checks/src/is-buffer.ts
3
+ const isBufferExists = typeof Buffer !== "undefined";
4
+ /**
5
+ * Check if the provided value's type is `Buffer`
6
+ */
7
+ const isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {
8
+ return false;
9
+ };
10
+
11
+ //#endregion
12
+ exports.isBufferExists = isBufferExists;
@@ -1,2 +1,12 @@
1
- const e=typeof Buffer<`u`;e&&Buffer.isBuffer.bind(Buffer);export{e as isBufferExists};
1
+ //#region ../type-checks/src/is-buffer.ts
2
+ const isBufferExists = typeof Buffer !== "undefined";
3
+ /**
4
+ * Check if the provided value's type is `Buffer`
5
+ */
6
+ const isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {
7
+ return false;
8
+ };
9
+
10
+ //#endregion
11
+ export { isBufferExists };
2
12
  //# sourceMappingURL=is-buffer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../../../../type-checks/src/is-buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n"],"mappings":"AAkBA,MAAa,EAAiB,OAAO,OAAW,IAKA,GAC5C,OAAO,SAAS,KAAK,OAAO"}
1
+ {"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../../../../type-checks/src/is-buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n"],"mappings":";AAkBA,MAAa,iBAAiB,OAAO,WAAW;;;;AAKhD,MAAaA,WAAmC,iBAC5C,OAAO,SAAS,KAAK,OAAO,GAO5B,SAASC,WACP,OACiB;AACjB,QAAO"}
@@ -1 +1 @@
1
- require(`./type-detect.cjs`);
1
+ require('./type-detect.cjs');
@@ -1 +1,3 @@
1
- import"./type-detect.mjs";export{};
1
+ import "./type-detect.mjs";
2
+
3
+ export { };