Skip to content

Commit

Permalink
fix: sort and where bug when using strictVariables
Browse files Browse the repository at this point in the history
  • Loading branch information
ebobby committed Aug 23, 2023
1 parent fce9fcf commit c12d3a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/filters/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function * sort<T> (this: FilterImpl, arr: T[], property?: string): Itera
for (const item of toArray(toValue(arr))) {
values.push([
item,
property ? yield this.context._getFromScope(item, stringify(property).split('.')) : item
property ? yield this.context._getFromScope(item, stringify(property).split('.'), false) : item
])
}
return values.sort((lhs, rhs) => {
Expand Down Expand Up @@ -70,7 +70,7 @@ export function * where<T extends object> (this: FilterImpl, arr: T[], property:
const values: unknown[] = []
arr = toArray(toValue(arr))
for (const item of arr) {
values.push(yield this.context._getFromScope(item, stringify(property).split('.')))
values.push(yield this.context._getFromScope(item, stringify(property).split('.'), false))
}
return arr.filter((_, i) => {
if (expected === undefined) return isTruthy(values[i], this.context)
Expand Down

0 comments on commit c12d3a0

Please sign in to comment.