content-entry-transform 1.5.16 → 1.5.18

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 CHANGED
@@ -57,7 +57,7 @@ Apply transformers.
57
57
 
58
58
  * `source` **AsyncIterable\<ContentEntry>**&#x20;
59
59
  * `transformers` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<Transformer>** (optional, default `[]`)
60
- * `onlyMatching` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** filter out all none matching entries
60
+ * `onlyMatching` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** filter out all none matching entries (optional, default `false`)
61
61
 
62
62
  # install
63
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "content-entry-transform",
3
- "version": "1.5.16",
3
+ "version": "1.5.18",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "content-entry": "^14.2.7",
31
- "iterable-string-interceptor": "^3.0.4"
31
+ "iterable-string-interceptor": "^3.0.5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^25.0.8",
@@ -12,9 +12,9 @@ export function createPropertiesInterceptor(properties) {
12
12
  ) {
13
13
  function ev(e, deepth) {
14
14
  if (deepth > 9) {
15
- throw new Error(
16
- `Probably circular reference evaluating: ${expression}`
17
- );
15
+ throw new Error(`Circular reference evaluating: ${expression}`, {
16
+ cause: expression
17
+ });
18
18
  }
19
19
  let value = properties[e];
20
20
  if (value !== undefined) {
@@ -67,6 +67,10 @@ export function createExpressionTransformer(
67
67
  name,
68
68
  match,
69
69
  transform: async entry => {
70
+ if (entry.isCollection) {
71
+ return entry;
72
+ }
73
+
70
74
  const stream = await entry.stream;
71
75
  const ne = new IteratorContentEntry(
72
76
  entry.name,
package/src/transform.mjs CHANGED
@@ -10,7 +10,7 @@ import { ContentEntry } from "content-entry";
10
10
  * @param {Transformer[]} transformers
11
11
  * @param {boolean} onlyMatching filter out all none matching entries
12
12
  */
13
- export async function* transform(source, transformers = [], onlyMatching) {
13
+ export async function* transform(source, transformers = [], onlyMatching=false) {
14
14
  const usedTransformers = new Set();
15
15
 
16
16
  for await (let entry of source) {