UNPKG

@small-tech/jsdb

Version:

A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.

15 lines (12 loc) 773 B
/** Sanitises string value. Must be used anywhere sting values are stored in the database. It is important that we sanitise string input before storing it to thwart arbitrary code execution via injection attacks. So we: • Escape all backslashes (why? See https://source.small-tech.org/site.js/lib/jsdb/-/issues/9#note_15844) • Escape all backticks (why? See https://source.small-tech.org/site.js/lib/jsdb/-/issues/9#note_15848) • Escape all dollar signs (why? See https://source.small-tech.org/site.js/lib/jsdb/-/issues/9) */ export function sanitisedString(value: any): string; export function quoteKeyIfNotSafeInteger(key: any): string | number; export function needsToBeProxified(object: any): boolean; export function log(...args: any[]): void;