A RetroSearch Logo

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

Search Query:

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

#24 function `uniq` not working correctly with nullish types · jsonquerylang/jsonquery@b6fd569 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+26

-8

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+26

-8

lines changed Original file line number Diff line number Diff line change

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

248 248

const res: T[] = []

249 249 250 250

for (const item of data) {

251 -

if (!res.find((resItem) => isEqual(resItem, item))) {

251 +

if (res.findIndex((resItem) => isEqual(resItem, item)) === -1) {

252 252

res.push(item)

253 253

}

254 254

}

Original file line number Diff line number Diff line change

@@ -1,6 +1,6 @@

1 1

{

2 -

"source": "https://github.com/jsonquerylang/jsonquery/blob/v5.0.0/test-suite/compile.test.json",

3 -

"version": "5.0.0",

2 +

"source": "https://github.com/jsonquerylang/jsonquery/blob/v5.0.1/test-suite/compile.test.json",

3 +

"version": "5.0.1",

4 4

"groups": [

5 5

{

6 6

"category": "value",

@@ -960,6 +960,17 @@

960 960

}

961 961

]

962 962

},

963 +

{

964 +

"category": "uniq",

965 +

"description": "should get unique values from a list with mixed nullish types",

966 +

"tests": [

967 +

{

968 +

"input": [null, null, false, 0, "", null, false, 0, ""],

969 +

"query": ["uniq"],

970 +

"output": [null, false, 0, ""]

971 +

}

972 +

]

973 +

},

963 974

{

964 975

"category": "uniqBy",

965 976

"description": "should get unique objects by key (keeping the first)",

@@ -1208,7 +1219,10 @@

1208 1219

{ "input": null, "query": ["eq", true, false], "output": false },

1209 1220

{ "input": null, "query": ["eq", false, true], "output": false },

1210 1221

{ "input": null, "query": ["eq", false, true], "output": false },

1211 -

{ "input": null, "query": ["eq", null, null], "output": true }

1222 +

{ "input": null, "query": ["eq", false, false], "output": true },

1223 +

{ "input": null, "query": ["eq", null, null], "output": true },

1224 +

{ "input": null, "query": ["eq", 0, 0], "output": true },

1225 +

{ "input": null, "query": ["eq", "", ""], "output": true }

1212 1226

]

1213 1227

},

1214 1228

{

@@ -1550,7 +1564,11 @@

1550 1564

"query": ["ne", ["get", "a"], ["get", "b"]],

1551 1565

"output": true

1552 1566

},

1553 -

{ "input": null, "query": ["ne", 3, 2], "output": true }

1567 +

{ "input": null, "query": ["ne", 3, 2], "output": true },

1568 +

{ "input": null, "query": ["ne", false, false], "output": false },

1569 +

{ "input": null, "query": ["ne", null, null], "output": false },

1570 +

{ "input": null, "query": ["ne", 0, 0], "output": false },

1571 +

{ "input": null, "query": ["ne", "", ""], "output": false }

1554 1572

]

1555 1573

},

1556 1574

{

Original file line number Diff line number Diff line change

@@ -1,13 +1,13 @@

1 1

{

2 2

"$schema": "http://json-schema.org/draft-07/schema",

3 -

"$id": "https://github.com/jsonquerylang/jsonquery/blob/v5.0.0/test-suite/compile.test.schema.json",

3 +

"$id": "https://github.com/jsonquerylang/jsonquery/blob/v5.0.1/test-suite/compile.test.schema.json",

4 4

"type": "object",

5 5

"properties": {

6 6

"source": {

7 -

"const": "https://github.com/jsonquerylang/jsonquery/blob/v5.0.0/test-suite/compile.test.json"

7 +

"const": "https://github.com/jsonquerylang/jsonquery/blob/v5.0.1/test-suite/compile.test.json"

8 8

},

9 9

"version": {

10 -

"const": "5.0.0"

10 +

"const": "5.0.1"

11 11

},

12 12

"groups": {

13 13

"type": "array",

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