@itrocks/template 0.0.29 → 0.0.31
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/README.md +2 -2
- package/cjs/template.d.ts +2 -2
- package/cjs/template.js +0 -1
- package/esm/template.d.ts +2 -2
- package/esm/template.js +1 -2
- package/package.json +4 -2
package/README.md
CHANGED
@@ -17,7 +17,7 @@ npm i @itrocks/template
|
|
17
17
|
## Basic Usage
|
18
18
|
|
19
19
|
```ts
|
20
|
-
import '@itrocks/template'
|
20
|
+
import { Template } from '@itrocks/template'
|
21
21
|
|
22
22
|
new Template({
|
23
23
|
users: [
|
@@ -437,7 +437,7 @@ are supported.
|
|
437
437
|
|
438
438
|
Example of a custom template class that applies translations:
|
439
439
|
```ts
|
440
|
-
import Template from '@itrocks/template'
|
440
|
+
import { Template } from '@itrocks/template'
|
441
441
|
|
442
442
|
const TRANSLATIONS: Record<string, string> = {
|
443
443
|
'What is my name': 'Quel est mon nom',
|
package/cjs/template.d.ts
CHANGED
@@ -9,8 +9,7 @@ type BlockStackEntry = {
|
|
9
9
|
};
|
10
10
|
export type VariableParser = [parser: string, (variable: string, data: any) => any];
|
11
11
|
export declare const frontScripts: SortedArray<string>;
|
12
|
-
export
|
13
|
-
export default class Template {
|
12
|
+
export declare class Template {
|
14
13
|
data?: any;
|
15
14
|
containerData?: any;
|
16
15
|
blockBack: number;
|
@@ -105,3 +104,4 @@ export default class Template {
|
|
105
104
|
startsExpression(char: string, open?: string, close?: string): boolean;
|
106
105
|
trimEndLine(string: string): string;
|
107
106
|
}
|
107
|
+
export {};
|
package/cjs/template.js
CHANGED
package/esm/template.d.ts
CHANGED
@@ -9,8 +9,7 @@ type BlockStackEntry = {
|
|
9
9
|
};
|
10
10
|
export type VariableParser = [parser: string, (variable: string, data: any) => any];
|
11
11
|
export declare const frontScripts: SortedArray<string>;
|
12
|
-
export
|
13
|
-
export default class Template {
|
12
|
+
export declare class Template {
|
14
13
|
data?: any;
|
15
14
|
containerData?: any;
|
16
15
|
blockBack: number;
|
@@ -105,3 +104,4 @@ export default class Template {
|
|
105
104
|
startsExpression(char: string, open?: string, close?: string): boolean;
|
106
105
|
trimEndLine(string: string): string;
|
107
106
|
}
|
107
|
+
export {};
|
package/esm/template.js
CHANGED
@@ -5,8 +5,7 @@ import { readFile } from 'node:fs/promises';
|
|
5
5
|
import { normalize, sep } from 'node:path';
|
6
6
|
export const frontScripts = new SortedArray();
|
7
7
|
frontScripts.distinct = true;
|
8
|
-
export
|
9
|
-
export default class Template {
|
8
|
+
export class Template {
|
10
9
|
data;
|
11
10
|
containerData;
|
12
11
|
// block stack
|
package/package.json
CHANGED
@@ -33,7 +33,9 @@
|
|
33
33
|
"jest": {
|
34
34
|
"preset": "ts-jest",
|
35
35
|
"testEnvironment": "node",
|
36
|
-
"testMatch": [
|
36
|
+
"testMatch": [
|
37
|
+
"**/?(*.)+(spec|test).ts"
|
38
|
+
]
|
37
39
|
},
|
38
40
|
"keywords": [
|
39
41
|
"backend",
|
@@ -67,5 +69,5 @@
|
|
67
69
|
"test": "jest"
|
68
70
|
},
|
69
71
|
"types": "./esm/template.d.ts",
|
70
|
-
"version": "0.0.
|
72
|
+
"version": "0.0.31"
|
71
73
|
}
|