mysql2-core 0.3.3 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2-core",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "mysql2-core",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/build.ts CHANGED
@@ -4,7 +4,7 @@ export function param(i: number): string {
4
4
  return "?"
5
5
  }
6
6
  export function params(length: number, from?: number): string[] {
7
- if (from === undefined || from == null) {
7
+ if (from == null) {
8
8
  from = 0
9
9
  }
10
10
  const ps: string[] = []
@@ -80,7 +80,7 @@ export function buildToSave<T>(obj: T, table: string, attrs: Attributes, ver?: s
80
80
  pks.push(attr)
81
81
  }
82
82
  let v = o[k]
83
- if (v === undefined || v == null) {
83
+ if (v == null) {
84
84
  v = attr.default
85
85
  }
86
86
  if (v !== undefined && v != null && !attr.ignored && !attr.noinsert) {
@@ -134,7 +134,7 @@ export function buildToSave<T>(obj: T, table: string, attrs: Attributes, ver?: s
134
134
  if (attr && !attr.key && !attr.ignored && !attr.noupdate) {
135
135
  const field = attr.column ? attr.column : k
136
136
  let x: string
137
- if (v == null) {
137
+ if (v === null) {
138
138
  x = "null"
139
139
  } else if (v === "") {
140
140
  x = `''`
@@ -183,7 +183,7 @@ export function buildToSaveBatch<T>(objs: T[], table: string, attrs: Attributes,
183
183
  for (const k of ks) {
184
184
  const attr = attrs[k]
185
185
  let v = o[k]
186
- if (v === undefined || v == null) {
186
+ if (v == null) {
187
187
  v = attr.default
188
188
  }
189
189
  if (v != null && v !== undefined && !attr.ignored && !attr.noinsert) {
@@ -229,7 +229,7 @@ export function buildToSaveBatch<T>(objs: T[], table: string, attrs: Attributes,
229
229
  if (attr && !attr.key && !attr.ignored && k !== ver && !attr.noupdate) {
230
230
  const field = attr.column ? attr.column : k
231
231
  let x: string
232
- if (v == null) {
232
+ if (v === null) {
233
233
  x = "null"
234
234
  } else if (v === "") {
235
235
  x = `''`
package/tsconfig.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "compileOnSave": true,
3
3
  "compilerOptions": {
4
- "target": "es5",
5
- "baseUrl": "./src",
4
+ "target": "es6",
5
+ "rootDir": "./src",
6
6
  "outDir": "./lib",
7
- "module": "commonjs",
8
- "moduleResolution": "node",
7
+ "module": "node16",
8
+ "moduleResolution": "node16",
9
9
  "strict": true,
10
10
  "pretty": true,
11
11
  "sourceMap": false,