@bemoje/template 1.1.0 → 1.1.2

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/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@bemoje/template",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A TypeScript template engine with schema validation and pluggable rendering strategies.",
5
+ "type": "module",
6
+ "sideEffects": false,
5
7
  "keywords": [
6
8
  "template",
7
9
  "template-engine",
@@ -12,17 +14,15 @@
12
14
  "utilities",
13
15
  "typescript"
14
16
  ],
15
- "dependencies": {
16
- "@sinclair/typebox": "^0.34.48"
17
- },
18
- "type": "module",
19
- "sideEffects": false,
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
17
  "main": "./lib/index.cjs",
24
18
  "module": "./lib/index.js",
25
19
  "types": "./lib/index.d.ts",
20
+ "files": [
21
+ "./lib/index.js",
22
+ "./lib/index.d.ts",
23
+ "./lib/index.cjs",
24
+ "./lib/index.d.cts"
25
+ ],
26
26
  "exports": {
27
27
  ".": {
28
28
  "import": {
@@ -34,92 +34,72 @@
34
34
  "default": "./lib/index.cjs"
35
35
  }
36
36
  },
37
- "./Template/Template": {
37
+ "./Template": {
38
38
  "import": {
39
- "types": "./lib/Template/Template.d.ts",
40
- "default": "./lib/Template/Template.js"
39
+ "types": "./lib/index.d.ts",
40
+ "default": "./lib/index.js"
41
41
  },
42
42
  "require": {
43
- "types": "./lib/Template/Template.d.cts",
44
- "default": "./lib/Template/Template.cjs"
43
+ "types": "./lib/index.d.cts",
44
+ "default": "./lib/index.cjs"
45
45
  }
46
46
  },
47
- "./interfaces/TemplateStrategy": {
47
+ "./TemplateStrategy": {
48
48
  "import": {
49
- "types": "./lib/interfaces/TemplateStrategy.d.ts",
50
- "default": "./lib/interfaces/TemplateStrategy.js"
49
+ "types": "./lib/index.d.ts",
50
+ "default": "./lib/index.js"
51
51
  },
52
52
  "require": {
53
- "types": "./lib/interfaces/TemplateStrategy.d.cts",
54
- "default": "./lib/interfaces/TemplateStrategy.cjs"
53
+ "types": "./lib/index.d.cts",
54
+ "default": "./lib/index.cjs"
55
55
  }
56
56
  },
57
- "./strategies/JsonFileTemplateStrategy": {
57
+ "./JsonFileTemplateStrategy": {
58
58
  "import": {
59
- "types": "./lib/strategies/JsonFileTemplateStrategy.d.ts",
60
- "default": "./lib/strategies/JsonFileTemplateStrategy.js"
59
+ "types": "./lib/index.d.ts",
60
+ "default": "./lib/index.js"
61
61
  },
62
62
  "require": {
63
- "types": "./lib/strategies/JsonFileTemplateStrategy.d.cts",
64
- "default": "./lib/strategies/JsonFileTemplateStrategy.cjs"
63
+ "types": "./lib/index.d.cts",
64
+ "default": "./lib/index.cjs"
65
65
  }
66
66
  },
67
- "./strategies/StringTemplateStrategy": {
67
+ "./StringTemplateStrategy": {
68
68
  "import": {
69
- "types": "./lib/strategies/StringTemplateStrategy.d.ts",
70
- "default": "./lib/strategies/StringTemplateStrategy.js"
69
+ "types": "./lib/index.d.ts",
70
+ "default": "./lib/index.js"
71
71
  },
72
72
  "require": {
73
- "types": "./lib/strategies/StringTemplateStrategy.d.cts",
74
- "default": "./lib/strategies/StringTemplateStrategy.cjs"
73
+ "types": "./lib/index.d.cts",
74
+ "default": "./lib/index.cjs"
75
75
  }
76
76
  },
77
- "./strategies/TextFileTemplateStrategy": {
77
+ "./TextFileTemplateStrategy": {
78
78
  "import": {
79
- "types": "./lib/strategies/TextFileTemplateStrategy.d.ts",
80
- "default": "./lib/strategies/TextFileTemplateStrategy.js"
79
+ "types": "./lib/index.d.ts",
80
+ "default": "./lib/index.js"
81
81
  },
82
82
  "require": {
83
- "types": "./lib/strategies/TextFileTemplateStrategy.d.cts",
84
- "default": "./lib/strategies/TextFileTemplateStrategy.cjs"
83
+ "types": "./lib/index.d.cts",
84
+ "default": "./lib/index.cjs"
85
85
  }
86
86
  }
87
87
  },
88
- "files": [
89
- "./lib/index.js",
90
- "./lib/index.d.ts",
91
- "./lib/index.cjs",
92
- "./lib/index.d.cts",
93
- "./lib/Template/Template.js",
94
- "./lib/Template/Template.d.ts",
95
- "./lib/Template/Template.cjs",
96
- "./lib/Template/Template.d.cts",
97
- "./lib/interfaces/TemplateStrategy.js",
98
- "./lib/interfaces/TemplateStrategy.d.ts",
99
- "./lib/interfaces/TemplateStrategy.cjs",
100
- "./lib/interfaces/TemplateStrategy.d.cts",
101
- "./lib/strategies/JsonFileTemplateStrategy.js",
102
- "./lib/strategies/JsonFileTemplateStrategy.d.ts",
103
- "./lib/strategies/JsonFileTemplateStrategy.cjs",
104
- "./lib/strategies/JsonFileTemplateStrategy.d.cts",
105
- "./lib/strategies/StringTemplateStrategy.js",
106
- "./lib/strategies/StringTemplateStrategy.d.ts",
107
- "./lib/strategies/StringTemplateStrategy.cjs",
108
- "./lib/strategies/StringTemplateStrategy.d.cts",
109
- "./lib/strategies/TextFileTemplateStrategy.js",
110
- "./lib/strategies/TextFileTemplateStrategy.d.ts",
111
- "./lib/strategies/TextFileTemplateStrategy.cjs",
112
- "./lib/strategies/TextFileTemplateStrategy.d.cts"
113
- ],
114
- "repository": {
115
- "type": "git",
116
- "url": "git+https://github.com/bemoje/mono.git",
117
- "directory": "libs/template"
88
+ "dependencies": {
89
+ "@sinclair/typebox": "^0.34.48"
118
90
  },
91
+ "publishConfig": {
92
+ "access": "public"
93
+ },
94
+ "license": "MIT",
119
95
  "author": {
120
96
  "name": "Benjamin Møller Jensen",
121
97
  "email": "bemoje@bemoje.net",
122
98
  "url": "https://github.com/bemoje/"
123
99
  },
124
- "license": "MIT"
100
+ "repository": {
101
+ "type": "git",
102
+ "url": "git+https://github.com/bemoje/mono.git",
103
+ "directory": "libs/template"
104
+ }
125
105
  }
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- var typebox = require('@sinclair/typebox');
4
- var value = require('@sinclair/typebox/value');
5
- var tschema = require('@mono/tschema');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- class Template {
10
- static {
11
- __name(this, "Template");
12
- }
13
- strategy;
14
- optionsSchema;
15
- template;
16
- constructor(options) {
17
- this.strategy = options.strategy;
18
- this.optionsSchema = options.optionsSchema ?? typebox.Type.Object({});
19
- this.template = options.template;
20
- this.strategy.templateSchema.default = this.template;
21
- this.assertValidTemplate();
22
- }
23
- /**
24
- * Returns the template schema with the template set as the default value.
25
- */
26
- createSchema() {
27
- return this.strategy.templateSchema;
28
- }
29
- /**
30
- * Renders the template with the provided data, returning the result in the template schema format.
31
- *
32
- * Variables in the template using `{{variableName}}` syntax are replaced with corresponding
33
- * values from the data object. Data is validated against the options schema before rendering.
34
- *
35
- * @example
36
- * ```typescript
37
- * const result = template.render({ name: 'John', age: 30 })
38
- * ```
39
- */
40
- render(data = {}) {
41
- const stringTemplate = this.strategy.templateToString(this.template);
42
- const merged = value.Value.Cast(this.optionsSchema, data);
43
- tschema.assertValidSchema(this.optionsSchema, merged, "Invalid options");
44
- const populated = stringTemplate.replaceAll(/{{(\w+)}}/g, (_, key) => {
45
- return String(merged[key]);
46
- });
47
- return this.strategy.render(populated);
48
- }
49
- /**
50
- * Renders the template and returns the result as a string representation.
51
- * Convenience method that combines `render()` and `templateToString()`.
52
- */
53
- renderString(data = {}) {
54
- return this.strategy.templateToString(this.render(data));
55
- }
56
- /**
57
- * Validates that the template contains all variables defined in the options schema.
58
- *
59
- * @throws {Error} When a variable defined in the options schema is not found in the template
60
- */
61
- assertValidTemplate() {
62
- const string = this.strategy.templateToString(this.template);
63
- const variables = Object.keys(this.optionsSchema.properties);
64
- for (const variable of variables) {
65
- if (!string.includes(`{{${variable}}}`)) {
66
- throw new Error(`Template does not include variable: ${variable}`);
67
- }
68
- }
69
- }
70
- }
71
-
72
- exports.Template = Template;
@@ -1,67 +0,0 @@
1
- import { TSchema, TObject, Static } from '@sinclair/typebox';
2
- import { TemplateStrategy } from '../interfaces/TemplateStrategy.cjs';
3
-
4
- interface TemplateOptions<TemplateSchema extends TSchema, OptionsSchema extends TObject> {
5
- readonly strategy: TemplateStrategy<TemplateSchema>;
6
- readonly optionsSchema?: OptionsSchema;
7
- readonly template: Static<TemplateSchema>;
8
- }
9
- /**
10
- * A generic template engine that supports variable substitution using the Strategy pattern.
11
- * Validates templates and options against TypeBox schemas and renders templates with provided data.
12
- *
13
- * Supports mustache-style `{{variable}}` syntax for variable substitution.
14
- *
15
- * @example
16
- * ```typescript
17
- * const strategy = new StringTemplateStrategy()
18
- * const optionsSchema = Type.Object({
19
- * name: Type.String({ default: 'World' }),
20
- * greeting: Type.String({ default: 'Hello' })
21
- * })
22
- *
23
- * const template = new Template({
24
- * strategy,
25
- * optionsSchema,
26
- * template: "{{greeting}} {{name}}!"
27
- * })
28
- *
29
- * const result = template.render({ name: 'TypeScript' })
30
- * // Returns: "Hello TypeScript!"
31
- * ```
32
- */
33
- declare class Template<TemplateSchema extends TSchema, OptionsSchema extends TObject> {
34
- protected readonly strategy: TemplateStrategy<TemplateSchema>;
35
- protected readonly optionsSchema: OptionsSchema;
36
- protected readonly template: Static<TemplateSchema>;
37
- constructor(options: TemplateOptions<TemplateSchema, OptionsSchema>);
38
- /**
39
- * Returns the template schema with the template set as the default value.
40
- */
41
- createSchema(): TemplateSchema;
42
- /**
43
- * Renders the template with the provided data, returning the result in the template schema format.
44
- *
45
- * Variables in the template using `{{variableName}}` syntax are replaced with corresponding
46
- * values from the data object. Data is validated against the options schema before rendering.
47
- *
48
- * @example
49
- * ```typescript
50
- * const result = template.render({ name: 'John', age: 30 })
51
- * ```
52
- */
53
- render(data?: Static<OptionsSchema>): Static<TemplateSchema>;
54
- /**
55
- * Renders the template and returns the result as a string representation.
56
- * Convenience method that combines `render()` and `templateToString()`.
57
- */
58
- renderString(data?: Static<OptionsSchema>): string;
59
- /**
60
- * Validates that the template contains all variables defined in the options schema.
61
- *
62
- * @throws {Error} When a variable defined in the options schema is not found in the template
63
- */
64
- protected assertValidTemplate(): void;
65
- }
66
-
67
- export { Template, type TemplateOptions };
@@ -1,67 +0,0 @@
1
- import { TSchema, TObject, Static } from '@sinclair/typebox';
2
- import { TemplateStrategy } from '../interfaces/TemplateStrategy.js';
3
-
4
- interface TemplateOptions<TemplateSchema extends TSchema, OptionsSchema extends TObject> {
5
- readonly strategy: TemplateStrategy<TemplateSchema>;
6
- readonly optionsSchema?: OptionsSchema;
7
- readonly template: Static<TemplateSchema>;
8
- }
9
- /**
10
- * A generic template engine that supports variable substitution using the Strategy pattern.
11
- * Validates templates and options against TypeBox schemas and renders templates with provided data.
12
- *
13
- * Supports mustache-style `{{variable}}` syntax for variable substitution.
14
- *
15
- * @example
16
- * ```typescript
17
- * const strategy = new StringTemplateStrategy()
18
- * const optionsSchema = Type.Object({
19
- * name: Type.String({ default: 'World' }),
20
- * greeting: Type.String({ default: 'Hello' })
21
- * })
22
- *
23
- * const template = new Template({
24
- * strategy,
25
- * optionsSchema,
26
- * template: "{{greeting}} {{name}}!"
27
- * })
28
- *
29
- * const result = template.render({ name: 'TypeScript' })
30
- * // Returns: "Hello TypeScript!"
31
- * ```
32
- */
33
- declare class Template<TemplateSchema extends TSchema, OptionsSchema extends TObject> {
34
- protected readonly strategy: TemplateStrategy<TemplateSchema>;
35
- protected readonly optionsSchema: OptionsSchema;
36
- protected readonly template: Static<TemplateSchema>;
37
- constructor(options: TemplateOptions<TemplateSchema, OptionsSchema>);
38
- /**
39
- * Returns the template schema with the template set as the default value.
40
- */
41
- createSchema(): TemplateSchema;
42
- /**
43
- * Renders the template with the provided data, returning the result in the template schema format.
44
- *
45
- * Variables in the template using `{{variableName}}` syntax are replaced with corresponding
46
- * values from the data object. Data is validated against the options schema before rendering.
47
- *
48
- * @example
49
- * ```typescript
50
- * const result = template.render({ name: 'John', age: 30 })
51
- * ```
52
- */
53
- render(data?: Static<OptionsSchema>): Static<TemplateSchema>;
54
- /**
55
- * Renders the template and returns the result as a string representation.
56
- * Convenience method that combines `render()` and `templateToString()`.
57
- */
58
- renderString(data?: Static<OptionsSchema>): string;
59
- /**
60
- * Validates that the template contains all variables defined in the options schema.
61
- *
62
- * @throws {Error} When a variable defined in the options schema is not found in the template
63
- */
64
- protected assertValidTemplate(): void;
65
- }
66
-
67
- export { Template, type TemplateOptions };
@@ -1,69 +0,0 @@
1
- import { __name } from '../chunk-SHUYVCID.js';
2
- import { Type } from '@sinclair/typebox';
3
- import { Value } from '@sinclair/typebox/value';
4
- import { assertValidSchema } from '@mono/tschema';
5
-
6
- class Template {
7
- static {
8
- __name(this, "Template");
9
- }
10
- strategy;
11
- optionsSchema;
12
- template;
13
- constructor(options) {
14
- this.strategy = options.strategy;
15
- this.optionsSchema = options.optionsSchema ?? Type.Object({});
16
- this.template = options.template;
17
- this.strategy.templateSchema.default = this.template;
18
- this.assertValidTemplate();
19
- }
20
- /**
21
- * Returns the template schema with the template set as the default value.
22
- */
23
- createSchema() {
24
- return this.strategy.templateSchema;
25
- }
26
- /**
27
- * Renders the template with the provided data, returning the result in the template schema format.
28
- *
29
- * Variables in the template using `{{variableName}}` syntax are replaced with corresponding
30
- * values from the data object. Data is validated against the options schema before rendering.
31
- *
32
- * @example
33
- * ```typescript
34
- * const result = template.render({ name: 'John', age: 30 })
35
- * ```
36
- */
37
- render(data = {}) {
38
- const stringTemplate = this.strategy.templateToString(this.template);
39
- const merged = Value.Cast(this.optionsSchema, data);
40
- assertValidSchema(this.optionsSchema, merged, "Invalid options");
41
- const populated = stringTemplate.replaceAll(/{{(\w+)}}/g, (_, key) => {
42
- return String(merged[key]);
43
- });
44
- return this.strategy.render(populated);
45
- }
46
- /**
47
- * Renders the template and returns the result as a string representation.
48
- * Convenience method that combines `render()` and `templateToString()`.
49
- */
50
- renderString(data = {}) {
51
- return this.strategy.templateToString(this.render(data));
52
- }
53
- /**
54
- * Validates that the template contains all variables defined in the options schema.
55
- *
56
- * @throws {Error} When a variable defined in the options schema is not found in the template
57
- */
58
- assertValidTemplate() {
59
- const string = this.strategy.templateToString(this.template);
60
- const variables = Object.keys(this.optionsSchema.properties);
61
- for (const variable of variables) {
62
- if (!string.includes(`{{${variable}}}`)) {
63
- throw new Error(`Template does not include variable: ${variable}`);
64
- }
65
- }
66
- }
67
- }
68
-
69
- export { Template };
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,30 +0,0 @@
1
- import { TSchema, Static } from '@sinclair/typebox';
2
-
3
- /**
4
- * Strategy interface for template processing operations.
5
- *
6
- * @template TemplateSchema - The schema type that defines the structure of templates,
7
- * must extend TSchema.
8
- */
9
- interface TemplateStrategy<TemplateSchema extends TSchema> {
10
- /**
11
- * The schema definition for templates handled by this strategy.
12
- */
13
- readonly templateSchema: TemplateSchema;
14
- /**
15
- * Converts a template object to its string representation.
16
- *
17
- * @param template - The template object conforming to the template schema
18
- * @returns The string representation of the template
19
- */
20
- templateToString(template: Static<TemplateSchema>): string;
21
- /**
22
- * Renders a populated template string back into a structured template object.
23
- *
24
- * @param populated - The populated template string
25
- * @returns The structured template object that conforms to the template schema
26
- */
27
- render(populated: string): Static<TemplateSchema>;
28
- }
29
-
30
- export type { TemplateStrategy };
@@ -1,30 +0,0 @@
1
- import { TSchema, Static } from '@sinclair/typebox';
2
-
3
- /**
4
- * Strategy interface for template processing operations.
5
- *
6
- * @template TemplateSchema - The schema type that defines the structure of templates,
7
- * must extend TSchema.
8
- */
9
- interface TemplateStrategy<TemplateSchema extends TSchema> {
10
- /**
11
- * The schema definition for templates handled by this strategy.
12
- */
13
- readonly templateSchema: TemplateSchema;
14
- /**
15
- * Converts a template object to its string representation.
16
- *
17
- * @param template - The template object conforming to the template schema
18
- * @returns The string representation of the template
19
- */
20
- templateToString(template: Static<TemplateSchema>): string;
21
- /**
22
- * Renders a populated template string back into a structured template object.
23
- *
24
- * @param populated - The populated template string
25
- * @returns The structured template object that conforms to the template schema
26
- */
27
- render(populated: string): Static<TemplateSchema>;
28
- }
29
-
30
- export type { TemplateStrategy };
@@ -1 +0,0 @@
1
-
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- var typebox = require('@sinclair/typebox');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- class JsonFileTemplateStrategy {
8
- static {
9
- __name(this, "JsonFileTemplateStrategy");
10
- }
11
- templateSchema;
12
- /**
13
- * Creates a JSON file template strategy with optional schema validation.
14
- *
15
- * @param templateSchema - TypeBox object schema for template validation.
16
- * Defaults to empty object schema if not provided.
17
- */
18
- constructor(templateSchema) {
19
- this.templateSchema = templateSchema ?? typebox.Type.Object({});
20
- }
21
- /**
22
- * Converts a template object to pretty-printed JSON string.
23
- */
24
- templateToString(template) {
25
- return JSON.stringify(template, null, 2);
26
- }
27
- /**
28
- * Parses JSON string back to typed object conforming to schema.
29
- */
30
- render(populated) {
31
- return JSON.parse(populated);
32
- }
33
- }
34
-
35
- exports.JsonFileTemplateStrategy = JsonFileTemplateStrategy;
@@ -1,32 +0,0 @@
1
- import { TObject, Static } from '@sinclair/typebox';
2
- import { TemplateStrategy } from '../interfaces/TemplateStrategy.cjs';
3
-
4
- /**
5
- * Template strategy for handling JSON file templates with structured object schemas.
6
- *
7
- * Converts structured objects to formatted JSON strings and parses JSON strings
8
- * back to typed objects. Uses pretty-printing with 2-space indentation for
9
- * human-readable output.
10
- *
11
- * @template Schema - Object schema type extending TObject, defaults to empty object
12
- */
13
- declare class JsonFileTemplateStrategy<Schema extends TObject = TObject> implements TemplateStrategy<Schema> {
14
- readonly templateSchema: Schema;
15
- /**
16
- * Creates a JSON file template strategy with optional schema validation.
17
- *
18
- * @param templateSchema - TypeBox object schema for template validation.
19
- * Defaults to empty object schema if not provided.
20
- */
21
- constructor(templateSchema?: Schema);
22
- /**
23
- * Converts a template object to pretty-printed JSON string.
24
- */
25
- templateToString(template: Static<Schema>): string;
26
- /**
27
- * Parses JSON string back to typed object conforming to schema.
28
- */
29
- render(populated: string): Static<Schema>;
30
- }
31
-
32
- export { JsonFileTemplateStrategy };
@@ -1,32 +0,0 @@
1
- import { TObject, Static } from '@sinclair/typebox';
2
- import { TemplateStrategy } from '../interfaces/TemplateStrategy.js';
3
-
4
- /**
5
- * Template strategy for handling JSON file templates with structured object schemas.
6
- *
7
- * Converts structured objects to formatted JSON strings and parses JSON strings
8
- * back to typed objects. Uses pretty-printing with 2-space indentation for
9
- * human-readable output.
10
- *
11
- * @template Schema - Object schema type extending TObject, defaults to empty object
12
- */
13
- declare class JsonFileTemplateStrategy<Schema extends TObject = TObject> implements TemplateStrategy<Schema> {
14
- readonly templateSchema: Schema;
15
- /**
16
- * Creates a JSON file template strategy with optional schema validation.
17
- *
18
- * @param templateSchema - TypeBox object schema for template validation.
19
- * Defaults to empty object schema if not provided.
20
- */
21
- constructor(templateSchema?: Schema);
22
- /**
23
- * Converts a template object to pretty-printed JSON string.
24
- */
25
- templateToString(template: Static<Schema>): string;
26
- /**
27
- * Parses JSON string back to typed object conforming to schema.
28
- */
29
- render(populated: string): Static<Schema>;
30
- }
31
-
32
- export { JsonFileTemplateStrategy };
@@ -1,32 +0,0 @@
1
- import { __name } from '../chunk-SHUYVCID.js';
2
- import { Type } from '@sinclair/typebox';
3
-
4
- class JsonFileTemplateStrategy {
5
- static {
6
- __name(this, "JsonFileTemplateStrategy");
7
- }
8
- templateSchema;
9
- /**
10
- * Creates a JSON file template strategy with optional schema validation.
11
- *
12
- * @param templateSchema - TypeBox object schema for template validation.
13
- * Defaults to empty object schema if not provided.
14
- */
15
- constructor(templateSchema) {
16
- this.templateSchema = templateSchema ?? Type.Object({});
17
- }
18
- /**
19
- * Converts a template object to pretty-printed JSON string.
20
- */
21
- templateToString(template) {
22
- return JSON.stringify(template, null, 2);
23
- }
24
- /**
25
- * Parses JSON string back to typed object conforming to schema.
26
- */
27
- render(populated) {
28
- return JSON.parse(populated);
29
- }
30
- }
31
-
32
- export { JsonFileTemplateStrategy };
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- var typebox = require('@sinclair/typebox');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- class StringTemplateStrategy {
8
- static {
9
- __name(this, "StringTemplateStrategy");
10
- }
11
- templateSchema = typebox.Type.String();
12
- /**
13
- * Returns the template string as-is (pass-through).
14
- */
15
- templateToString(template) {
16
- return template;
17
- }
18
- /**
19
- * Returns the populated string as-is (pass-through).
20
- */
21
- render(populated) {
22
- return populated;
23
- }
24
- }
25
-
26
- exports.StringTemplateStrategy = StringTemplateStrategy;