dn-react-router-toolkit 0.7.2 → 0.7.4

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.
@@ -112,21 +112,23 @@ function apiHandler({
112
112
  ).filter(
113
113
  (key) => Object.prototype.hasOwnProperty.call(params, key)
114
114
  );
115
- const where = (0, import_drizzle_orm.and)(
116
- ...paramsForExistenceCheck.reduce((acc, key) => {
117
- const condition = existingConditions[key];
118
- if (condition) {
119
- acc.push(condition(params[key]));
120
- }
121
- return acc;
122
- }, [])
123
- );
124
- const existing = await repository.findAll({
125
- limit: 1,
126
- where
127
- });
128
- if (existing.length > 0) {
129
- throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
115
+ if (paramsForExistenceCheck.length > 0) {
116
+ const where = (0, import_drizzle_orm.and)(
117
+ ...paramsForExistenceCheck.reduce((acc, key) => {
118
+ const condition = existingConditions[key];
119
+ if (condition) {
120
+ acc.push(condition(params[key]));
121
+ }
122
+ return acc;
123
+ }, [])
124
+ );
125
+ const existing = await repository.findAll({
126
+ limit: 1,
127
+ where
128
+ });
129
+ if (existing.length > 0) {
130
+ throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
131
+ }
130
132
  }
131
133
  }
132
134
  const values = {
@@ -98,21 +98,23 @@ function apiHandler({
98
98
  ).filter(
99
99
  (key) => Object.prototype.hasOwnProperty.call(params, key)
100
100
  );
101
- const where = and(
102
- ...paramsForExistenceCheck.reduce((acc, key) => {
103
- const condition = existingConditions[key];
104
- if (condition) {
105
- acc.push(condition(params[key]));
106
- }
107
- return acc;
108
- }, [])
109
- );
110
- const existing = await repository.findAll({
111
- limit: 1,
112
- where
113
- });
114
- if (existing.length > 0) {
115
- throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
101
+ if (paramsForExistenceCheck.length > 0) {
102
+ const where = and(
103
+ ...paramsForExistenceCheck.reduce((acc, key) => {
104
+ const condition = existingConditions[key];
105
+ if (condition) {
106
+ acc.push(condition(params[key]));
107
+ }
108
+ return acc;
109
+ }, [])
110
+ );
111
+ const existing = await repository.findAll({
112
+ limit: 1,
113
+ where
114
+ });
115
+ if (existing.length > 0) {
116
+ throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
117
+ }
116
118
  }
117
119
  }
118
120
  const values = {
@@ -146,10 +146,10 @@ function StoreTextEditor({
146
146
  }
147
147
  const getResult = () => {
148
148
  if (getter) {
149
- return getter(state);
149
+ return getter(state) || "";
150
150
  }
151
151
  if (name) {
152
- return state[name];
152
+ return state[name] || "";
153
153
  }
154
154
  return "";
155
155
  };
@@ -107,10 +107,10 @@ function StoreTextEditor({
107
107
  }
108
108
  const getResult = () => {
109
109
  if (getter) {
110
- return getter(state);
110
+ return getter(state) || "";
111
111
  }
112
112
  if (name) {
113
- return state[name];
113
+ return state[name] || "";
114
114
  }
115
115
  return "";
116
116
  };
@@ -59,10 +59,10 @@ function StoreTextEditor({
59
59
  }
60
60
  const getResult = () => {
61
61
  if (getter) {
62
- return getter(state);
62
+ return getter(state) || "";
63
63
  }
64
64
  if (name) {
65
- return state[name];
65
+ return state[name] || "";
66
66
  }
67
67
  return "";
68
68
  };
@@ -27,10 +27,10 @@ function StoreTextEditor({
27
27
  }
28
28
  const getResult = () => {
29
29
  if (getter) {
30
- return getter(state);
30
+ return getter(state) || "";
31
31
  }
32
32
  if (name) {
33
- return state[name];
33
+ return state[name] || "";
34
34
  }
35
35
  return "";
36
36
  };
@@ -109,10 +109,10 @@ function StoreTextEditor({
109
109
  }
110
110
  const getResult = () => {
111
111
  if (getter) {
112
- return getter(state);
112
+ return getter(state) || "";
113
113
  }
114
114
  if (name) {
115
- return state[name];
115
+ return state[name] || "";
116
116
  }
117
117
  return "";
118
118
  };
@@ -75,10 +75,10 @@ function StoreTextEditor({
75
75
  }
76
76
  const getResult = () => {
77
77
  if (getter) {
78
- return getter(state);
78
+ return getter(state) || "";
79
79
  }
80
80
  if (name) {
81
- return state[name];
81
+ return state[name] || "";
82
82
  }
83
83
  return "";
84
84
  };
@@ -173,21 +173,23 @@ function apiHandler({
173
173
  ).filter(
174
174
  (key) => Object.prototype.hasOwnProperty.call(params, key)
175
175
  );
176
- const where = (0, import_drizzle_orm2.and)(
177
- ...paramsForExistenceCheck.reduce((acc, key) => {
178
- const condition = existingConditions[key];
179
- if (condition) {
180
- acc.push(condition(params[key]));
181
- }
182
- return acc;
183
- }, [])
184
- );
185
- const existing = await repository.findAll({
186
- limit: 1,
187
- where
188
- });
189
- if (existing.length > 0) {
190
- throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
176
+ if (paramsForExistenceCheck.length > 0) {
177
+ const where = (0, import_drizzle_orm2.and)(
178
+ ...paramsForExistenceCheck.reduce((acc, key) => {
179
+ const condition = existingConditions[key];
180
+ if (condition) {
181
+ acc.push(condition(params[key]));
182
+ }
183
+ return acc;
184
+ }, [])
185
+ );
186
+ const existing = await repository.findAll({
187
+ limit: 1,
188
+ where
189
+ });
190
+ if (existing.length > 0) {
191
+ throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
192
+ }
191
193
  }
192
194
  }
193
195
  const values = {
@@ -160,21 +160,23 @@ function apiHandler({
160
160
  ).filter(
161
161
  (key) => Object.prototype.hasOwnProperty.call(params, key)
162
162
  );
163
- const where = and2(
164
- ...paramsForExistenceCheck.reduce((acc, key) => {
165
- const condition = existingConditions[key];
166
- if (condition) {
167
- acc.push(condition(params[key]));
168
- }
169
- return acc;
170
- }, [])
171
- );
172
- const existing = await repository.findAll({
173
- limit: 1,
174
- where
175
- });
176
- if (existing.length > 0) {
177
- throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
163
+ if (paramsForExistenceCheck.length > 0) {
164
+ const where = and2(
165
+ ...paramsForExistenceCheck.reduce((acc, key) => {
166
+ const condition = existingConditions[key];
167
+ if (condition) {
168
+ acc.push(condition(params[key]));
169
+ }
170
+ return acc;
171
+ }, [])
172
+ );
173
+ const existing = await repository.findAll({
174
+ limit: 1,
175
+ where
176
+ });
177
+ if (existing.length > 0) {
178
+ throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
179
+ }
178
180
  }
179
181
  }
180
182
  const values = {
@@ -652,10 +652,10 @@ function StoreTextEditor({
652
652
  }
653
653
  const getResult = () => {
654
654
  if (getter) {
655
- return getter(state);
655
+ return getter(state) || "";
656
656
  }
657
657
  if (name) {
658
- return state[name];
658
+ return state[name] || "";
659
659
  }
660
660
  return "";
661
661
  };
@@ -626,10 +626,10 @@ function StoreTextEditor({
626
626
  }
627
627
  const getResult = () => {
628
628
  if (getter) {
629
- return getter(state);
629
+ return getter(state) || "";
630
630
  }
631
631
  if (name) {
632
- return state[name];
632
+ return state[name] || "";
633
633
  }
634
634
  return "";
635
635
  };
@@ -7851,10 +7851,10 @@ function StoreTextEditor({
7851
7851
  }
7852
7852
  const getResult = () => {
7853
7853
  if (getter) {
7854
- return getter(state);
7854
+ return getter(state) || "";
7855
7855
  }
7856
7856
  if (name) {
7857
- return state[name];
7857
+ return state[name] || "";
7858
7858
  }
7859
7859
  return "";
7860
7860
  };
@@ -8077,21 +8077,23 @@ function apiHandler({
8077
8077
  ).filter(
8078
8078
  (key) => Object.prototype.hasOwnProperty.call(params, key)
8079
8079
  );
8080
- const where = (0, import_drizzle_orm2.and)(
8081
- ...paramsForExistenceCheck.reduce((acc, key) => {
8082
- const condition = existingConditions[key];
8083
- if (condition) {
8084
- acc.push(condition(params[key]));
8085
- }
8086
- return acc;
8087
- }, [])
8088
- );
8089
- const existing = await repository.findAll({
8090
- limit: 1,
8091
- where
8092
- });
8093
- if (existing.length > 0) {
8094
- throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8080
+ if (paramsForExistenceCheck.length > 0) {
8081
+ const where = (0, import_drizzle_orm2.and)(
8082
+ ...paramsForExistenceCheck.reduce((acc, key) => {
8083
+ const condition = existingConditions[key];
8084
+ if (condition) {
8085
+ acc.push(condition(params[key]));
8086
+ }
8087
+ return acc;
8088
+ }, [])
8089
+ );
8090
+ const existing = await repository.findAll({
8091
+ limit: 1,
8092
+ where
8093
+ });
8094
+ if (existing.length > 0) {
8095
+ throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8096
+ }
8095
8097
  }
8096
8098
  }
8097
8099
  const values = {
@@ -7834,10 +7834,10 @@ function StoreTextEditor({
7834
7834
  }
7835
7835
  const getResult = () => {
7836
7836
  if (getter) {
7837
- return getter(state);
7837
+ return getter(state) || "";
7838
7838
  }
7839
7839
  if (name) {
7840
- return state[name];
7840
+ return state[name] || "";
7841
7841
  }
7842
7842
  return "";
7843
7843
  };
@@ -8073,21 +8073,23 @@ function apiHandler({
8073
8073
  ).filter(
8074
8074
  (key) => Object.prototype.hasOwnProperty.call(params, key)
8075
8075
  );
8076
- const where = and2(
8077
- ...paramsForExistenceCheck.reduce((acc, key) => {
8078
- const condition = existingConditions[key];
8079
- if (condition) {
8080
- acc.push(condition(params[key]));
8081
- }
8082
- return acc;
8083
- }, [])
8084
- );
8085
- const existing = await repository.findAll({
8086
- limit: 1,
8087
- where
8088
- });
8089
- if (existing.length > 0) {
8090
- throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8076
+ if (paramsForExistenceCheck.length > 0) {
8077
+ const where = and2(
8078
+ ...paramsForExistenceCheck.reduce((acc, key) => {
8079
+ const condition = existingConditions[key];
8080
+ if (condition) {
8081
+ acc.push(condition(params[key]));
8082
+ }
8083
+ return acc;
8084
+ }, [])
8085
+ );
8086
+ const existing = await repository.findAll({
8087
+ limit: 1,
8088
+ where
8089
+ });
8090
+ if (existing.length > 0) {
8091
+ throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8092
+ }
8091
8093
  }
8092
8094
  }
8093
8095
  const values = {
@@ -7901,10 +7901,10 @@ function StoreTextEditor({
7901
7901
  }
7902
7902
  const getResult = () => {
7903
7903
  if (getter) {
7904
- return getter(state);
7904
+ return getter(state) || "";
7905
7905
  }
7906
7906
  if (name) {
7907
- return state[name];
7907
+ return state[name] || "";
7908
7908
  }
7909
7909
  return "";
7910
7910
  };
@@ -7888,10 +7888,10 @@ function StoreTextEditor({
7888
7888
  }
7889
7889
  const getResult = () => {
7890
7890
  if (getter) {
7891
- return getter(state);
7891
+ return getter(state) || "";
7892
7892
  }
7893
7893
  if (name) {
7894
- return state[name];
7894
+ return state[name] || "";
7895
7895
  }
7896
7896
  return "";
7897
7897
  };
@@ -7835,10 +7835,10 @@ function StoreTextEditor({
7835
7835
  }
7836
7836
  const getResult = () => {
7837
7837
  if (getter) {
7838
- return getter(state);
7838
+ return getter(state) || "";
7839
7839
  }
7840
7840
  if (name) {
7841
- return state[name];
7841
+ return state[name] || "";
7842
7842
  }
7843
7843
  return "";
7844
7844
  };
@@ -7826,10 +7826,10 @@ function StoreTextEditor({
7826
7826
  }
7827
7827
  const getResult = () => {
7828
7828
  if (getter) {
7829
- return getter(state);
7829
+ return getter(state) || "";
7830
7830
  }
7831
7831
  if (name) {
7832
- return state[name];
7832
+ return state[name] || "";
7833
7833
  }
7834
7834
  return "";
7835
7835
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dn-react-router-toolkit",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.js",