replace-all-mustaches 0.0.6 → 0.0.7
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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/nodes/replaceAllMustaches.ts +0 -1
package/dist/index.cjs
CHANGED
|
@@ -86,7 +86,7 @@ var VariableView = class _VariableView {
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
// src/nodes/replaceAllMustaches.ts
|
|
89
|
-
function replaceAllMustaches(template,
|
|
89
|
+
function replaceAllMustaches(template, { maxPasses = 20, detectCycles = true } = {}) {
|
|
90
90
|
let current = template;
|
|
91
91
|
const seen = /* @__PURE__ */ new Set();
|
|
92
92
|
let pass = 0;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
declare function hasMustacheTags(template: string): boolean;
|
|
7
7
|
declare function hasDuplicates(arr: any[]): boolean;
|
|
8
8
|
|
|
9
|
+
type MustacheIterationOptions = {
|
|
10
|
+
maxPasses?: number;
|
|
11
|
+
detectCycles?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function replaceAllMustaches(template: string, { maxPasses, detectCycles }?: MustacheIterationOptions): string;
|
|
14
|
+
|
|
9
15
|
type MustacheValue = string | string[] | Function;
|
|
10
16
|
/**
|
|
11
17
|
* A key-value pair for a variable name and its value.
|
|
@@ -30,10 +36,4 @@ declare class VariableView {
|
|
|
30
36
|
replace(variableKey: string, value: string | Function): void;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
type MustacheIterationOptions = {
|
|
34
|
-
maxPasses?: number;
|
|
35
|
-
detectCycles?: boolean;
|
|
36
|
-
};
|
|
37
|
-
declare function replaceAllMustaches(template: string, view: VariableView, { maxPasses, detectCycles }?: MustacheIterationOptions): string;
|
|
38
|
-
|
|
39
39
|
export { type MustacheValue, Variable, VariableView, hasDuplicates, hasMustacheTags, replaceAllMustaches };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
declare function hasMustacheTags(template: string): boolean;
|
|
7
7
|
declare function hasDuplicates(arr: any[]): boolean;
|
|
8
8
|
|
|
9
|
+
type MustacheIterationOptions = {
|
|
10
|
+
maxPasses?: number;
|
|
11
|
+
detectCycles?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function replaceAllMustaches(template: string, { maxPasses, detectCycles }?: MustacheIterationOptions): string;
|
|
14
|
+
|
|
9
15
|
type MustacheValue = string | string[] | Function;
|
|
10
16
|
/**
|
|
11
17
|
* A key-value pair for a variable name and its value.
|
|
@@ -30,10 +36,4 @@ declare class VariableView {
|
|
|
30
36
|
replace(variableKey: string, value: string | Function): void;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
type MustacheIterationOptions = {
|
|
34
|
-
maxPasses?: number;
|
|
35
|
-
detectCycles?: boolean;
|
|
36
|
-
};
|
|
37
|
-
declare function replaceAllMustaches(template: string, view: VariableView, { maxPasses, detectCycles }?: MustacheIterationOptions): string;
|
|
38
|
-
|
|
39
39
|
export { type MustacheValue, Variable, VariableView, hasDuplicates, hasMustacheTags, replaceAllMustaches };
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ var VariableView = class _VariableView {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
// src/nodes/replaceAllMustaches.ts
|
|
49
|
-
function replaceAllMustaches(template,
|
|
49
|
+
function replaceAllMustaches(template, { maxPasses = 20, detectCycles = true } = {}) {
|
|
50
50
|
let current = template;
|
|
51
51
|
const seen = /* @__PURE__ */ new Set();
|
|
52
52
|
let pass = 0;
|
package/package.json
CHANGED