@storm-software/config-tools 1.190.21 → 1.190.23

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/config-file/get-config-file.cjs +9 -9
  3. package/dist/config-file/get-config-file.js +8 -8
  4. package/dist/config-file/index.cjs +9 -9
  5. package/dist/config-file/index.js +8 -8
  6. package/dist/create-storm-config.cjs +12 -12
  7. package/dist/create-storm-config.js +11 -11
  8. package/dist/get-config.cjs +13 -13
  9. package/dist/get-config.js +12 -12
  10. package/dist/index.cjs +23 -23
  11. package/dist/index.js +25 -25
  12. package/dist/logger/console.cjs +4 -4
  13. package/dist/logger/console.js +3 -3
  14. package/dist/logger/create-logger.cjs +5 -5
  15. package/dist/logger/create-logger.js +4 -4
  16. package/dist/logger/index.cjs +8 -8
  17. package/dist/logger/index.js +10 -10
  18. package/dist/utilities/index.cjs +8 -8
  19. package/dist/utilities/index.js +7 -7
  20. package/dist/utilities/process-handler.cjs +5 -5
  21. package/dist/utilities/process-handler.js +4 -4
  22. package/dist/utilities/toml.cjs +6 -6
  23. package/dist/utilities/toml.js +5 -5
  24. package/package.json +3 -3
  25. package/dist/chunk-5OYYSFK5.cjs +0 -40
  26. package/dist/chunk-7YIRETM2.cjs +0 -165
  27. package/dist/chunk-BUB7FBXA.js +0 -55
  28. package/dist/chunk-CBM6ZRFO.js +0 -35
  29. package/dist/chunk-DPHVF4QR.cjs +0 -35
  30. package/dist/chunk-DW5363CG.js +0 -165
  31. package/dist/chunk-FOAMXVC2.cjs +0 -47
  32. package/dist/chunk-JLLNUKG7.cjs +0 -55
  33. package/dist/chunk-KKF5NXBI.js +0 -40
  34. package/dist/chunk-NT26TB4H.js +0 -92
  35. package/dist/chunk-O76J367J.js +0 -947
  36. package/dist/chunk-SN6BVPYU.cjs +0 -92
  37. package/dist/chunk-T35FQNUH.cjs +0 -947
  38. package/dist/chunk-TAD4S6KA.js +0 -47
@@ -1,47 +0,0 @@
1
- import {
2
- writeError
3
- } from "./chunk-O76J367J.js";
4
-
5
- // src/utilities/toml.ts
6
- import TOML from "@ltd/j-toml";
7
- function parseCargoTomlWithTree(tree, projectRoot, projectName) {
8
- const cargoTomlString = tree.read(`${projectRoot}/Cargo.toml`)?.toString();
9
- if (!cargoTomlString) {
10
- writeError(`Cannot find a Cargo.toml file in the ${projectName}`);
11
- throw new Error();
12
- }
13
- return parseCargoToml(cargoTomlString);
14
- }
15
- function parseCargoToml(cargoString) {
16
- if (!cargoString) {
17
- throw new Error("Cargo.toml is empty");
18
- }
19
- return TOML.parse(cargoString, {
20
- x: { comment: true }
21
- });
22
- }
23
- function stringifyCargoToml(cargoToml) {
24
- const tomlString = TOML.stringify(cargoToml, {
25
- newlineAround: "section"
26
- });
27
- if (Array.isArray(tomlString)) {
28
- return tomlString.join("\n");
29
- }
30
- return tomlString;
31
- }
32
- function modifyCargoTable(toml, section, key, value) {
33
- toml[section] ??= TOML.Section({});
34
- toml[section][key] = typeof value === "object" && !Array.isArray(value) ? TOML.inline(value) : typeof value === "function" ? value() : value;
35
- }
36
- function modifyCargoNestedTable(toml, section, key, value) {
37
- toml[section] ??= {};
38
- toml[section][key] = TOML.Section(value);
39
- }
40
-
41
- export {
42
- parseCargoTomlWithTree,
43
- parseCargoToml,
44
- stringifyCargoToml,
45
- modifyCargoTable,
46
- modifyCargoNestedTable
47
- };