@scx-js/scx-data 0.1.6 → 0.1.7

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.
@@ -17,20 +17,35 @@ class FieldPolicy {
17
17
  clearFieldNames() {
18
18
  }
19
19
 
20
- ignoreNullValue(ignoreNullValue) {
20
+ ignoreNull(ignoreNullValue) {
21
21
  return this;
22
22
  }
23
23
 
24
- ignoreNullValue_() {
24
+ ignoreNull_() {
25
25
  }
26
26
 
27
- fieldExpression(fieldName, expression) {
27
+ ignoreNull__(fieldName, ignoreNullValue) {
28
28
  }
29
29
 
30
- fieldExpressions() {
30
+ removeIgnoreNull(fieldName) {
31
31
  }
32
32
 
33
- clearFieldExpressions() {
33
+ ignoreNulls() {
34
+ }
35
+
36
+ clearIgnoreNulls() {
37
+ }
38
+
39
+ expression(fieldName, expression) {
40
+ }
41
+
42
+ expressions() {
43
+ }
44
+
45
+ removeExpression(fieldName) {
46
+ }
47
+
48
+ clearExpressions() {
34
49
  }
35
50
 
36
51
  }
@@ -27,12 +27,16 @@ function excluded(...fieldNames) {
27
27
  return includedAll().excluded(...fieldNames);
28
28
  }
29
29
 
30
- function ignoreNullValue(ignoreNullValue) {
31
- return includedAll().ignoreNullValue(ignoreNullValue);
30
+ function ignoreNull(ignoreNull) {
31
+ return includedAll().ignoreNull(ignoreNull);
32
32
  }
33
33
 
34
- function fieldExpression(fieldName, expression) {
35
- return includedAll().fieldExpression(fieldName, expression);
34
+ function ignoreNull__(fieldName, ignoreNull) {
35
+ return includedAll().ignoreNull__(fieldName, ignoreNull);
36
+ }
37
+
38
+ function expression(fieldName, expression) {
39
+ return includedAll().expression(fieldName, expression);
36
40
  }
37
41
 
38
42
  export {
@@ -40,6 +44,7 @@ export {
40
44
  excludedAll,
41
45
  included,
42
46
  excluded,
43
- ignoreNullValue,
44
- fieldExpression,
47
+ ignoreNull,
48
+ ignoreNull__,
49
+ expression,
45
50
  };
@@ -5,15 +5,17 @@ class FieldPolicyImpl extends FieldPolicy {
5
5
 
6
6
  #filterMode;
7
7
  #fieldNames;
8
- #fieldExpressions;
9
- #ignoreNullValue;
8
+ #expressions;
9
+ #ignoreNulls;
10
+ #ignoreNull;
10
11
 
11
12
  constructor(filterMode) {
12
13
  super();
13
14
  this.#filterMode = filterMode;
14
15
  this.#fieldNames = new Set();
15
- this.#fieldExpressions = new Map();
16
- this.#ignoreNullValue = true;
16
+ this.#expressions = new Map();
17
+ this.#ignoreNulls = new Map();
18
+ this.#ignoreNull = true;
17
19
  }
18
20
 
19
21
  included(...fieldNames) {
@@ -47,26 +49,50 @@ class FieldPolicyImpl extends FieldPolicy {
47
49
  return this;
48
50
  }
49
51
 
50
- ignoreNullValue(ignoreNullValue) {
51
- this.#ignoreNullValue = ignoreNullValue;
52
+ ignoreNull(ignoreNullValue) {
53
+ this.#ignoreNull = ignoreNullValue;
52
54
  return this;
53
55
  }
54
56
 
55
- ignoreNullValue_() {
56
- return this.#ignoreNullValue;
57
+ ignoreNull_() {
58
+ return this.#ignoreNull;
57
59
  }
58
60
 
59
- fieldExpression(fieldName, expression) {
60
- this.#fieldExpressions.set(fieldName, expression);
61
+ ignoreNull__(fieldName, ignoreNull) {
62
+ this.#ignoreNulls.set(fieldName, ignoreNull);
61
63
  return this;
62
64
  }
63
65
 
64
- fieldExpressions() {
65
- return this.#fieldExpressions;
66
+ removeIgnoreNull(fieldName) {
67
+ this.#ignoreNulls.delete(fieldName);
68
+ return this;
69
+ }
70
+
71
+ ignoreNulls() {
72
+ return this.#ignoreNulls;
73
+ }
74
+
75
+ clearIgnoreNulls() {
76
+ this.#ignoreNulls.clear();
77
+ return this;
78
+ }
79
+
80
+ expression(fieldName, expression) {
81
+ this.#expressions.set(fieldName, expression);
82
+ return this;
83
+ }
84
+
85
+ expressions() {
86
+ return this.#expressions;
87
+ }
88
+
89
+ removeExpression(fieldName) {
90
+ this.#expressions.delete(fieldName);
91
+ return this;
66
92
  }
67
93
 
68
- clearFieldExpressions() {
69
- this.#fieldExpressions.clear();
94
+ clearExpressions() {
95
+ this.#expressions.clear();
70
96
  return this;
71
97
  }
72
98
 
@@ -14,8 +14,9 @@ class FieldPolicySerializer {
14
14
  "@type": "FieldPolicy",
15
15
  "filterMode": fieldPolicy.filterMode(),
16
16
  "fieldNames": fieldPolicy.fieldNames(),
17
- "ignoreNullValue": fieldPolicy.ignoreNullValue_(),
18
- "fieldExpressions": fieldPolicy.fieldExpressions(),
17
+ "ignoreNull": fieldPolicy.ignoreNull_(),
18
+ "ignoreNulls": fieldPolicy.ignoreNulls(),
19
+ "expressions": fieldPolicy.expressions(),
19
20
  };
20
21
  }
21
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scx-js/scx-data",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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.6"
14
+ "@scx-js/scx-common": "0.1.7"
15
15
  }
16
16
  }