@scx-js/scx-data 0.1.7 → 0.1.9
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.
@@ -1,11 +1,11 @@
|
|
1
1
|
import {FieldPolicyImpl} from "./FieldPolicyImpl.js";
|
2
2
|
import {EXCLUDED, INCLUDED} from "./FilterMode.js";
|
3
3
|
|
4
|
-
function
|
4
|
+
function includeAll() {
|
5
5
|
return new FieldPolicyImpl(EXCLUDED);
|
6
6
|
}
|
7
7
|
|
8
|
-
function
|
8
|
+
function excludeAll() {
|
9
9
|
return new FieldPolicyImpl(INCLUDED);
|
10
10
|
}
|
11
11
|
|
@@ -14,8 +14,8 @@ function excludedAll() {
|
|
14
14
|
* @param fieldNames
|
15
15
|
* @return {FieldPolicy}
|
16
16
|
*/
|
17
|
-
function
|
18
|
-
return
|
17
|
+
function include(...fieldNames) {
|
18
|
+
return excludeAll().include(...fieldNames);
|
19
19
|
}
|
20
20
|
|
21
21
|
/**
|
@@ -23,27 +23,27 @@ function included(...fieldNames) {
|
|
23
23
|
* @param fieldNames
|
24
24
|
* @return {FieldPolicy}
|
25
25
|
*/
|
26
|
-
function
|
27
|
-
return
|
26
|
+
function exclude(...fieldNames) {
|
27
|
+
return includeAll().exclude(...fieldNames);
|
28
28
|
}
|
29
29
|
|
30
30
|
function ignoreNull(ignoreNull) {
|
31
|
-
return
|
31
|
+
return includeAll().ignoreNull(ignoreNull);
|
32
32
|
}
|
33
33
|
|
34
34
|
function ignoreNull__(fieldName, ignoreNull) {
|
35
|
-
return
|
35
|
+
return includeAll().ignoreNull__(fieldName, ignoreNull);
|
36
36
|
}
|
37
37
|
|
38
38
|
function expression(fieldName, expression) {
|
39
|
-
return
|
39
|
+
return includeAll().expression(fieldName, expression);
|
40
40
|
}
|
41
41
|
|
42
42
|
export {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
includeAll,
|
44
|
+
excludeAll,
|
45
|
+
include,
|
46
|
+
exclude,
|
47
47
|
ignoreNull,
|
48
48
|
ignoreNull__,
|
49
49
|
expression,
|
@@ -18,7 +18,7 @@ class FieldPolicyImpl extends FieldPolicy {
|
|
18
18
|
this.#ignoreNull = true;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
21
|
+
include(...fieldNames) {
|
22
22
|
if (this.#filterMode === INCLUDED) {
|
23
23
|
this.addFieldNames(...fieldNames);
|
24
24
|
} else if (this.#filterMode === EXCLUDED) {
|
@@ -27,7 +27,7 @@ class FieldPolicyImpl extends FieldPolicy {
|
|
27
27
|
return this;
|
28
28
|
}
|
29
29
|
|
30
|
-
|
30
|
+
exclude(...fieldNames) {
|
31
31
|
if (this.#filterMode === EXCLUDED) {
|
32
32
|
this.addFieldNames(...fieldNames);
|
33
33
|
} else if (this.#filterMode === INCLUDED) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@scx-js/scx-data",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.9",
|
4
4
|
"description": "SCX Data",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "scx567888",
|
@@ -11,6 +11,6 @@
|
|
11
11
|
"url": "https://github.com/scx567888/scx-js.git"
|
12
12
|
},
|
13
13
|
"dependencies": {
|
14
|
-
"@scx-js/scx-common": "0.1.
|
14
|
+
"@scx-js/scx-common": "0.1.9"
|
15
15
|
}
|
16
16
|
}
|