@datastax/astra-db-ts
Version:
Data API TypeScript client
43 lines (42 loc) • 1.1 kB
JavaScript
;
// Copyright Datastax, Inc
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.NEVERMIND = exports.REPLACE = exports.RECURSE = exports.DONE = exports.SerDesTarget = void 0;
exports.ctxDone = ctxDone;
exports.ctxRecurse = ctxRecurse;
exports.ctxNevermind = ctxNevermind;
exports.ctxReplace = ctxReplace;
exports.SerDesTarget = {
Sort: 1 << 0,
Record: 1 << 1,
Filter: 1 << 2,
Update: 1 << 3,
Projection: 1 << 4,
InsertedId: 1 << 5,
};
exports.DONE = 0;
exports.RECURSE = 1;
exports.REPLACE = 2;
exports.NEVERMIND = 3;
const DONE_ARR = [exports.DONE];
const RECURSE_ARR = [exports.RECURSE];
const NEVERMIND_ARR = [exports.NEVERMIND];
function ctxDone(obj) {
if (arguments.length === 1) {
return [exports.DONE, obj];
}
return DONE_ARR;
}
function ctxRecurse(obj) {
if (arguments.length === 1) {
return [exports.RECURSE, obj];
}
return RECURSE_ARR;
}
function ctxNevermind() {
return NEVERMIND_ARR;
}
function ctxReplace(obj) {
return [exports.REPLACE, obj];
}