@shell-shock/core 0.17.8 → 0.17.11

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 (272) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/api.cjs +36 -1
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +2 -77
  5. package/dist/api.d.cts.map +1 -1
  6. package/dist/api.d.mts +2 -76
  7. package/dist/api.d.mts.map +1 -1
  8. package/dist/api.mjs +35 -1
  9. package/dist/api.mjs.map +1 -1
  10. package/dist/components/command-validation-logic.cjs +291 -1
  11. package/dist/components/command-validation-logic.cjs.map +1 -0
  12. package/dist/components/command-validation-logic.d.cts +1 -3
  13. package/dist/components/command-validation-logic.d.cts.map +1 -1
  14. package/dist/components/command-validation-logic.d.mts +1 -3
  15. package/dist/components/command-validation-logic.d.mts.map +1 -1
  16. package/dist/components/command-validation-logic.mjs +288 -1
  17. package/dist/components/command-validation-logic.mjs.map +1 -1
  18. package/dist/components/docs.cjs +265 -1
  19. package/dist/components/docs.cjs.map +1 -0
  20. package/dist/components/docs.d.cts +4 -5
  21. package/dist/components/docs.d.cts.map +1 -1
  22. package/dist/components/docs.d.mts +4 -5
  23. package/dist/components/docs.d.mts.map +1 -1
  24. package/dist/components/docs.mjs +256 -1
  25. package/dist/components/docs.mjs.map +1 -1
  26. package/dist/components/exec-builtin.cjs +429 -15
  27. package/dist/components/exec-builtin.cjs.map +1 -0
  28. package/dist/components/exec-builtin.d.cts +1 -2
  29. package/dist/components/exec-builtin.d.cts.map +1 -1
  30. package/dist/components/exec-builtin.d.mts +1 -2
  31. package/dist/components/exec-builtin.d.mts.map +1 -1
  32. package/dist/components/exec-builtin.mjs +424 -15
  33. package/dist/components/exec-builtin.mjs.map +1 -1
  34. package/dist/components/helpers.cjs +119 -1
  35. package/dist/components/helpers.cjs.map +1 -0
  36. package/dist/components/helpers.d.cts +6 -8
  37. package/dist/components/helpers.d.cts.map +1 -1
  38. package/dist/components/helpers.d.mts +6 -8
  39. package/dist/components/helpers.d.mts.map +1 -1
  40. package/dist/components/helpers.mjs +111 -1
  41. package/dist/components/helpers.mjs.map +1 -1
  42. package/dist/components/index.cjs +58 -1
  43. package/dist/components/index.mjs +10 -1
  44. package/dist/components/options-parser-logic.cjs +959 -5
  45. package/dist/components/options-parser-logic.cjs.map +1 -0
  46. package/dist/components/options-parser-logic.d.cts +8 -9
  47. package/dist/components/options-parser-logic.d.cts.map +1 -1
  48. package/dist/components/options-parser-logic.d.mts +8 -9
  49. package/dist/components/options-parser-logic.d.mts.map +1 -1
  50. package/dist/components/options-parser-logic.mjs +944 -5
  51. package/dist/components/options-parser-logic.mjs.map +1 -1
  52. package/dist/components/state-builtin.cjs +630 -8
  53. package/dist/components/state-builtin.cjs.map +1 -0
  54. package/dist/components/state-builtin.d.cts +4 -5
  55. package/dist/components/state-builtin.d.cts.map +1 -1
  56. package/dist/components/state-builtin.d.mts +4 -5
  57. package/dist/components/state-builtin.d.mts.map +1 -1
  58. package/dist/components/state-builtin.mjs +622 -8
  59. package/dist/components/state-builtin.mjs.map +1 -1
  60. package/dist/components/usage.cjs +116 -1
  61. package/dist/components/usage.cjs.map +1 -0
  62. package/dist/components/usage.d.cts +1 -2
  63. package/dist/components/usage.d.cts.map +1 -1
  64. package/dist/components/usage.d.mts +1 -2
  65. package/dist/components/usage.d.mts.map +1 -1
  66. package/dist/components/usage.mjs +113 -1
  67. package/dist/components/usage.mjs.map +1 -1
  68. package/dist/components/utils-builtin.cjs +839 -33
  69. package/dist/components/utils-builtin.cjs.map +1 -0
  70. package/dist/components/utils-builtin.d.cts +7 -8
  71. package/dist/components/utils-builtin.d.cts.map +1 -1
  72. package/dist/components/utils-builtin.d.mts +7 -8
  73. package/dist/components/utils-builtin.d.mts.map +1 -1
  74. package/dist/components/utils-builtin.mjs +828 -33
  75. package/dist/components/utils-builtin.mjs.map +1 -1
  76. package/dist/config.cjs +65 -1
  77. package/dist/config.cjs.map +1 -0
  78. package/dist/config.d.cts +29 -8
  79. package/dist/config.d.cts.map +1 -1
  80. package/dist/config.d.mts +29 -8
  81. package/dist/config.d.mts.map +1 -1
  82. package/dist/config.mjs +62 -1
  83. package/dist/config.mjs.map +1 -1
  84. package/dist/contexts/command.cjs +26 -1
  85. package/dist/contexts/command.cjs.map +1 -0
  86. package/dist/contexts/command.d.cts.map +1 -1
  87. package/dist/contexts/command.d.mts.map +1 -1
  88. package/dist/contexts/command.mjs +23 -1
  89. package/dist/contexts/command.mjs.map +1 -1
  90. package/dist/contexts/index.cjs +9 -1
  91. package/dist/contexts/index.mjs +4 -1
  92. package/dist/contexts/options.cjs +63 -1
  93. package/dist/contexts/options.cjs.map +1 -0
  94. package/dist/contexts/options.d.cts.map +1 -1
  95. package/dist/contexts/options.d.mts.map +1 -1
  96. package/dist/contexts/options.mjs +57 -1
  97. package/dist/contexts/options.mjs.map +1 -1
  98. package/dist/engine.cjs +138 -0
  99. package/dist/engine.cjs.map +1 -0
  100. package/dist/engine.d.cts +79 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +79 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +136 -0
  105. package/dist/engine.mjs.map +1 -0
  106. package/dist/helpers/automd.cjs +70 -1
  107. package/dist/helpers/automd.cjs.map +1 -0
  108. package/dist/helpers/automd.mjs +69 -1
  109. package/dist/helpers/automd.mjs.map +1 -1
  110. package/dist/helpers/docs-helpers.cjs +23 -1
  111. package/dist/helpers/docs-helpers.cjs.map +1 -0
  112. package/dist/helpers/docs-helpers.mjs +22 -1
  113. package/dist/helpers/docs-helpers.mjs.map +1 -1
  114. package/dist/helpers/get-framework.cjs +24 -0
  115. package/dist/helpers/get-framework.cjs.map +1 -0
  116. package/dist/helpers/get-framework.mjs +24 -0
  117. package/dist/helpers/get-framework.mjs.map +1 -0
  118. package/dist/helpers/paths.cjs +137 -1
  119. package/dist/helpers/paths.cjs.map +1 -0
  120. package/dist/helpers/paths.mjs +133 -1
  121. package/dist/helpers/paths.mjs.map +1 -1
  122. package/dist/helpers/persistence.cjs +113 -1
  123. package/dist/helpers/persistence.cjs.map +1 -0
  124. package/dist/helpers/persistence.mjs +112 -1
  125. package/dist/helpers/persistence.mjs.map +1 -1
  126. package/dist/helpers/update-package-json.cjs +65 -1
  127. package/dist/helpers/update-package-json.cjs.map +1 -0
  128. package/dist/helpers/update-package-json.mjs +63 -1
  129. package/dist/helpers/update-package-json.mjs.map +1 -1
  130. package/dist/helpers/utilities.cjs +95 -1
  131. package/dist/helpers/utilities.cjs.map +1 -0
  132. package/dist/helpers/utilities.mjs +93 -1
  133. package/dist/helpers/utilities.mjs.map +1 -1
  134. package/dist/helpers/validations.cjs +71 -1
  135. package/dist/helpers/validations.cjs.map +1 -0
  136. package/dist/helpers/validations.mjs +69 -1
  137. package/dist/helpers/validations.mjs.map +1 -1
  138. package/dist/index.cjs +123 -1
  139. package/dist/index.cjs.map +1 -0
  140. package/dist/index.d.cts +80 -5
  141. package/dist/index.d.cts.map +1 -0
  142. package/dist/index.d.mts +80 -5
  143. package/dist/index.d.mts.map +1 -0
  144. package/dist/index.mjs +119 -1
  145. package/dist/index.mjs.map +1 -0
  146. package/dist/package.cjs +12 -0
  147. package/dist/package.cjs.map +1 -0
  148. package/dist/package.mjs +6 -0
  149. package/dist/package.mjs.map +1 -0
  150. package/dist/plugin-utils/compute-bin.cjs +48 -1
  151. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  152. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  153. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  154. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  155. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  156. package/dist/plugin-utils/compute-bin.mjs +47 -1
  157. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  158. package/dist/plugin-utils/context-helpers.cjs +224 -1
  159. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  160. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  161. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  162. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  163. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  164. package/dist/plugin-utils/context-helpers.mjs +214 -1
  165. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  166. package/dist/plugin-utils/deepkit.cjs +70 -1
  167. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  168. package/dist/plugin-utils/deepkit.d.cts +5 -5
  169. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  170. package/dist/plugin-utils/deepkit.d.mts +5 -5
  171. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  172. package/dist/plugin-utils/deepkit.mjs +68 -1
  173. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  174. package/dist/plugin-utils/description-helpers.cjs +112 -2
  175. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  176. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  177. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  178. package/dist/plugin-utils/description-helpers.mjs +107 -2
  179. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  180. package/dist/plugin-utils/get-command-tree.cjs +118 -1
  181. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  182. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  183. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  184. package/dist/plugin-utils/get-command-tree.mjs +114 -1
  185. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  186. package/dist/plugin-utils/index.cjs +39 -1
  187. package/dist/plugin-utils/index.d.cts +2 -2
  188. package/dist/plugin-utils/index.d.mts +2 -2
  189. package/dist/plugin-utils/index.mjs +10 -1
  190. package/dist/plugin-utils/reflect.cjs +52 -1
  191. package/dist/plugin-utils/reflect.cjs.map +1 -0
  192. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  193. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  194. package/dist/plugin-utils/reflect.mjs +50 -1
  195. package/dist/plugin-utils/reflect.mjs.map +1 -1
  196. package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
  197. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  198. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  199. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  200. package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
  201. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  202. package/dist/plugin-utils/type-checks.cjs +222 -1
  203. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  204. package/dist/plugin-utils/type-checks.d.cts +5 -5
  205. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  206. package/dist/plugin-utils/type-checks.d.mts +5 -5
  207. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  208. package/dist/plugin-utils/type-checks.mjs +217 -1
  209. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  210. package/dist/plugin.cjs +495 -4
  211. package/dist/plugin.cjs.map +1 -0
  212. package/dist/plugin.d.cts.map +1 -1
  213. package/dist/plugin.d.mts.map +1 -1
  214. package/dist/plugin.mjs +488 -4
  215. package/dist/plugin.mjs.map +1 -1
  216. package/dist/resolver/helpers.cjs +182 -1
  217. package/dist/resolver/helpers.cjs.map +1 -0
  218. package/dist/resolver/helpers.mjs +178 -1
  219. package/dist/resolver/helpers.mjs.map +1 -1
  220. package/dist/resolver/resolve.cjs +479 -1
  221. package/dist/resolver/resolve.cjs.map +1 -0
  222. package/dist/resolver/resolve.mjs +478 -1
  223. package/dist/resolver/resolve.mjs.map +1 -1
  224. package/dist/types/command.cjs +402 -1
  225. package/dist/types/command.cjs.map +1 -0
  226. package/dist/types/command.d.cts +61 -119
  227. package/dist/types/command.d.cts.map +1 -1
  228. package/dist/types/command.d.mts +61 -119
  229. package/dist/types/command.d.mts.map +1 -1
  230. package/dist/types/command.mjs +367 -1
  231. package/dist/types/command.mjs.map +1 -1
  232. package/dist/types/config.cjs +175 -1
  233. package/dist/types/config.cjs.map +1 -0
  234. package/dist/types/config.d.cts +19 -12
  235. package/dist/types/config.d.cts.map +1 -1
  236. package/dist/types/config.d.mts +19 -12
  237. package/dist/types/config.d.mts.map +1 -1
  238. package/dist/types/config.mjs +163 -1
  239. package/dist/types/config.mjs.map +1 -1
  240. package/dist/types/context.cjs +45 -1
  241. package/dist/types/context.cjs.map +1 -0
  242. package/dist/types/context.d.cts +3 -2
  243. package/dist/types/context.d.cts.map +1 -1
  244. package/dist/types/context.d.mts +3 -2
  245. package/dist/types/context.d.mts.map +1 -1
  246. package/dist/types/context.mjs +40 -1
  247. package/dist/types/context.mjs.map +1 -1
  248. package/dist/types/env.cjs +53 -1
  249. package/dist/types/env.cjs.map +1 -0
  250. package/dist/types/env.d.cts +1 -1
  251. package/dist/types/env.d.cts.map +1 -1
  252. package/dist/types/env.d.mts +1 -1
  253. package/dist/types/env.d.mts.map +1 -1
  254. package/dist/types/env.mjs +50 -1
  255. package/dist/types/env.mjs.map +1 -1
  256. package/dist/types/index.cjs +53 -1
  257. package/dist/types/index.d.cts +4 -4
  258. package/dist/types/index.d.mts +4 -4
  259. package/dist/types/index.mjs +6 -1
  260. package/dist/types/options.cjs +13 -1
  261. package/dist/types/options.cjs.map +1 -0
  262. package/dist/types/options.d.cts.map +1 -1
  263. package/dist/types/options.d.mts.map +1 -1
  264. package/dist/types/options.mjs +10 -1
  265. package/dist/types/options.mjs.map +1 -1
  266. package/package.json +43 -34
  267. package/dist/resolver/deepkit.cjs +0 -1
  268. package/dist/resolver/deepkit.mjs +0 -2
  269. package/dist/resolver/deepkit.mjs.map +0 -1
  270. package/dist/resolver/module.cjs +0 -1
  271. package/dist/resolver/module.mjs +0 -2
  272. package/dist/resolver/module.mjs.map +0 -1
@@ -1 +1,222 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../types/command.cjs`);let t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/type-checks/is-set-object`),r=require(`@stryke/type-checks/is-boolean`);function i(n){return(0,t.isSetString)(n)&&[e.CommandParameterKinds.string,e.CommandParameterKinds.number,e.CommandParameterKinds.boolean].includes(n)}i.__type=[`obj`,`isCommandParameterKind`,`Type guard to check if a value is a valid {@link CommandParameterKind} type.`,`P"2!!/"?#`];function a(e){return(0,n.isSetObject)(e)&&`kind`in e&&i(e.kind)}a.__type=[`obj`,`isCommandParameterConfig`,`Type guard to check if a value is a valid {@link CommandParameterConfig} type.`,`P"2!!/"?#`];function o(e){return a(e)&&`name`in e&&(0,t.isSetString)(e.name)&&`title`in e&&(0,t.isSetString)(e.title)&&`description`in e&&(0,t.isSetString)(e.description)&&`alias`in e&&Array.isArray(e.alias)&&`env`in e&&((0,t.isSetString)(e.env)||e.env===!1)&&`optional`in e&&(0,r.isBoolean)(e.optional)&&`variadic`in e&&(0,r.isBoolean)(e.variadic)}o.__type=[`obj`,`isCommandParameter`,`Type guard to check if a value is a valid {@link CommandParameter} type.`,`P"2!!/"?#`];function s(e){return a(e)&&o(e)&&`default`in e}s.__type=[`obj`,`isCommandOption`,`Type guard to check if a value is a valid {@link CommandOption} type.`,`P"2!!/"?#`];function c(e){return a(e)&&o(e)}c.__type=[`obj`,`isCommandArgument`,`Type guard to check if a value is a valid {@link CommandArgument} type.`,`P"2!!/"?#`],exports.isCommandArgument=c,exports.isCommandOption=s,exports.isCommandParameter=o,exports.isCommandParameterConfig=a,exports.isCommandParameterKind=i;
1
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
2
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
3
+ let _stryke_type_checks_is_boolean = require("@stryke/type-checks/is-boolean");
4
+
5
+ //#region src/plugin-utils/type-checks.ts
6
+ const __ΩRecord = [
7
+ "K",
8
+ "T",
9
+ "Record",
10
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
11
+ ];
12
+ function __assignType(fn, args) {
13
+ fn.__type = args;
14
+ return fn;
15
+ }
16
+ function isStringArray(value) {
17
+ return Array.isArray(value) && value.every(__assignType((item) => (0, _stryke_type_checks_is_set_string.isSetString)(item), [
18
+ "item",
19
+ "",
20
+ "P\"2!\"/\""
21
+ ]));
22
+ }
23
+ isStringArray.__type = [
24
+ "value",
25
+ "isStringArray",
26
+ "P#2!!/\""
27
+ ];
28
+ function isNumberArray(value) {
29
+ return Array.isArray(value) && value.every(__assignType((item) => typeof item === "number" && Number.isFinite(item), [
30
+ "item",
31
+ "",
32
+ "P\"2!\"/\""
33
+ ]));
34
+ }
35
+ isNumberArray.__type = [
36
+ "value",
37
+ "isNumberArray",
38
+ "P#2!!/\""
39
+ ];
40
+ function isBooleanArray(value) {
41
+ return Array.isArray(value) && value.every(__assignType((item) => (0, _stryke_type_checks_is_boolean.isBoolean)(item), [
42
+ "item",
43
+ "",
44
+ "P\"2!\"/\""
45
+ ]));
46
+ }
47
+ isBooleanArray.__type = [
48
+ "value",
49
+ "isBooleanArray",
50
+ "P#2!!/\""
51
+ ];
52
+ function isAliasConfig(value) {
53
+ return (0, _stryke_type_checks_is_set_string.isSetString)(value) || isStringArray(value);
54
+ }
55
+ isAliasConfig.__type = [
56
+ "value",
57
+ "isAliasConfig",
58
+ "P#2!!/\""
59
+ ];
60
+ function isTypedDefaultValue(type, value, variadic) {
61
+ if (type === "string") {
62
+ if (variadic === true) return isStringArray(value);
63
+ if (variadic === false) return (0, _stryke_type_checks_is_set_string.isSetString)(value);
64
+ return (0, _stryke_type_checks_is_set_string.isSetString)(value) || isStringArray(value);
65
+ }
66
+ if (type === "number") {
67
+ if (variadic === true) return isNumberArray(value);
68
+ if (variadic === false) return typeof value === "number" && Number.isFinite(value);
69
+ return typeof value === "number" && Number.isFinite(value) || isNumberArray(value);
70
+ }
71
+ if (variadic === true) return isBooleanArray(value);
72
+ if (variadic === false) return (0, _stryke_type_checks_is_boolean.isBoolean)(value);
73
+ return (0, _stryke_type_checks_is_boolean.isBoolean)(value) || isBooleanArray(value);
74
+ }
75
+ isTypedDefaultValue.__type = [
76
+ "CommandParameterType",
77
+ "type",
78
+ "value",
79
+ "variadic",
80
+ "isTypedDefaultValue",
81
+ "P\"w!2\"#2#)2$8)/%"
82
+ ];
83
+ function hasValidOptionalCommonFields(obj) {
84
+ if ("alias" in obj && obj.alias !== void 0 && !isAliasConfig(obj.alias)) return false;
85
+ if ("name" in obj && obj.name !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.name)) return false;
86
+ if ("title" in obj && obj.title !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.title)) return false;
87
+ if ("description" in obj && obj.description !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.description)) return false;
88
+ if ("env" in obj && obj.env !== void 0 && !((0, _stryke_type_checks_is_set_string.isSetString)(obj.env) || obj.env === false)) return false;
89
+ if ("required" in obj && obj.required !== void 0 && !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.required)) return false;
90
+ if ("variadic" in obj && obj.variadic !== void 0 && !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.variadic)) return false;
91
+ return true;
92
+ }
93
+ hasValidOptionalCommonFields.__type = [
94
+ () => __ΩRecord,
95
+ "obj",
96
+ "hasValidOptionalCommonFields",
97
+ "P&#o!#2\")/#"
98
+ ];
99
+ function hasValidTypeSpecificFields(obj, type) {
100
+ const variadic = (0, _stryke_type_checks_is_boolean.isBoolean)(obj.variadic) ? obj.variadic : void 0;
101
+ if ("default" in obj && obj.default !== void 0 && !isTypedDefaultValue(type, obj.default, variadic)) return false;
102
+ if (type === "string") {
103
+ if ("format" in obj && obj.format !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.format)) return false;
104
+ if ("choices" in obj && obj.choices !== void 0 && !isStringArray(obj.choices)) return false;
105
+ return true;
106
+ }
107
+ if (type === "number") {
108
+ if ("choices" in obj && obj.choices !== void 0 && !isNumberArray(obj.choices)) return false;
109
+ return true;
110
+ }
111
+ if ("choices" in obj && obj.choices !== void 0) return false;
112
+ if ("format" in obj && obj.format !== void 0) return false;
113
+ return true;
114
+ }
115
+ hasValidTypeSpecificFields.__type = [
116
+ () => __ΩRecord,
117
+ "obj",
118
+ "CommandParameterType",
119
+ "type",
120
+ "hasValidTypeSpecificFields",
121
+ "P&#o!#2\"\"w#2$)/%"
122
+ ];
123
+ /**
124
+ * Type guard to check if a value is a valid {@link CommandParameterType} type.
125
+ *
126
+ * @param obj - The value to check.
127
+ * @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
128
+ */
129
+ function isCommandParameterType(obj) {
130
+ return (0, _stryke_type_checks_is_set_string.isSetString)(obj) && [
131
+ "string",
132
+ "number",
133
+ "boolean"
134
+ ].includes(obj);
135
+ }
136
+ isCommandParameterType.__type = [
137
+ "obj",
138
+ "isCommandParameterType",
139
+ "Type guard to check if a value is a valid {@link CommandParameterType} type.",
140
+ "P\"2!!/\"?#"
141
+ ];
142
+ /**
143
+ * Type guard to check if a value is a valid {@link CommandParameterConfig} type.
144
+ *
145
+ * @param obj - The value to check.
146
+ * @returns True if the value is a valid {@link CommandParameterConfig} type, false otherwise.
147
+ */
148
+ function isCommandParameterConfig(obj) {
149
+ if (!(0, _stryke_type_checks_is_set_object.isSetObject)(obj) || !("type" in obj) || !isCommandParameterType(obj.type)) return false;
150
+ return hasValidOptionalCommonFields(obj) && hasValidTypeSpecificFields(obj, obj.type);
151
+ }
152
+ isCommandParameterConfig.__type = [
153
+ "obj",
154
+ "isCommandParameterConfig",
155
+ "Type guard to check if a value is a valid {@link CommandParameterConfig} type.",
156
+ "P\"2!!/\"?#"
157
+ ];
158
+ /**
159
+ * Type guard to check if a value is a valid {@link CommandParameter} type.
160
+ *
161
+ * @param obj - The value to check.
162
+ * @returns True if the value is a valid {@link CommandParameter} type, false otherwise.
163
+ */
164
+ function isCommandParameter(obj) {
165
+ if (!isCommandParameterConfig(obj)) return false;
166
+ if (!("name" in obj) || !(0, _stryke_type_checks_is_set_string.isSetString)(obj.name)) return false;
167
+ if (!("title" in obj) || !(0, _stryke_type_checks_is_set_string.isSetString)(obj.title)) return false;
168
+ if (!("description" in obj) || !(0, _stryke_type_checks_is_set_string.isSetString)(obj.description)) return false;
169
+ if (!("alias" in obj) || !isStringArray(obj.alias)) return false;
170
+ if (!("env" in obj) || !((0, _stryke_type_checks_is_set_string.isSetString)(obj.env) || obj.env === false)) return false;
171
+ if (!("required" in obj) || !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.required)) return false;
172
+ if (!("variadic" in obj) || !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.variadic)) return false;
173
+ return hasValidTypeSpecificFields(obj, obj.type);
174
+ }
175
+ isCommandParameter.__type = [
176
+ "obj",
177
+ "isCommandParameter",
178
+ "Type guard to check if a value is a valid {@link CommandParameter} type.",
179
+ "P\"2!!/\"?#"
180
+ ];
181
+ /**
182
+ * Type guard to check if a value is a valid {@link CommandOption} type.
183
+ *
184
+ * @param obj - The value to check.
185
+ * @returns True if the value is a valid {@link CommandOption} type, false otherwise.
186
+ */
187
+ function isCommandOption(obj) {
188
+ if (!isCommandParameter(obj)) return false;
189
+ if (obj.type !== "boolean") return true;
190
+ if ("isNegativeOf" in obj && obj.isNegativeOf !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.isNegativeOf)) return false;
191
+ if ("skipAddingNegative" in obj && obj.skipAddingNegative !== void 0 && !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.skipAddingNegative)) return false;
192
+ return true;
193
+ }
194
+ isCommandOption.__type = [
195
+ "obj",
196
+ "isCommandOption",
197
+ "Type guard to check if a value is a valid {@link CommandOption} type.",
198
+ "P\"2!!/\"?#"
199
+ ];
200
+ /**
201
+ * Type guard to check if a value is a valid {@link CommandArgument} type.
202
+ *
203
+ * @param obj - The value to check.
204
+ * @returns True if the value is a valid {@link CommandArgument} type, false otherwise.
205
+ */
206
+ function isCommandArgument(obj) {
207
+ return isCommandParameter(obj);
208
+ }
209
+ isCommandArgument.__type = [
210
+ "obj",
211
+ "isCommandArgument",
212
+ "Type guard to check if a value is a valid {@link CommandArgument} type.",
213
+ "P\"2!!/\"?#"
214
+ ];
215
+
216
+ //#endregion
217
+ exports.isCommandArgument = isCommandArgument;
218
+ exports.isCommandOption = isCommandOption;
219
+ exports.isCommandParameter = isCommandParameter;
220
+ exports.isCommandParameterConfig = isCommandParameterConfig;
221
+ exports.isCommandParameterType = isCommandParameterType;
222
+ //# sourceMappingURL=type-checks.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-checks.cjs","names":[],"sources":[],"mappings":""}
@@ -1,13 +1,13 @@
1
- import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig, CommandParameterKind } from "../types/command.cjs";
1
+ import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig, CommandParameterType } from "../types/command.cjs";
2
2
 
3
3
  //#region src/plugin-utils/type-checks.d.ts
4
4
  /**
5
- * Type guard to check if a value is a valid {@link CommandParameterKind} type.
5
+ * Type guard to check if a value is a valid {@link CommandParameterType} type.
6
6
  *
7
7
  * @param obj - The value to check.
8
- * @returns True if the value is a valid {@link CommandParameterKind} type, false otherwise.
8
+ * @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
9
9
  */
10
- declare function isCommandParameterKind(obj: any): obj is CommandParameterKind;
10
+ declare function isCommandParameterType(obj: any): obj is CommandParameterType;
11
11
  /**
12
12
  * Type guard to check if a value is a valid {@link CommandParameterConfig} type.
13
13
  *
@@ -37,5 +37,5 @@ declare function isCommandOption(obj: any): obj is CommandOption;
37
37
  */
38
38
  declare function isCommandArgument(obj: any): obj is CommandArgument;
39
39
  //#endregion
40
- export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterKind };
40
+ export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType };
41
41
  //# sourceMappingURL=type-checks.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checks.d.cts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":";;;;;AAoCA;;;;iBAAgB,sBAAA,CAAuB,GAAA,QAAW,GAAA,IAAO,oBAAA;;;;;AAiBzD;;iBAAgB,wBAAA,CACd,GAAA,QACC,GAAA,IAAO,sBAAA;;;;;;;iBAUM,kBAAA,CAAmB,GAAA,QAAW,GAAA,IAAO,gBAAA;;;;;;;iBA0BrC,eAAA,CAAgB,GAAA,QAAW,GAAA,IAAO,aAAA;;AAAlD;;;;;iBAYgB,iBAAA,CAAkB,GAAA,QAAW,GAAA,IAAO,eAAA"}
1
+ {"version":3,"file":"type-checks.d.cts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":";;;;;AA0MA;;;;iBAAgB,sBAAA,CAAuB,GAAA,QAAW,GAAA,IAAO,oBAAoB;;;;AAAA;AAU7E;;iBAAgB,wBAAA,CACd,GAAA,QACC,GAAA,IAAO,sBAAsB;;;;;;AAAA;iBAqBhB,kBAAA,CAAmB,GAAA,QAAW,GAAA,IAAO,gBAAgB;;;;;;;iBA0CrD,eAAA,CAAgB,GAAA,QAAW,GAAA,IAAO,aAAa;AA1CM;AA0CrE;;;;;AA1CqE,iBA4ErD,iBAAA,CAAkB,GAAA,QAAW,GAAA,IAAO,eAAe"}
@@ -1,13 +1,13 @@
1
- import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig, CommandParameterKind } from "../types/command.mjs";
1
+ import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig, CommandParameterType } from "../types/command.mjs";
2
2
 
3
3
  //#region src/plugin-utils/type-checks.d.ts
4
4
  /**
5
- * Type guard to check if a value is a valid {@link CommandParameterKind} type.
5
+ * Type guard to check if a value is a valid {@link CommandParameterType} type.
6
6
  *
7
7
  * @param obj - The value to check.
8
- * @returns True if the value is a valid {@link CommandParameterKind} type, false otherwise.
8
+ * @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
9
9
  */
10
- declare function isCommandParameterKind(obj: any): obj is CommandParameterKind;
10
+ declare function isCommandParameterType(obj: any): obj is CommandParameterType;
11
11
  /**
12
12
  * Type guard to check if a value is a valid {@link CommandParameterConfig} type.
13
13
  *
@@ -37,5 +37,5 @@ declare function isCommandOption(obj: any): obj is CommandOption;
37
37
  */
38
38
  declare function isCommandArgument(obj: any): obj is CommandArgument;
39
39
  //#endregion
40
- export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterKind };
40
+ export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType };
41
41
  //# sourceMappingURL=type-checks.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checks.d.mts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":";;;;;AAoCA;;;;iBAAgB,sBAAA,CAAuB,GAAA,QAAW,GAAA,IAAO,oBAAA;;;;;AAiBzD;;iBAAgB,wBAAA,CACd,GAAA,QACC,GAAA,IAAO,sBAAA;;;;;;;iBAUM,kBAAA,CAAmB,GAAA,QAAW,GAAA,IAAO,gBAAA;;;;;;;iBA0BrC,eAAA,CAAgB,GAAA,QAAW,GAAA,IAAO,aAAA;;AAAlD;;;;;iBAYgB,iBAAA,CAAkB,GAAA,QAAW,GAAA,IAAO,eAAA"}
1
+ {"version":3,"file":"type-checks.d.mts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":""}
@@ -1,2 +1,218 @@
1
- import{CommandParameterKinds as e}from"../types/command.mjs";import{isSetString as t}from"@stryke/type-checks/is-set-string";import{isSetObject as n}from"@stryke/type-checks/is-set-object";import{isBoolean as r}from"@stryke/type-checks/is-boolean";function i(n){return t(n)&&[e.string,e.number,e.boolean].includes(n)}i.__type=[`obj`,`isCommandParameterKind`,`Type guard to check if a value is a valid {@link CommandParameterKind} type.`,`P"2!!/"?#`];function a(e){return n(e)&&`kind`in e&&i(e.kind)}a.__type=[`obj`,`isCommandParameterConfig`,`Type guard to check if a value is a valid {@link CommandParameterConfig} type.`,`P"2!!/"?#`];function o(e){return a(e)&&`name`in e&&t(e.name)&&`title`in e&&t(e.title)&&`description`in e&&t(e.description)&&`alias`in e&&Array.isArray(e.alias)&&`env`in e&&(t(e.env)||e.env===!1)&&`optional`in e&&r(e.optional)&&`variadic`in e&&r(e.variadic)}o.__type=[`obj`,`isCommandParameter`,`Type guard to check if a value is a valid {@link CommandParameter} type.`,`P"2!!/"?#`];function s(e){return a(e)&&o(e)&&`default`in e}s.__type=[`obj`,`isCommandOption`,`Type guard to check if a value is a valid {@link CommandOption} type.`,`P"2!!/"?#`];function c(e){return a(e)&&o(e)}c.__type=[`obj`,`isCommandArgument`,`Type guard to check if a value is a valid {@link CommandArgument} type.`,`P"2!!/"?#`];export{c as isCommandArgument,s as isCommandOption,o as isCommandParameter,a as isCommandParameterConfig,i as isCommandParameterKind};
1
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
2
+ import { isSetString } from "@stryke/type-checks/is-set-string";
3
+ import { isBoolean } from "@stryke/type-checks/is-boolean";
4
+
5
+ //#region src/plugin-utils/type-checks.ts
6
+ const __ΩRecord = [
7
+ "K",
8
+ "T",
9
+ "Record",
10
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
11
+ ];
12
+ function __assignType(fn, args) {
13
+ fn.__type = args;
14
+ return fn;
15
+ }
16
+ function isStringArray(value) {
17
+ return Array.isArray(value) && value.every(__assignType((item) => isSetString(item), [
18
+ "item",
19
+ "",
20
+ "P\"2!\"/\""
21
+ ]));
22
+ }
23
+ isStringArray.__type = [
24
+ "value",
25
+ "isStringArray",
26
+ "P#2!!/\""
27
+ ];
28
+ function isNumberArray(value) {
29
+ return Array.isArray(value) && value.every(__assignType((item) => typeof item === "number" && Number.isFinite(item), [
30
+ "item",
31
+ "",
32
+ "P\"2!\"/\""
33
+ ]));
34
+ }
35
+ isNumberArray.__type = [
36
+ "value",
37
+ "isNumberArray",
38
+ "P#2!!/\""
39
+ ];
40
+ function isBooleanArray(value) {
41
+ return Array.isArray(value) && value.every(__assignType((item) => isBoolean(item), [
42
+ "item",
43
+ "",
44
+ "P\"2!\"/\""
45
+ ]));
46
+ }
47
+ isBooleanArray.__type = [
48
+ "value",
49
+ "isBooleanArray",
50
+ "P#2!!/\""
51
+ ];
52
+ function isAliasConfig(value) {
53
+ return isSetString(value) || isStringArray(value);
54
+ }
55
+ isAliasConfig.__type = [
56
+ "value",
57
+ "isAliasConfig",
58
+ "P#2!!/\""
59
+ ];
60
+ function isTypedDefaultValue(type, value, variadic) {
61
+ if (type === "string") {
62
+ if (variadic === true) return isStringArray(value);
63
+ if (variadic === false) return isSetString(value);
64
+ return isSetString(value) || isStringArray(value);
65
+ }
66
+ if (type === "number") {
67
+ if (variadic === true) return isNumberArray(value);
68
+ if (variadic === false) return typeof value === "number" && Number.isFinite(value);
69
+ return typeof value === "number" && Number.isFinite(value) || isNumberArray(value);
70
+ }
71
+ if (variadic === true) return isBooleanArray(value);
72
+ if (variadic === false) return isBoolean(value);
73
+ return isBoolean(value) || isBooleanArray(value);
74
+ }
75
+ isTypedDefaultValue.__type = [
76
+ "CommandParameterType",
77
+ "type",
78
+ "value",
79
+ "variadic",
80
+ "isTypedDefaultValue",
81
+ "P\"w!2\"#2#)2$8)/%"
82
+ ];
83
+ function hasValidOptionalCommonFields(obj) {
84
+ if ("alias" in obj && obj.alias !== void 0 && !isAliasConfig(obj.alias)) return false;
85
+ if ("name" in obj && obj.name !== void 0 && !isSetString(obj.name)) return false;
86
+ if ("title" in obj && obj.title !== void 0 && !isSetString(obj.title)) return false;
87
+ if ("description" in obj && obj.description !== void 0 && !isSetString(obj.description)) return false;
88
+ if ("env" in obj && obj.env !== void 0 && !(isSetString(obj.env) || obj.env === false)) return false;
89
+ if ("required" in obj && obj.required !== void 0 && !isBoolean(obj.required)) return false;
90
+ if ("variadic" in obj && obj.variadic !== void 0 && !isBoolean(obj.variadic)) return false;
91
+ return true;
92
+ }
93
+ hasValidOptionalCommonFields.__type = [
94
+ () => __ΩRecord,
95
+ "obj",
96
+ "hasValidOptionalCommonFields",
97
+ "P&#o!#2\")/#"
98
+ ];
99
+ function hasValidTypeSpecificFields(obj, type) {
100
+ const variadic = isBoolean(obj.variadic) ? obj.variadic : void 0;
101
+ if ("default" in obj && obj.default !== void 0 && !isTypedDefaultValue(type, obj.default, variadic)) return false;
102
+ if (type === "string") {
103
+ if ("format" in obj && obj.format !== void 0 && !isSetString(obj.format)) return false;
104
+ if ("choices" in obj && obj.choices !== void 0 && !isStringArray(obj.choices)) return false;
105
+ return true;
106
+ }
107
+ if (type === "number") {
108
+ if ("choices" in obj && obj.choices !== void 0 && !isNumberArray(obj.choices)) return false;
109
+ return true;
110
+ }
111
+ if ("choices" in obj && obj.choices !== void 0) return false;
112
+ if ("format" in obj && obj.format !== void 0) return false;
113
+ return true;
114
+ }
115
+ hasValidTypeSpecificFields.__type = [
116
+ () => __ΩRecord,
117
+ "obj",
118
+ "CommandParameterType",
119
+ "type",
120
+ "hasValidTypeSpecificFields",
121
+ "P&#o!#2\"\"w#2$)/%"
122
+ ];
123
+ /**
124
+ * Type guard to check if a value is a valid {@link CommandParameterType} type.
125
+ *
126
+ * @param obj - The value to check.
127
+ * @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
128
+ */
129
+ function isCommandParameterType(obj) {
130
+ return isSetString(obj) && [
131
+ "string",
132
+ "number",
133
+ "boolean"
134
+ ].includes(obj);
135
+ }
136
+ isCommandParameterType.__type = [
137
+ "obj",
138
+ "isCommandParameterType",
139
+ "Type guard to check if a value is a valid {@link CommandParameterType} type.",
140
+ "P\"2!!/\"?#"
141
+ ];
142
+ /**
143
+ * Type guard to check if a value is a valid {@link CommandParameterConfig} type.
144
+ *
145
+ * @param obj - The value to check.
146
+ * @returns True if the value is a valid {@link CommandParameterConfig} type, false otherwise.
147
+ */
148
+ function isCommandParameterConfig(obj) {
149
+ if (!isSetObject(obj) || !("type" in obj) || !isCommandParameterType(obj.type)) return false;
150
+ return hasValidOptionalCommonFields(obj) && hasValidTypeSpecificFields(obj, obj.type);
151
+ }
152
+ isCommandParameterConfig.__type = [
153
+ "obj",
154
+ "isCommandParameterConfig",
155
+ "Type guard to check if a value is a valid {@link CommandParameterConfig} type.",
156
+ "P\"2!!/\"?#"
157
+ ];
158
+ /**
159
+ * Type guard to check if a value is a valid {@link CommandParameter} type.
160
+ *
161
+ * @param obj - The value to check.
162
+ * @returns True if the value is a valid {@link CommandParameter} type, false otherwise.
163
+ */
164
+ function isCommandParameter(obj) {
165
+ if (!isCommandParameterConfig(obj)) return false;
166
+ if (!("name" in obj) || !isSetString(obj.name)) return false;
167
+ if (!("title" in obj) || !isSetString(obj.title)) return false;
168
+ if (!("description" in obj) || !isSetString(obj.description)) return false;
169
+ if (!("alias" in obj) || !isStringArray(obj.alias)) return false;
170
+ if (!("env" in obj) || !(isSetString(obj.env) || obj.env === false)) return false;
171
+ if (!("required" in obj) || !isBoolean(obj.required)) return false;
172
+ if (!("variadic" in obj) || !isBoolean(obj.variadic)) return false;
173
+ return hasValidTypeSpecificFields(obj, obj.type);
174
+ }
175
+ isCommandParameter.__type = [
176
+ "obj",
177
+ "isCommandParameter",
178
+ "Type guard to check if a value is a valid {@link CommandParameter} type.",
179
+ "P\"2!!/\"?#"
180
+ ];
181
+ /**
182
+ * Type guard to check if a value is a valid {@link CommandOption} type.
183
+ *
184
+ * @param obj - The value to check.
185
+ * @returns True if the value is a valid {@link CommandOption} type, false otherwise.
186
+ */
187
+ function isCommandOption(obj) {
188
+ if (!isCommandParameter(obj)) return false;
189
+ if (obj.type !== "boolean") return true;
190
+ if ("isNegativeOf" in obj && obj.isNegativeOf !== void 0 && !isSetString(obj.isNegativeOf)) return false;
191
+ if ("skipAddingNegative" in obj && obj.skipAddingNegative !== void 0 && !isBoolean(obj.skipAddingNegative)) return false;
192
+ return true;
193
+ }
194
+ isCommandOption.__type = [
195
+ "obj",
196
+ "isCommandOption",
197
+ "Type guard to check if a value is a valid {@link CommandOption} type.",
198
+ "P\"2!!/\"?#"
199
+ ];
200
+ /**
201
+ * Type guard to check if a value is a valid {@link CommandArgument} type.
202
+ *
203
+ * @param obj - The value to check.
204
+ * @returns True if the value is a valid {@link CommandArgument} type, false otherwise.
205
+ */
206
+ function isCommandArgument(obj) {
207
+ return isCommandParameter(obj);
208
+ }
209
+ isCommandArgument.__type = [
210
+ "obj",
211
+ "isCommandArgument",
212
+ "Type guard to check if a value is a valid {@link CommandArgument} type.",
213
+ "P\"2!!/\"?#"
214
+ ];
215
+
216
+ //#endregion
217
+ export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType };
2
218
  //# sourceMappingURL=type-checks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checks.mjs","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\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/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type {\n CommandArgument,\n CommandOption,\n CommandParameter,\n CommandParameterConfig,\n CommandParameterKind\n} from \"../types/command\";\nimport { CommandParameterKinds } from \"../types/command\";\n\n/**\n * Type guard to check if a value is a valid {@link CommandParameterKind} type.\n *\n * @param obj - The value to check.\n * @returns True if the value is a valid {@link CommandParameterKind} type, false otherwise.\n */\nexport function isCommandParameterKind(obj: any): obj is CommandParameterKind {\n return (\n isSetString(obj) &&\n [\n CommandParameterKinds.string,\n CommandParameterKinds.number,\n CommandParameterKinds.boolean\n ].includes(obj as CommandParameterKind)\n );\n}\n\n/**\n * Type guard to check if a value is a valid {@link CommandParameterConfig} type.\n *\n * @param obj - The value to check.\n * @returns True if the value is a valid {@link CommandParameterConfig} type, false otherwise.\n */\nexport function isCommandParameterConfig(\n obj: any\n): obj is CommandParameterConfig {\n return isSetObject(obj) && \"kind\" in obj && isCommandParameterKind(obj.kind);\n}\n\n/**\n * Type guard to check if a value is a valid {@link CommandParameter} type.\n *\n * @param obj - The value to check.\n * @returns True if the value is a valid {@link CommandParameter} type, false otherwise.\n */\nexport function isCommandParameter(obj: any): obj is CommandParameter {\n return (\n isCommandParameterConfig(obj) &&\n \"name\" in obj &&\n isSetString(obj.name) &&\n \"title\" in obj &&\n isSetString(obj.title) &&\n \"description\" in obj &&\n isSetString(obj.description) &&\n \"alias\" in obj &&\n Array.isArray(obj.alias) &&\n \"env\" in obj &&\n (isSetString(obj.env) || obj.env === false) &&\n \"optional\" in obj &&\n isBoolean(obj.optional) &&\n \"variadic\" in obj &&\n isBoolean(obj.variadic)\n );\n}\n\n/**\n * Type guard to check if a value is a valid {@link CommandOption} type.\n *\n * @param obj - The value to check.\n * @returns True if the value is a valid {@link CommandOption} type, false otherwise.\n */\nexport function isCommandOption(obj: any): obj is CommandOption {\n return (\n isCommandParameterConfig(obj) && isCommandParameter(obj) && \"default\" in obj\n );\n}\n\n/**\n * Type guard to check if a value is a valid {@link CommandArgument} type.\n *\n * @param obj - The value to check.\n * @returns True if the value is a valid {@link CommandArgument} type, false otherwise.\n */\nexport function isCommandArgument(obj: any): obj is CommandArgument {\n return isCommandParameterConfig(obj) && isCommandParameter(obj);\n}\n"],"mappings":"wPA2BA,SAAgB,EAAS,EAAA,CACzB,OAAS,EAAA,EAAA,EAAA,CAAqB,EAAkB,OAAQ,EAAA,OAAA,EAAA,QAAA,CAAA,SAAA,EAAA,CAExD,EAAE,OAAA,CAAA,MAAA,yBAAA,+EAAA,YAAA,CAOF,SAAS,EAAA,EAAA,CACP,OAAE,EAAiB,EAAC,EAAA,SAAA,GAAA,EAAA,EAAA,KAAA,CAEtB,EAAM,OAA4B,CAAA,MAAA,2BAAA,iFAAA,YAAA,CAOlC,SAAE,EAAA,EAAA,CACA,OAAM,EAA0B,EAAI,EAAC,SAAa,GAAA,EAAA,EAAuB,KAAK,EAAA,UAAA,GAAA,EAAA,EAAA,MAAA,EAAA,gBAAA,GAAA,EAAA,EAAA,YAAA,EAAA,UAAA,GAAA,MAAA,QAAA,EAAA,MAAA,EAAA,QAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,MAAA,KAAA,aAAA,GAAA,EAAA,EAAA,SAAA,EAAA,aAAA,GAAA,EAAA,EAAA,SAAA,CAEhF,EAAmB,OAAS,CAAC,MAAK,qBAAA,2EAAA,YAAA,CAOlC,SAAA,EAAA,EAAA,kCAGA,EAAgB,OAAS,CAAC,MAAO,kBAAmB,wEAAsB,YAAA,CAO1E,SAAI,EAA8B,EAAC,CACjC,OAAO,EAAU,EAAA,EAAA,EAAA,EAAA,CAEnB,EAAkB,OAAE,CAAA,MAAA,oBAAA,0EAAA,YAAA"}
1
+ {"version":3,"file":"type-checks.mjs","names":[],"sources":[],"mappings":""}