/**
 * SQLite client library for Node.js applications
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

function prepareParams(args, { offset = 0, excludeLastArg = false } = {}) {
  const hasOneParam = (args.length === (offset + 1 + (excludeLastArg ? 1 : 0)));
  if (hasOneParam && typeof args[offset] === 'object') {
    return args[offset];
  }
  return Array.prototype.slice.call(args, offset, args.length - (excludeLastArg ? 1 : 0));
}

export default prepareParams;

/**
 * SQLite client library for Node.js applications
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

function prepareParams(args, { offset = 0, excludeLastArg = false } = {}) {
  const hasOneParam = (args.length === (offset + 1 + (excludeLastArg ? 1 : 0)));
  if (hasOneParam) {
    return args[offset];
  }
  return Array.prototype.slice.call(args, offset, args.length - (excludeLastArg ? 1 : 0));
}

export default prepareParams;

Remove the typeof check in prepareParams()
Remove the typeof check in prepareParams()

It is unnecessary because node-sqlite3 supports passing a single
parameter directly in the arguments:
"There are three ways of passing bind parameters: directly in the
function's arguments, as an array, and as an object for named
parameters."
https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback
