File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ export const functions: FunctionBuildersMap = {
171171
172172 pick : ( ...properties : JSONQueryProperty [ ] ) => {
173173 const getters = properties . map (
174- ( [ _get , ...path ] ) => [ path [ path . length - 1 ] , functions . get ( ...( path as JSONPath ) ) ] as Getter
174+ ( [ _get , ...path ] ) => [ path [ path . length - 1 ] , functions . get ( ...path ) ] as Getter
175175 )
176176
177177 const _pick = ( object : Record < string , unknown > , getters : Getter [ ] ) : unknown => {
@@ -294,7 +294,7 @@ export const functions: FunctionBuildersMap = {
294294 not : buildFunction ( ( a : unknown ) => ! a ) ,
295295
296296 exists : ( queryGet : JSONQueryFunction ) => {
297- const parentPath = queryGet . slice ( 1 ) as JSONPath
297+ const parentPath = queryGet . slice ( 1 )
298298 const key = parentPath . pop ( )
299299 const getter = functions . get ( ...parentPath )
300300
Original file line number Diff line number Diff line change 1- export type JSONQueryFunction = [ name : string , ...args : unknown [ ] ]
1+ export type JSONQueryFunction = [ name : string , ...args : JSONQuery [ ] ]
22export type JSONQueryObject = { [ key : string ] : JSONQuery }
33export type JSONQueryPrimitive = string | number | boolean | null
44export type JSONQuery = JSONQueryFunction | JSONQueryObject | JSONQueryPrimitive
55
66export type JSONProperty = string
77export type JSONPath = JSONProperty [ ]
8- export type JSONQueryProperty = [ 'get' , path ?: string | JSONPath ]
8+ export type JSONQueryProperty = [ 'get' , ... path : JSONPath ]
99export type JSONQueryPipe = [ 'pipe' , ...JSONQuery [ ] ]
1010
1111export interface JSONQueryOptions {
You can’t perform that action at this time.
0 commit comments