Created
January 25, 2024 21:09
-
-
Save nyteshade/c507c6647cbd643ff5fb7834aa99c058 to your computer and use it in GitHub Desktop.
Snowflake JavaScript API (Jan 25, 2024)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
AggregateError: function { | |
constructor, name, message, | |
}, | |
Array: function { | |
length, constructor, at, concat, copyWithin, fill, find, findIndex, | |
lastIndexOf, pop, push, reverse, shift, unshift, slice, sort, splice, | |
includes, indexOf, join, keys, entries, values, forEach, filter, flat, | |
flatMap, map, every, some, reduce, reduceRight, toLocaleString, toString, | |
findLast, findLastIndex, Symbol(Symbol.iterator), | |
Symbol(Symbol.unscopables), | |
}, | |
ArrayBuffer: function { | |
constructor, byteLength, slice, Symbol(Symbol.toStringTag), | |
}, | |
Atomics: object { | |
load, store, add, sub, and, or, xor, exchange, compareExchange, isLockFree, | |
wait, waitAsync, notify, Symbol(Symbol.toStringTag), | |
}, | |
BigInt: function { | |
constructor, toLocaleString, toString, valueOf, Symbol(Symbol.toStringTag), | |
}, | |
BigInt64Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
BigUint64Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Boolean: function { | |
constructor, toString, valueOf, | |
}, | |
DataView: function { | |
constructor, buffer, byteLength, byteOffset, getInt8, setInt8, getUint8, | |
setUint8, getInt16, setInt16, getUint16, setUint16, getInt32, setInt32, | |
getUint32, setUint32, getFloat32, setFloat32, getFloat64, setFloat64, | |
getBigInt64, setBigInt64, getBigUint64, setBigUint64, | |
Symbol(Symbol.toStringTag), | |
}, | |
Date: function { | |
constructor, toString, toDateString, toTimeString, toISOString, toUTCString, | |
toGMTString, getDate, setDate, getDay, getFullYear, setFullYear, getHours, | |
setHours, getMilliseconds, setMilliseconds, getMinutes, setMinutes, | |
getMonth, setMonth, getSeconds, setSeconds, getTime, setTime, | |
getTimezoneOffset, getUTCDate, setUTCDate, getUTCDay, getUTCFullYear, | |
setUTCFullYear, getUTCHours, setUTCHours, getUTCMilliseconds, | |
setUTCMilliseconds, getUTCMinutes, setUTCMinutes, getUTCMonth, setUTCMonth, | |
getUTCSeconds, setUTCSeconds, valueOf, getYear, setYear, toJSON, | |
toLocaleString, toLocaleDateString, toLocaleTimeString, | |
Symbol(Symbol.toPrimitive), | |
}, | |
Error: function { | |
constructor, name, message, toString, | |
}, | |
EvalError: function { | |
constructor, name, message, | |
}, | |
FinalizationRegistry: function { | |
constructor, register, unregister, Symbol(Symbol.toStringTag), | |
}, | |
Float32Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Float64Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Function: function { | |
length, name, arguments, caller, constructor, apply, bind, call, toString, | |
Symbol(Symbol.hasInstance), | |
}, | |
GETOWNPROPERTIES: function { | |
constructor, | |
}, | |
Infinity: Infinity, | |
Int16Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Int32Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Int8Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Intl: object { | |
getCanonicalLocales, supportedValuesOf, DateTimeFormat, NumberFormat, | |
Collator, v8BreakIterator, PluralRules, RelativeTimeFormat, ListFormat, | |
Locale, DisplayNames, Segmenter, Symbol(Symbol.toStringTag), | |
}, | |
JSON: object { | |
parse, stringify, Symbol(Symbol.toStringTag), | |
}, | |
Map: function { | |
constructor, get, set, has, delete, clear, entries, forEach, keys, size, | |
values, Symbol(Symbol.toStringTag), Symbol(Symbol.iterator), | |
}, | |
Math: object { | |
abs, acos, acosh, asin, asinh, atan, atanh, atan2, ceil, cbrt, expm1, | |
clz32, cos, cosh, exp, floor, fround, hypot, imul, log, log1p, log2, log10, | |
max, min, pow, random, round, sign, sin, sinh, sqrt, tan, tanh, trunc, E, | |
LN10, LN2, LOG10E, LOG2E, PI, SQRT1_2, SQRT2, Symbol(Symbol.toStringTag), | |
}, | |
NaN: NaN, | |
Number: function { | |
constructor, toExponential, toFixed, toPrecision, toString, valueOf, | |
toLocaleString, | |
}, | |
Object: function { | |
constructor, __defineGetter__, __defineSetter__, hasOwnProperty, | |
__lookupGetter__, __lookupSetter__, isPrototypeOf, propertyIsEnumerable, | |
toString, valueOf, __proto__, toLocaleString, | |
}, | |
Promise: function { | |
constructor, then, catch, finally, Symbol(Symbol.toStringTag), | |
}, | |
Proxy: function, | |
RangeError: function { | |
constructor, name, message, | |
}, | |
ReferenceError: function { | |
constructor, name, message, | |
}, | |
Reflect: object { | |
defineProperty, deleteProperty, apply, construct, get, | |
getOwnPropertyDescriptor, getPrototypeOf, has, isExtensible, ownKeys, | |
preventExtensions, set, setPrototypeOf, Symbol(Symbol.toStringTag), | |
}, | |
RegExp: function { | |
constructor, exec, dotAll, flags, global, hasIndices, ignoreCase, multiline, | |
source, sticky, unicode, compile, toString, test, Symbol(Symbol.match), | |
Symbol(Symbol.matchAll), Symbol(Symbol.replace), Symbol(Symbol.search), | |
Symbol(Symbol.split), | |
}, | |
Set: function { | |
constructor, has, add, delete, clear, entries, forEach, size, values, | |
keys, Symbol(Symbol.toStringTag), Symbol(Symbol.iterator), | |
}, | |
SharedArrayBuffer: function { | |
constructor, byteLength, slice, Symbol(Symbol.toStringTag), | |
}, | |
Snowflake: function { | |
constructor, throwUnredactedError, SnowflakeUserException, log, log_trace, | |
log_debug, log_info, log_warn, log_error, log_fatal, | |
}, | |
SnowflakeLogger: function { | |
constructor, | |
}, | |
String: function { | |
length, constructor, anchor, at, big, blink, bold, charAt, charCodeAt, | |
codePointAt, concat, endsWith, fontcolor, fontsize, fixed, includes, | |
indexOf, italics, lastIndexOf, link, localeCompare, match, matchAll, | |
normalize, padEnd, padStart, repeat, replace, replaceAll, search, slice, | |
small, split, strike, sub, substr, substring, sup, startsWith, toString, | |
trim, trimStart, trimLeft, trimEnd, trimRight, toLocaleLowerCase, | |
toLocaleUpperCase, toLowerCase, toUpperCase, valueOf, | |
Symbol(Symbol.iterator), | |
}, | |
Symbol: function { | |
constructor, toString, valueOf, description, Symbol(Symbol.toStringTag), | |
Symbol(Symbol.toPrimitive), | |
}, | |
SyntaxError: function { | |
constructor, name, message, | |
}, | |
TypeError: function { | |
constructor, name, message, | |
}, | |
URIError: function { | |
constructor, name, message, | |
}, | |
Uint16Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Uint32Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Uint8Array: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
Uint8ClampedArray: function { | |
constructor, BYTES_PER_ELEMENT, | |
}, | |
WeakMap: function { | |
constructor, delete, get, set, has, Symbol(Symbol.toStringTag), | |
}, | |
WeakRef: function { | |
constructor, deref, Symbol(Symbol.toStringTag), | |
}, | |
WeakSet: function { | |
constructor, delete, has, add, Symbol(Symbol.toStringTag), | |
}, | |
WebAssembly: object { | |
compile, validate, instantiate, Module, Instance, Table, Memory, Global, | |
Tag, Exception, CompileError, LinkError, RuntimeError, | |
Symbol(Symbol.toStringTag), | |
}, | |
_c_snowflake_logger: object { | |
log, get_log_levels, get_min_log_level, get_trace_level, add_span | |
}, | |
console: object { | |
debug, error, info, log, warn, dir, dirxml, table, trace, group, | |
groupCollapsed, groupEnd, clear, count, countReset, assert, profile, | |
profileEnd, time, timeLog, timeEnd, timeStamp, context, | |
Symbol(Symbol.toStringTag), | |
}, | |
decodeURI: function, | |
decodeURIComponent: function, | |
encodeURI: function, | |
encodeURIComponent: function, | |
escape: function, | |
eval: function, | |
globalThis: object { * }, | |
isFinite: function, | |
isNaN: function, | |
parseFloat: function, | |
parseInt: function, | |
snowflake: object {}, | |
snowflakeLogger: object { | |
getLogLevels, getMinLogLevel, logHelper, log, | |
}, | |
undefined: undefined, | |
unescape: function, | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop procedure GETOWNPROPERTIES(); | |
create or replace function GETOWNPROPERTIES() | |
returns string | |
language javascript | |
as | |
$$ | |
const isClass = (v) => String(v).startsWith('class'); | |
const isFunction = (v) => !isClass(v) && v instanceof Function; | |
const isObject = (v) => v && typeof v === 'object'; | |
const compute = (d, o, p) => Reflect.has(d, 'get') ? o[p] : d.value; | |
return JSON.stringify(Reflect.ownKeys(globalThis).reduce((acc, key) => { | |
const descriptor = Object.getOwnPropertyDescriptor(globalThis, key); | |
const value = compute(descriptor, globalThis, key); | |
if (isClass(value)) { | |
acc[key] = `class { ${Reflect.ownKeys(Object(value?.prototype)).map(k => String(k))} }`; | |
} | |
else if (isFunction(value)) { | |
acc[key] = `function { ${Reflect.ownKeys(Object(value?.prototype)).map(k => String(k))} }`; | |
} | |
else if (isObject(value)) { | |
acc[key] = `object { ${Reflect.ownKeys(Object(value)).map(k => String(k))} }`; | |
} | |
else { | |
acc[key] = String(value); | |
} | |
return acc; | |
}, {}), null, 2); | |
$$; | |
select getownproperties(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment