Skip to content

Commit f58d9f7

Browse files
committed
- Docs: Clarify current wrap behavior
1 parent dcc0706 commit f58d9f7

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Security enhancement: Use global eval instead of regular eval
66
- Refactoring: Use arrow functions, for-of, declare block scope vars
77
closer to block
8+
- Docs: Clarify current `wrap` behavior
89
- npm: Add Rollup to test scripts
910

1011
## 0.17.0 (October 19, 2018)

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ evaluate method (as the first argument) include:
9494
that the current path and value will also be available to those
9595
expressions; see the Syntax section for details.)
9696
- ***wrap*** (**default: true**) - Whether or not to wrap the results
97-
in an array. If `wrap` is set to false, and no results are found,
97+
in an array. If `wrap` is set to `false`, and no results are found,
9898
`undefined` will be returned (as opposed to an empty array when
99-
`wrap` is set to true). If `wrap` is set to false and a single result
100-
is found, that result will be the only item returned (not within
101-
an array). An array will still be returned if multiple results are
102-
found, however. To avoid ambiguities (in the case where it is necessary
103-
to distinguish between a result which is a failure and one which is an
104-
empty array), it is recommended to switch the default to `false`.
99+
`wrap` is set to true). If `wrap` is set to `false` and a single
100+
non-array result is found, that result will be the only item returned
101+
(not within an array). An array will still be returned if multiple
102+
results are found, however. To avoid ambiguities (in the case where
103+
it is necessary to distinguish between a result which is a failure
104+
and one which is an empty array), it is recommended to switch the
105+
default to `false`.
105106
- ***preventEval*** (**default: false**) - Although JavaScript evaluation
106107
expressions are allowed by default, for security reasons (if one is
107108
operating on untrusted user input, for example), one may wish to

0 commit comments

Comments
 (0)