@thi.ng/oquery 2.3.43 → 2.3.45
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/match.d.ts +7 -6
- package/match.js +1 -1
- package/package.json +7 -7
package/match.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export interface MatchMultipleOpts<T> {
|
|
|
43
43
|
*
|
|
44
44
|
* // tag union
|
|
45
45
|
* console.log(
|
|
46
|
-
* query(DB, [matchStrings("tags", ["a", "b"])])
|
|
46
|
+
* query(DB, [matchStrings("tags", ["a", "b"], { union: true })])
|
|
47
47
|
* );
|
|
48
48
|
* // here returns full DB...
|
|
49
49
|
* // since each item either has `a` and/or `b` tags
|
|
@@ -66,20 +66,21 @@ export declare const matchStrings: <T extends QueryObj = QueryObj>(key: QueryTer
|
|
|
66
66
|
* intersection or union queries with optional negation/exclusions. Matches set
|
|
67
67
|
* of given values against an item's chosen field of values and by default only
|
|
68
68
|
* succeeds if all provided `includes` can be matched (aka intersection query)
|
|
69
|
-
* and there're no values from `excludes` present.
|
|
69
|
+
* and if there're no values from `excludes` present.
|
|
70
70
|
*
|
|
71
71
|
* @remarks
|
|
72
|
-
* If the `union` option is true, only one of the provided values
|
|
73
|
-
* match. Exclusions _always_ take precedence.
|
|
72
|
+
* If the `union` option is true, only one of the provided `includes` values
|
|
73
|
+
* needs to match. Exclusions _always_ take precedence.
|
|
74
74
|
*
|
|
75
75
|
* Note: See {@link matchStrings} for a syntax sugar & examples of this
|
|
76
76
|
* function, aimed at matching `string[]` options.
|
|
77
77
|
*
|
|
78
78
|
* @param key
|
|
79
|
-
* @param
|
|
79
|
+
* @param includes
|
|
80
|
+
* @param excludes
|
|
80
81
|
* @param opts
|
|
81
82
|
*/
|
|
82
|
-
export declare const matchMultiple: <T extends QueryObj = QueryObj, V = any>(key: QueryTerm["q"][0], includes: V[], excludes
|
|
83
|
+
export declare const matchMultiple: <T extends QueryObj = QueryObj, V = any>(key: QueryTerm["q"][0], includes: V[], excludes?: V[], opts?: Partial<MatchMultipleOpts<V>>) => QueryTerm<T>;
|
|
83
84
|
/**
|
|
84
85
|
* Returns a {@link QueryTerm} to match a key's value against a regexp or string
|
|
85
86
|
* expression.
|
package/match.js
CHANGED
|
@@ -13,7 +13,7 @@ const matchStrings = (key, matches, opts) => {
|
|
|
13
13
|
};
|
|
14
14
|
const matchMultiple = (key, includes, excludes, opts = {}) => {
|
|
15
15
|
const { union = false, value: valueFn } = opts;
|
|
16
|
-
return excludes
|
|
16
|
+
return excludes?.length ? {
|
|
17
17
|
q: [
|
|
18
18
|
key,
|
|
19
19
|
(values) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/oquery",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.45",
|
|
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",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/checks": "^3.7.
|
|
44
|
-
"@thi.ng/compare": "^2.4.
|
|
45
|
-
"@thi.ng/defmulti": "^3.0.
|
|
46
|
-
"@thi.ng/equiv": "^2.1.
|
|
42
|
+
"@thi.ng/api": "^8.12.7",
|
|
43
|
+
"@thi.ng/checks": "^3.7.23",
|
|
44
|
+
"@thi.ng/compare": "^2.4.33",
|
|
45
|
+
"@thi.ng/defmulti": "^3.0.83",
|
|
46
|
+
"@thi.ng/equiv": "^2.1.97"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"esbuild": "^0.25.11",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
],
|
|
100
100
|
"year": 2020
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "88d4b13485639f44b3c5cb5e0a73e0a3490eba85\n"
|
|
103
103
|
}
|