Skip to content

Commit 8af682d

Browse files
ebobbyharttle
authored andcommitted
fix: sort and where bug when using strictVariables
1 parent 88aa63f commit 8af682d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/filters/array.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function * sort<T> (this: FilterImpl, arr: T[], property?: string): Itera
1414
for (const item of toArray(toValue(arr))) {
1515
values.push([
1616
item,
17-
property ? yield this.context._getFromScope(item, stringify(property).split('.')) : item
17+
property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item
1818
])
1919
}
2020
return values.sort((lhs, rhs) => {
@@ -70,7 +70,7 @@ export function * where<T extends object> (this: FilterImpl, arr: T[], property:
7070
const values: unknown[] = []
7171
arr = toArray(toValue(arr))
7272
for (const item of arr) {
73-
values.push(yield this.context._getFromScope(item, stringify(property).split('.')))
73+
values.push(yield this.context._getFromScope(item, stringify(property).split('.'), false))
7474
}
7575
return arr.filter((_, i) => {
7676
if (expected === undefined) return isTruthy(values[i], this.context)

0 commit comments

Comments
 (0)