/
opt
/
canhelp
/
node_modules
/
kysely
/
dist
/
esm
/
util
/
/opt/canhelp/node_modules/kysely/dist/esm/util
mkdir
upload
Name
Size
Mode
Actions
assert.d.ts
173
0644
edit
dl
rm
assert.js
353
0644
edit
dl
rm
column-type.d.ts
6973
0644
edit
dl
rm
column-type.js
56
0644
edit
dl
rm
compilable.d.ts
227
0644
edit
dl
rm
compilable.js
199
0644
edit
dl
rm
deferred.d.ts
187
0644
edit
dl
rm
deferred.js
547
0644
edit
dl
rm
explainable.d.ts
1185
0644
edit
dl
rm
explainable.js
56
0644
edit
dl
rm
infer-result.d.ts
1670
0644
edit
dl
rm
infer-result.js
57
0644
edit
dl
rm
json-object-args.d.ts
246
0644
edit
dl
rm
json-object-args.js
1442
0644
edit
dl
rm
log-once.d.ts
183
0644
edit
dl
rm
log-once.js
363
0644
edit
dl
rm
log.d.ts
1070
0644
edit
dl
rm
log.js
1695
0644
edit
dl
rm
object-utils.d.ts
1494
0644
edit
dl
rm
object-utils.js
3642
0644
edit
dl
rm
performance-now.d.ts
50
0644
edit
dl
rm
performance-now.js
295
0644
edit
dl
rm
provide-controlled-connection.d.ts
397
0644
edit
dl
rm
provide-controlled-connection.js
1028
0644
edit
dl
rm
query-id.d.ts
109
0644
edit
dl
rm
query-id.js
349
0644
edit
dl
rm
random-string.d.ts
62
0644
edit
dl
rm
random-string.js
857
0644
edit
dl
rm
require-all-props.d.ts
1755
0644
edit
dl
rm
require-all-props.js
1592
0644
edit
dl
rm
stack-trace-utils.d.ts
84
0644
edit
dl
rm
stack-trace-utils.js
516
0644
edit
dl
rm
streamable.d.ts
880
0644
edit
dl
rm
streamable.js
55
0644
edit
dl
rm
type-error.d.ts
92
0644
edit
dl
rm
type-error.js
55
0644
edit
dl
rm
type-utils.d.ts
6095
0644
edit
dl
rm
type-utils.js
55
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/kysely/dist/esm/util/object-utils.js
(3642B)
/// <reference types="./object-utils.d.ts" /> export function isEmpty(obj) { if (Array.isArray(obj) || isString(obj) || isBuffer(obj)) { return obj.length === 0; } else if (obj) { return Object.keys(obj).length === 0; } return false; } export function isUndefined(obj) { return typeof obj === 'undefined' || obj === undefined; } export function isString(obj) { return typeof obj === 'string'; } export function isNumber(obj) { return typeof obj === 'number'; } export function isBoolean(obj) { return typeof obj === 'boolean'; } export function isNull(obj) { return obj === null; } export function isDate(obj) { return obj instanceof Date; } export function isBigInt(obj) { return typeof obj === 'bigint'; } // Don't change the returnd type to `obj is Buffer` to not create a // hard dependency to node. export function isBuffer(obj) { return typeof Buffer !== 'undefined' && Buffer.isBuffer(obj); } export function isFunction(obj) { return typeof obj === 'function'; } export function isObject(obj) { return typeof obj === 'object' && obj !== null; } export function isArrayBufferOrView(obj) { return obj instanceof ArrayBuffer || ArrayBuffer.isView(obj); } export function isPlainObject(obj) { if (!isObject(obj) || getTag(obj) !== '[object Object]') { return false; } if (Object.getPrototypeOf(obj) === null) { return true; } let proto = obj; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } return Object.getPrototypeOf(obj) === proto; } export function getLast(arr) { return arr[arr.length - 1]; } export function freeze(obj) { return Object.freeze(obj); } export function asArray(arg) { if (isReadonlyArray(arg)) { return arg; } else { return [arg]; } } export function asReadonlyArray(arg) { if (isReadonlyArray(arg)) { return arg; } else { return freeze([arg]); } } export function isReadonlyArray(arg) { return Array.isArray(arg); } export function noop(obj) { return obj; } export function compare(obj1, obj2) { if (isReadonlyArray(obj1) && isReadonlyArray(obj2)) { return compareArrays(obj1, obj2); } else if (isObject(obj1) && isObject(obj2)) { return compareObjects(obj1, obj2); } return obj1 === obj2; } function compareArrays(arr1, arr2) { if (arr1.length !== arr2.length) { return false; } for (let i = 0; i < arr1.length; ++i) { if (!compare(arr1[i], arr2[i])) { return false; } } return true; } function compareObjects(obj1, obj2) { if (isBuffer(obj1) && isBuffer(obj2)) { return compareBuffers(obj1, obj2); } else if (isDate(obj1) && isDate(obj2)) { return compareDates(obj1, obj2); } return compareGenericObjects(obj1, obj2); } function compareBuffers(buf1, buf2) { return Buffer.compare(buf1, buf2) === 0; } function compareDates(date1, date2) { return date1.getTime() === date2.getTime(); } function compareGenericObjects(obj1, obj2) { const keys1 = Object.keys(obj1); const keys2 = Object.keys(obj2); if (keys1.length !== keys2.length) { return false; } for (const key of keys1) { if (!compare(obj1[key], obj2[key])) { return false; } } return true; } const toString = Object.prototype.toString; function getTag(value) { if (value == null) { return value === undefined ? '[object Undefined]' : '[object Null]'; } return toString.call(value); }
Save
cmd:
run