content-entry-transform 1.6.0 → 1.6.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/README.md +12 -4
- package/package.json +3 -3
- package/src/expression-transformer.mjs +4 -1
package/README.md
CHANGED
|
@@ -18,12 +18,20 @@ transform content entries
|
|
|
18
18
|
|
|
19
19
|
### Table of Contents
|
|
20
20
|
|
|
21
|
-
* [
|
|
21
|
+
* [createPropertiesInterceptor](#createpropertiesinterceptor)
|
|
22
22
|
* [Parameters](#parameters)
|
|
23
|
-
* [
|
|
23
|
+
* [createExpressionTransformer](#createexpressiontransformer)
|
|
24
24
|
* [Parameters](#parameters-1)
|
|
25
|
-
* [
|
|
25
|
+
* [createPropertiesTransformer](#createpropertiestransformer)
|
|
26
26
|
* [Parameters](#parameters-2)
|
|
27
|
+
* [transform](#transform)
|
|
28
|
+
* [Parameters](#parameters-3)
|
|
29
|
+
|
|
30
|
+
## createPropertiesInterceptor
|
|
31
|
+
|
|
32
|
+
### Parameters
|
|
33
|
+
|
|
34
|
+
* `evaluate` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** 
|
|
27
35
|
|
|
28
36
|
## createExpressionTransformer
|
|
29
37
|
|
|
@@ -32,7 +40,7 @@ Transformer expanding '{{}}' expressions
|
|
|
32
40
|
### Parameters
|
|
33
41
|
|
|
34
42
|
* `match` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
35
|
-
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
43
|
+
* `properties` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function))** 
|
|
36
44
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (optional, default `"expression"`)
|
|
37
45
|
|
|
38
46
|
## createPropertiesTransformer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "content-entry-transform",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"content-entry": "^14.2.7",
|
|
31
|
-
"iterable-string-interceptor": "^3.0.
|
|
31
|
+
"iterable-string-interceptor": "^3.0.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/node": "^25.0.
|
|
34
|
+
"@types/node": "^25.0.9",
|
|
35
35
|
"ava": "^6.4.1",
|
|
36
36
|
"browser-ava": "^2.3.50",
|
|
37
37
|
"c8": "^10.1.3",
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IteratorContentEntry } from "content-entry";
|
|
2
2
|
import { iterableStringInterceptor } from "iterable-string-interceptor";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {Function} evaluate
|
|
7
|
+
*/
|
|
4
8
|
export function createPropertiesInterceptor(evaluate) {
|
|
5
9
|
return async function* transformer(
|
|
6
10
|
expression,
|
|
@@ -36,7 +40,6 @@ export function createPropertiesInterceptor(evaluate) {
|
|
|
36
40
|
} else {
|
|
37
41
|
return leadIn + e + leadOut;
|
|
38
42
|
}
|
|
39
|
-
// return "";
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
yield ev(expression, 0);
|