@itrocks/template 0.1.1 → 0.1.3
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 +4 -3
- package/cjs/template.js +1 -1
- package/esm/template.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -411,9 +411,10 @@ Any expression starting with `/`, `./` or `../` is considered a template include
|
|
|
411
411
|
```
|
|
412
412
|
|
|
413
413
|
The path prefix defines how the file location is resolved:
|
|
414
|
-
- `./` refers to the directory of the current template file
|
|
415
|
-
- `../` refers to the parent directory of the current template file
|
|
416
|
-
- `/` refers to the root
|
|
414
|
+
- `./` refers to the directory of the current template file,
|
|
415
|
+
- `../` refers to the parent directory of the current template file,
|
|
416
|
+
- `/` refers to the project root (not the filesystem root),
|
|
417
|
+
- `/@scope` refers to `/node_modules/@scope`, resolved from the project root.
|
|
417
418
|
|
|
418
419
|
The default contextual data is the one in the current scope.
|
|
419
420
|
|
package/cjs/template.js
CHANGED
|
@@ -119,7 +119,7 @@ class Template {
|
|
|
119
119
|
if (text !== '') {
|
|
120
120
|
text = (parts && /^(\$[1-9][0-9]*)+$/.test(text))
|
|
121
121
|
? parts.join('')
|
|
122
|
-
: this.applyLiterals(text, parts?.map(part => ((typeof part)[0] === 's') ? this.applyLiterals(part) : part));
|
|
122
|
+
: this.applyLiterals(text, parts?.map(part => (((typeof part)[0] === 's') && (part[0] !== '<')) ? this.applyLiterals(part) : part));
|
|
123
123
|
}
|
|
124
124
|
return original.substring(0, left) + text + original.substring(right);
|
|
125
125
|
}
|
package/esm/template.js
CHANGED
|
@@ -114,7 +114,7 @@ export class Template {
|
|
|
114
114
|
if (text !== '') {
|
|
115
115
|
text = (parts && /^(\$[1-9][0-9]*)+$/.test(text))
|
|
116
116
|
? parts.join('')
|
|
117
|
-
: this.applyLiterals(text, parts?.map(part => ((typeof part)[0] === 's') ? this.applyLiterals(part) : part));
|
|
117
|
+
: this.applyLiterals(text, parts?.map(part => (((typeof part)[0] === 's') && (part[0] !== '<')) ? this.applyLiterals(part) : part));
|
|
118
118
|
}
|
|
119
119
|
return original.substring(0, left) + text + original.substring(right);
|
|
120
120
|
}
|
package/package.json
CHANGED