A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jsonquerylang/jsonquery/commit/0efaddc075bbcac0543c800d3c2e520999f1b92a below:

the type definition of `JSONQueryProperty` and `JSONQueryFunction` · jsonquerylang/jsonquery@0efaddc · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+4

-4

lines changed

Filter options

Expand file treeCollapse 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 = {

171 171 172 172

pick: (...properties: JSONQueryProperty[]) => {

173 173

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

175 175

)

176 176 177 177

const _pick = (object: Record<string, unknown>, getters: Getter[]): unknown => {

@@ -294,7 +294,7 @@ export const functions: FunctionBuildersMap = {

294 294

not: buildFunction((a: unknown) => !a),

295 295 296 296

exists: (queryGet: JSONQueryFunction) => {

297 -

const parentPath = queryGet.slice(1) as JSONPath

297 +

const parentPath = queryGet.slice(1)

298 298

const key = parentPath.pop()

299 299

const getter = functions.get(...parentPath)

300 300 Original file line number Diff line number Diff line change

@@ -1,11 +1,11 @@

1 -

export type JSONQueryFunction = [name: string, ...args: unknown[]]

1 +

export type JSONQueryFunction = [name: string, ...args: JSONQuery[]]

2 2

export type JSONQueryObject = { [key: string]: JSONQuery }

3 3

export type JSONQueryPrimitive = string | number | boolean | null

4 4

export type JSONQuery = JSONQueryFunction | JSONQueryObject | JSONQueryPrimitive

5 5 6 6

export type JSONProperty = string

7 7

export type JSONPath = JSONProperty[]

8 -

export type JSONQueryProperty = ['get', path?: string | JSONPath]

8 +

export type JSONQueryProperty = ['get', ...path: JSONPath]

9 9

export type JSONQueryPipe = ['pipe', ...JSONQuery[]]

10 10 11 11

export interface JSONQueryOptions {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4