UNPKG

mysql-all-in-one

Version:

A package that allows you to have a complete interaction with a MYSQL database, allowing to connect to the database, retrieve data and create queries.

24 lines (23 loc) 901 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isInsertRows = exports.isInsertRow = exports.defaultInsertOptions = void 0; const types_1 = require("../types"); exports.defaultInsertOptions = { ignore: false, returnPreparedStatement: false, }; const isInsertRow = (val) => val !== undefined && val !== null && typeof val === 'object' && !Array.isArray(val) && Object.values(val).length !== 0 && Object.values(val).every((v) => v === undefined || (0, types_1.isSqlValues)(v) || (0, types_1.isSqlExpressionPreparedStatement)(v)); exports.isInsertRow = isInsertRow; const isInsertRows = (val) => val !== undefined && val !== null && typeof val === 'object' && ((0, exports.isInsertRow)(val) || (Array.isArray(val) && val.every((v) => (0, exports.isInsertRow)(v)))); exports.isInsertRows = isInsertRows;