MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / getFunctionOption

Function getFunctionOption

lib/methods/aggregate.js:32–38  ·  view source on GitHub ↗
(options, key, required)

Source from the content-addressed store, hash-verified

30};
31
32const getFunctionOption = (options, key, required) => {
33 const value = key in options ? options[key] : null;
34 if (typeof value === 'function') return value;
35 if (value != null) throw new TypeError(`Expected the "${key}" option to be a function`);
36 if (required) throw new TypeError(`Missing required option "${key}"`);
37 return null;
38};
39
40const getLength = ({ length }) => {
41 if (Number.isInteger(length) && length >= 0) return length;

Callers 1

aggregate.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected