@apisr/drizzle-model 2.0.4 → 2.0.5

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 CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change log
2
2
 
3
+ ## 2.0.5 | 03-03-2026
4
+ - bypass undefined values in `esc()`
5
+
3
6
  ## 2.0.4 | 02-03-2026
4
7
  - Fix custom methods execution error
5
8
  - Add custom methods tests
@@ -1,10 +1,14 @@
1
1
  //#region src/model/query/operations.ts
2
2
  function esc(arg1, arg2) {
3
- if (typeof arg1 === "function") return {
4
- __kind: "esc-op",
5
- op: arg1,
6
- value: arg2
7
- };
3
+ if (typeof arg1 === "function") {
4
+ if (arg2 === void 0) return;
5
+ return {
6
+ __kind: "esc-op",
7
+ op: arg1,
8
+ value: arg2
9
+ };
10
+ }
11
+ if (arg1 === void 0) return;
8
12
  return { equal: arg1 };
9
13
  }
10
14
  esc.eq = (value) => ({ eq: value });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apisr/drizzle-model",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "lint": "eslint . --max-warnings 0",
@@ -169,6 +169,10 @@ export function esc<T>(
169
169
 
170
170
  export function esc<T>(arg1: any, arg2?: any): EscapedValue<T> {
171
171
  if (typeof arg1 === "function") {
172
+ if (arg2 === undefined) {
173
+ return undefined;
174
+ }
175
+
172
176
  return {
173
177
  __kind: "esc-op",
174
178
  op: arg1 as (column: any, value: T) => any,
@@ -176,6 +180,10 @@ export function esc<T>(arg1: any, arg2?: any): EscapedValue<T> {
176
180
  };
177
181
  }
178
182
 
183
+ if (arg1 === undefined) {
184
+ return undefined;
185
+ }
186
+
179
187
  return {
180
188
  equal: arg1,
181
189
  };