UNPKG

@clickup/ent-framework

Version:

A PostgreSQL graph-database-alike library with microsharding and row-level security

20 lines 674 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeID = escapeID; const isBigintStr_1 = require("../../helpers/isBigintStr"); const escapeString_1 = require("./escapeString"); /** * Escapes a value implying that it's a PG ID (which is a bigint). This should * be a preferred way of escaping when we know that the value is a bigint. */ function escapeID(v) { if (v === null || v === undefined) { return "NULL"; } const str = "" + v; if (!(0, isBigintStr_1.isBigintStr)(str)) { return "'-1'/*bad_bigint*/"; } return (0, escapeString_1.escapeString)(str); } //# sourceMappingURL=escapeID.js.map