Skip to content

Commit d8b2915

Browse files
Add a note that map function cannot use the built-in filters (#963)
For example, you can't do the equivalent of the following pseudocode: `array.map {arrItem -> trim(arrItem) }` References: - https://discord.com/channels/686053708261228577/1285652864089198672/1415974235427442770 - https://discord.com/channels/686053708261228577/1285652864089198672/1286679863939301567
1 parent 8e69eb9 commit d8b2915

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

en/Obsidian Web Clipper/Filters.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ String literals are supported and automatically wrapped in an object with a `str
301301

302302
Combine `map` with the `template` filter, e.g. `map:item => ({name: ${item.gem}, color: item.color})|template:"- ${name} is ${color}\n"`.
303303

304+
Note: Built-in filters cannot be used inside `map`. This means that, for example, trimming each value of an array cannot be done with `map`.
305+
304306
### `merge`
305307

306308
Adds new values to an array.
@@ -371,4 +373,4 @@ Removes duplicate values from arrays and objects.
371373
- For arrays of primitives: `[1,2,2,3,3]|unique` returns `[1,2,3]`.
372374
- For arrays of objects: `[{"a":1},{"b":2},{"a":1}]|unique` returns `[{"a":1},{"b":2}]`.
373375
- For objects it removes properties with duplicate values, keeping the last occurrence's key.
374-
- For strings it returns the input unchanged.
376+
- For strings it returns the input unchanged.

0 commit comments

Comments
 (0)