@goldstack/utils-template 0.4.35 → 0.4.36

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.
@@ -1,5 +1,17 @@
1
1
  import type { GoldstackTemplateConfiguration } from './generated/goldstackTemplateConfigurationSchema';
2
2
  export type { GoldstackTemplateConfiguration } from './generated/goldstackTemplateConfigurationSchema';
3
+ /**
4
+ * Reads and parses a template configuration from a string.
5
+ *
6
+ * @param data - The JSON string containing the template configuration.
7
+ * @returns {GoldstackTemplateConfiguration} The parsed GoldstackTemplateConfiguration object.
8
+ */
3
9
  export declare const readTemplateConfigFromString: (data: string) => GoldstackTemplateConfiguration;
10
+ /**
11
+ * Reads and parses a template configuration from a file.
12
+ *
13
+ * @param path - The path to the template.json file. Defaults to 'template.json'.
14
+ * @returns {GoldstackTemplateConfiguration} The parsed GoldstackTemplateConfiguration object.
15
+ */
4
16
  export declare const readTemplateConfigFromFile: (path?: string) => GoldstackTemplateConfiguration;
5
17
  //# sourceMappingURL=utilsTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utilsTemplate.d.ts","sourceRoot":"","sources":["../../src/utilsTemplate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAGvG,YAAY,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAEvG,eAAO,MAAM,4BAA4B,GAAI,MAAM,MAAM,KAAG,8BAK3D,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,aAAsB,KACrB,8BAOF,CAAC"}
1
+ {"version":3,"file":"utilsTemplate.d.ts","sourceRoot":"","sources":["../../src/utilsTemplate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAGvG,YAAY,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAEvG;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GAAI,MAAM,MAAM,KAAG,8BAK3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,aAAsB,KACrB,8BAOF,CAAC"}
@@ -7,6 +7,12 @@ exports.readTemplateConfigFromFile = exports.readTemplateConfigFromString = void
7
7
  const utils_config_1 = require("@goldstack/utils-config");
8
8
  const utils_sh_1 = require("@goldstack/utils-sh");
9
9
  const goldstackTemplateConfigurationSchema_json_1 = __importDefault(require("./schemas/goldstackTemplateConfigurationSchema.json"));
10
+ /**
11
+ * Reads and parses a template configuration from a string.
12
+ *
13
+ * @param data - The JSON string containing the template configuration.
14
+ * @returns {GoldstackTemplateConfiguration} The parsed GoldstackTemplateConfiguration object.
15
+ */
10
16
  const readTemplateConfigFromString = (data) => {
11
17
  const config = (0, utils_config_1.parseConfig)(data, goldstackTemplateConfigurationSchema_json_1.default, {
12
18
  errorMessage: 'Cannot load template config.',
@@ -14,6 +20,12 @@ const readTemplateConfigFromString = (data) => {
14
20
  return config;
15
21
  };
16
22
  exports.readTemplateConfigFromString = readTemplateConfigFromString;
23
+ /**
24
+ * Reads and parses a template configuration from a file.
25
+ *
26
+ * @param path - The path to the template.json file. Defaults to 'template.json'.
27
+ * @returns {GoldstackTemplateConfiguration} The parsed GoldstackTemplateConfiguration object.
28
+ */
17
29
  const readTemplateConfigFromFile = (path = 'template.json') => {
18
30
  try {
19
31
  const data = (0, utils_sh_1.read)(path);
@@ -1 +1 @@
1
- {"version":3,"file":"utilsTemplate.js","sourceRoot":"","sources":["../../src/utilsTemplate.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAsD;AACtD,kDAA2C;AAE3C,oIAA+E;AAIxE,MAAM,4BAA4B,GAAG,CAAC,IAAY,EAAkC,EAAE;IAC3F,MAAM,MAAM,GAAG,IAAA,0BAAW,EAAC,IAAI,EAAE,mDAAY,EAAE;QAC7C,YAAY,EAAE,8BAA8B;KAC7C,CAAmC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AALW,QAAA,4BAA4B,gCAKvC;AAEK,MAAM,0BAA0B,GAAG,CACxC,IAAI,GAAG,eAAe,EACU,EAAE;IAClC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAA,eAAI,EAAC,IAAI,CAAC,CAAC;QACxB,OAAO,IAAA,oCAA4B,EAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC"}
1
+ {"version":3,"file":"utilsTemplate.js","sourceRoot":"","sources":["../../src/utilsTemplate.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAsD;AACtD,kDAA2C;AAE3C,oIAA+E;AAI/E;;;;;GAKG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAY,EAAkC,EAAE;IAC3F,MAAM,MAAM,GAAG,IAAA,0BAAW,EAAC,IAAI,EAAE,mDAAY,EAAE;QAC7C,YAAY,EAAE,8BAA8B;KAC7C,CAAmC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AALW,QAAA,4BAA4B,gCAKvC;AAEF;;;;;GAKG;AACI,MAAM,0BAA0B,GAAG,CACxC,IAAI,GAAG,eAAe,EACU,EAAE;IAClC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAA,eAAI,EAAC,IAAI,CAAC,CAAC;QACxB,OAAO,IAAA,oCAA4B,EAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldstack/utils-template",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "Utilities to work with Goldstack templates",
5
5
  "keywords": [
6
6
  "goldstack",