configorama 0.9.11 → 0.9.13

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 (40) hide show
  1. package/README.md +1 -0
  2. package/cli.js +46 -8
  3. package/index.d.ts +38 -29
  4. package/package.json +1 -17
  5. package/src/main.js +23 -9
  6. package/src/parsers/index.js +3 -1
  7. package/src/parsers/markdown.js +69 -0
  8. package/src/parsers/markdown.test.js +132 -0
  9. package/src/resolvers/valueFromGit.js +27 -24
  10. package/src/resolvers/valueFromNumber.js +10 -1
  11. package/src/types.d.ts +1 -1
  12. package/src/utils/handleSignalEvents.js +1 -5
  13. package/src/utils/lodash.js +72 -18
  14. package/src/utils/parsing/cloudformationSchema.js +5 -10
  15. package/src/utils/parsing/getValueAtPath.js +111 -0
  16. package/src/utils/parsing/getValueAtPath.test.js +152 -0
  17. package/src/utils/parsing/parse.js +21 -0
  18. package/src/utils/regex/index.js +5 -0
  19. package/src/utils/ui/configWizard.js +4 -4
  20. package/src/utils/validation/warnIfNotFound.js +5 -1
  21. package/src/utils/variables/cleanVariable.js +1 -3
  22. package/types/src/main.d.ts +2 -0
  23. package/types/src/main.d.ts.map +1 -1
  24. package/types/src/parsers/markdown.d.ts +17 -0
  25. package/types/src/parsers/markdown.d.ts.map +1 -0
  26. package/types/src/resolvers/valueFromGit.d.ts.map +1 -1
  27. package/types/src/resolvers/valueFromNumber.d.ts +10 -2
  28. package/types/src/resolvers/valueFromNumber.d.ts.map +1 -1
  29. package/types/src/utils/handleSignalEvents.d.ts.map +1 -1
  30. package/types/src/utils/lodash.d.ts +50 -3
  31. package/types/src/utils/lodash.d.ts.map +1 -1
  32. package/types/src/utils/parsing/getValueAtPath.d.ts +18 -0
  33. package/types/src/utils/parsing/getValueAtPath.d.ts.map +1 -0
  34. package/types/src/utils/parsing/parse.d.ts.map +1 -1
  35. package/types/src/utils/regex/index.d.ts +2 -0
  36. package/types/src/utils/regex/index.d.ts.map +1 -1
  37. package/types/src/utils/validation/warnIfNotFound.d.ts +4 -0
  38. package/types/src/utils/validation/warnIfNotFound.d.ts.map +1 -1
  39. package/types/src/utils/variables/cleanVariable.d.ts +1 -1
  40. package/types/src/utils/variables/cleanVariable.d.ts.map +1 -1
@@ -1,4 +1,51 @@
1
- export function trim(string: any, chars: any): any;
2
- export function set(object: any, path: any, value: any): any;
3
- export { isArray, isString, isNumber, isObject, isDate, isRegExp, isFunction, isEmpty, camelCase, kebabCase, capitalize, split, map, mapValues, assign, cloneDeep };
1
+ export const isArray: (arg: any) => arg is any[];
2
+ export function isString(val: any): val is string;
3
+ export function isNumber(val: any): boolean;
4
+ export function isObject(val: any): boolean;
5
+ export function isDate(val: any): val is Date;
6
+ export function isRegExp(val: any): val is RegExp;
7
+ export function isFunction(val: any): boolean;
8
+ /**
9
+ * @param {*} val
10
+ * @returns {boolean}
11
+ */
12
+ export function isEmpty(val: any): boolean;
13
+ /**
14
+ * @param {string} string - String to trim
15
+ * @param {string} [chars] - Characters to trim (defaults to whitespace)
16
+ * @returns {string}
17
+ */
18
+ export function trim(string: string, chars?: string): string;
19
+ /**
20
+ * @param {string} str
21
+ * @returns {string}
22
+ */
23
+ export function capitalize(str: string): string;
24
+ /**
25
+ * @param {*[]} arr
26
+ * @param {Function} fn
27
+ * @returns {*[]}
28
+ */
29
+ export function map(arr: any[], fn: Function): any[];
30
+ /**
31
+ * @param {Object} obj
32
+ * @param {Function} fn
33
+ * @returns {Object}
34
+ */
35
+ export function mapValues(obj: any, fn: Function): any;
36
+ /**
37
+ * @param {Object} object - Target object
38
+ * @param {string|string[]} path - Dot-delimited path or array of keys
39
+ * @param {*} value - Value to set
40
+ * @returns {Object} The mutated object
41
+ */
42
+ export function set(object: any, path: string | string[], value: any): any;
43
+ export declare function split(str: any, sep: any): string[];
44
+ export declare let assign: {
45
+ <T extends {}, U>(target: T, source: U): T & U;
46
+ <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
47
+ <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
48
+ (target: object, ...sources: any[]): any;
49
+ };
50
+ export { camelCase, kebabCase, cloneDeep };
4
51
  //# sourceMappingURL=lodash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lodash.d.ts","sourceRoot":"","sources":["../../../src/utils/lodash.js"],"names":[],"mappings":"AAqDA,mDA4BC;AA/DD,6DA6BC"}
1
+ {"version":3,"file":"lodash.d.ts","sourceRoot":"","sources":["../../../src/utils/lodash.js"],"names":[],"mappings":"AACA,iDAA6B;AAC7B,kDAAiD;AACjD,4CAAgE;AAChE,4CAAgE;AAChE,8CAA2C;AAC3C,kDAA+C;AAC/C,8CAAqD;AAErD;;;GAGG;AACH,6BAHW,GAAC,GACC,OAAO,CAQnB;AAmFD;;;;GAIG;AACH,6BAJW,MAAM,UACN,MAAM,GACJ,MAAM,CA8BlB;AA7GD;;;GAGG;AACH,gCAHW,MAAM,GACJ,MAAM,CAMlB;AAED;;;;GAIG;AACH,yBAJW,GAAC,EAAE,iBAED,GAAC,EAAE,CAKf;AAED;;;;GAIG;AACH,uDAQC;AAED;;;;;GAKG;AACH,uCAJW,MAAM,GAAC,MAAM,EAAE,SACf,GAAC,OAiCX;AAqDQ,4DAAoC"}
@@ -0,0 +1,18 @@
1
+ export = getValueAtPath;
2
+ /**
3
+ * Get value from object/array at jq-style path
4
+ * @param {*} data - Object or array to extract from
5
+ * @param {string} path - jq-style path like '.foo.bar[0]'
6
+ * @returns {*} Value at path or undefined if not found
7
+ */
8
+ declare function getValueAtPath(data: any, path: string): any;
9
+ declare namespace getValueAtPath {
10
+ export { parsePath };
11
+ }
12
+ /**
13
+ * Parse a jq-style path string into an array of keys/indices
14
+ * @param {string} path - jq-style path like '.foo.bar[0]' or '.["key"]'
15
+ * @returns {(string|number)[]} Array of path segments
16
+ */
17
+ declare function parsePath(path: string): (string | number)[];
18
+ //# sourceMappingURL=getValueAtPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getValueAtPath.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/getValueAtPath.js"],"names":[],"mappings":";AAwEA;;;;;GAKG;AACH,sCAJW,GAAC,QACD,MAAM,GACJ,GAAC,CA+Bb;;;;AAzGD;;;;GAIG;AACH,iCAHW,MAAM,GACJ,CAAC,MAAM,GAAC,MAAM,CAAC,EAAE,CAiE7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/parse.js"],"names":[],"mappings":";;;;cAgBc,MAAM;;;;cACN,MAAM;;;;eACN,MAAM;;;;kBACN,cAAe;;;;;;eA8Gf,MAAM;;;;kBACN,cAAe;;AApH7B;;;;;;GAMG;AAEH;;;;GAIG;AACH,iFAHW,YAAY,OAqGtB;AAED;;;;GAIG;AAEH;;;;;GAKG;AACH,oCAJW,MAAM,SACN,gBAAgB,OAW1B"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/parse.js"],"names":[],"mappings":";;;;cAgBc,MAAM;;;;cACN,MAAM;;;;eACN,MAAM;;;;kBACN,cAAe;;;;;;eAmIf,MAAM;;;;kBACN,cAAe;;AAzI7B;;;;;;GAMG;AAEH;;;;GAIG;AACH,iFAHW,YAAY,OA0HtB;AAED;;;;GAIG;AAEH;;;;;GAKG;AACH,oCAJW,MAAM,SACN,gBAAgB,OAW1B"}
@@ -10,6 +10,8 @@ export namespace funcRegex {
10
10
  export const funcRegexSimple: RegExp;
11
11
  export const funcStartOfLineRegex: RegExp;
12
12
  export const subFunctionRegex: RegExp;
13
+ export const fileRefSyntax: RegExp;
14
+ export const textRefSyntax: RegExp;
13
15
  /**
14
16
  * Combine multiple regex patterns into single OR pattern
15
17
  * @param {RegExp[]} regexes - Array of regex patterns to combine
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/regex/index.js"],"names":[],"mappings":";;IA+EQ,wCAAwC;;IAGpC,mCAAkC;;AAlF9C;;GAEG;AAGH,qCAA0D;AAC1D,0CAAgE;AAChE,sCAAiE;AA8EjE;;;;GAIG;AACH,wCAHW,MAAM,EAAE,GACN,MAAM,CAKlB;AApFD;;;;;;GAMG;AACH,uCAHW,MAAM,GACJ,GAAG,CAyDf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/regex/index.js"],"names":[],"mappings":";;IA+EQ,wCAAwC;;IAGpC,mCAAkC;;AAlF9C;;GAEG;AAGH,qCAA0D;AAC1D,0CAAgE;AAChE,sCAAiE;AAwFjE,mCAA2E;AAC3E,mCAA2E;AAX3E;;;;GAIG;AACH,wCAHW,MAAM,EAAE,GACN,MAAM,CAKlB;AApFD;;;;;;GAMG;AACH,uCAHW,MAAM,GACJ,GAAG,CAyDf"}
@@ -11,5 +11,9 @@ export function warnIfNotFound(variableString: string, valueToPopulate: any, opt
11
11
  patterns?: object;
12
12
  debug?: boolean;
13
13
  }): any;
14
+ /**
15
+ * @param {*} val
16
+ * @returns {boolean}
17
+ */
14
18
  export function isValidValue(val: any): boolean;
15
19
  //# sourceMappingURL=warnIfNotFound.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"warnIfNotFound.d.ts","sourceRoot":"","sources":["../../../../src/utils/validation/warnIfNotFound.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,+CAPW,MAAM,mBACN,GAAC,YAET;IAAyB,QAAQ,GAAzB,MAAM;IACY,KAAK,GAAvB,OAAO;CACf,GAAU,GAAC,CA2Bb;AAzCD,gDAKC"}
1
+ {"version":3,"file":"warnIfNotFound.d.ts","sourceRoot":"","sources":["../../../../src/utils/validation/warnIfNotFound.js"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AACH,+CAPW,MAAM,mBACN,GAAC,YAET;IAAyB,QAAQ,GAAzB,MAAM;IACY,KAAK,GAAvB,OAAO;CACf,GAAU,GAAC,CA2Bb;AA7CD;;;GAGG;AACH,kCAHW,GAAC,GACC,OAAO,CAOnB"}
@@ -1,3 +1,3 @@
1
- declare function _exports(match: any, variableSyntax: any, simple: any, caller: any, recursive?: boolean): any;
1
+ declare function _exports(match: any, variableSyntax: any, simple: any, caller: any, recursive?: boolean): string;
2
2
  export = _exports;
3
3
  //# sourceMappingURL=cleanVariable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cleanVariable.d.ts","sourceRoot":"","sources":["../../../../src/utils/variables/cleanVariable.js"],"names":[],"mappings":"AAYiB,+GAuEhB"}
1
+ {"version":3,"file":"cleanVariable.d.ts","sourceRoot":"","sources":["../../../../src/utils/variables/cleanVariable.js"],"names":[],"mappings":"AAUiB,2GAFJ,MAAM,CAyElB"}