UNPKG

refql

Version:

A Node.js and Deno library for composing and running SQL queries.

19 lines (18 loc) 578 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const consts_1 = require("../common/consts"); const SQLNode_1 = require("./SQLNode"); const type = "refql/Value"; const prototype = Object.assign({}, SQLNode_1.sqlNodePrototype, { constructor: Value, [consts_1.refqlType]: type }); function Value(run) { let value = Object.create(prototype); value.run = (typeof run === "function" ? run : () => run); return value; } Value.isValue = function (x) { return x != null && x[consts_1.refqlType] === type; }; exports.default = Value;