From 8af682d2ca68de99bafd4a7055e4912eeb318f57 Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Wed, 23 Aug 2023 14:55:56 -0700 Subject: [PATCH] fix: sort and where bug when using `strictVariables` --- src/filters/array.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filters/array.ts b/src/filters/array.ts index 9c3b8ac339..9aece587d0 100644 --- a/src/filters/array.ts +++ b/src/filters/array.ts @@ -14,7 +14,7 @@ export function * sort (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) => { @@ -70,7 +70,7 @@ export function * where (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)