@thi.ng/oquery 2.2.25 → 2.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +1 -1
- package/api.d.ts +4 -0
- package/match.d.ts +5 -1
- package/match.js +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-02-
|
|
3
|
+
- **Last updated**: 2024-02-25T14:07:53Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [2.2.26](https://github.com/thi-ng/umbrella/tree/@thi.ng/oquery@2.2.26) (2024-02-22)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update object destructuring in all pkgs & examples ([f36aeb0](https://github.com/thi-ng/umbrella/commit/f36aeb0))
|
|
17
|
+
|
|
12
18
|
### [2.2.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/oquery@2.2.5) (2023-11-09)
|
|
13
19
|
|
|
14
20
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
package/api.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export interface QueryOpts {
|
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
75
|
* ```ts
|
|
76
|
+
* import { defQuery } from "@thi.ng/oquery";
|
|
77
|
+
*
|
|
76
78
|
* const DB = { a: { id: 1, name: "alice" }, b: { name: "bob" } };
|
|
77
79
|
*
|
|
78
80
|
* defQuery({ partial: false })(DB, null, "id", 1)
|
|
@@ -96,6 +98,8 @@ export interface QueryOpts {
|
|
|
96
98
|
*
|
|
97
99
|
* @example
|
|
98
100
|
* ```ts
|
|
101
|
+
* import { defQuery } from "@thi.ng/oquery";
|
|
102
|
+
*
|
|
99
103
|
* const DB = { a: { knows: ["b","c"] }, b: { knows: ["a","c"] }};
|
|
100
104
|
* defQuery({ cwise: true })(DB, null, "knows", "b")
|
|
101
105
|
* // { a: { knows: ["b","c"] } }
|
package/match.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ export declare const matchStrings: <T extends QueryObj = QueryObj>(key: QueryTer
|
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```ts
|
|
50
|
+
* import { query, matchStrings } from "@thi.ng/oquery";
|
|
51
|
+
*
|
|
50
52
|
* const DB = [
|
|
51
53
|
* { id: 1, tags: ["a", "b"] },
|
|
52
54
|
* { id: 2, tags: ["c", "b"] },
|
|
@@ -71,7 +73,7 @@ export declare const matchStrings: <T extends QueryObj = QueryObj>(key: QueryTer
|
|
|
71
73
|
* @param matches
|
|
72
74
|
* @param opts
|
|
73
75
|
*/
|
|
74
|
-
export declare const matchMultiple: <T extends QueryObj = QueryObj, V = any>(key: QueryTerm["q"][0], includes: V[], excludes: V[], opts?: Partial<MatchMultipleOpts<V>>
|
|
76
|
+
export declare const matchMultiple: <T extends QueryObj = QueryObj, V = any>(key: QueryTerm["q"][0], includes: V[], excludes: V[], opts?: Partial<MatchMultipleOpts<V>>) => QueryTerm<T>;
|
|
75
77
|
/**
|
|
76
78
|
* Returns a {@link QueryTerm} to match a key's value against a regexp or string
|
|
77
79
|
* expression.
|
|
@@ -88,6 +90,8 @@ export declare const matchMultiple: <T extends QueryObj = QueryObj, V = any>(key
|
|
|
88
90
|
*
|
|
89
91
|
* @example
|
|
90
92
|
* ```ts
|
|
93
|
+
* import { query, matchPattern } from "@thi.ng/oquery";
|
|
94
|
+
*
|
|
91
95
|
* const DB = [
|
|
92
96
|
* { id: "aaa", score: 32 },
|
|
93
97
|
* { id: "bbbb", score: 60 },
|
package/match.js
CHANGED
|
@@ -11,8 +11,8 @@ const matchStrings = (key, matches, opts) => {
|
|
|
11
11
|
);
|
|
12
12
|
return matchMultiple(key, includes, excludes, opts);
|
|
13
13
|
};
|
|
14
|
-
const matchMultiple = (key, includes, excludes, opts) => {
|
|
15
|
-
const { union, value: valueFn } =
|
|
14
|
+
const matchMultiple = (key, includes, excludes, opts = {}) => {
|
|
15
|
+
const { union = false, value: valueFn } = opts;
|
|
16
16
|
return excludes.length ? {
|
|
17
17
|
q: [
|
|
18
18
|
key,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/oquery",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.27",
|
|
4
4
|
"description": "Datalog-inspired, optimized pattern/predicate query engine for JS objects & arrays of objects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
38
|
+
"@thi.ng/api": "^8.9.26",
|
|
39
39
|
"@thi.ng/checks": "^3.5.0",
|
|
40
|
-
"@thi.ng/compare": "^2.2.
|
|
41
|
-
"@thi.ng/defmulti": "^3.0.
|
|
40
|
+
"@thi.ng/compare": "^2.2.22",
|
|
41
|
+
"@thi.ng/defmulti": "^3.0.26",
|
|
42
42
|
"@thi.ng/equiv": "^2.1.49"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
],
|
|
96
96
|
"year": 2020
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
|
|
99
99
|
}
|