@darlean/tables-suite
Version:
Tables Suite that provides fast, indexed access to structured data
46 lines (45 loc) • 1.73 kB
JavaScript
;
/**
* Suite that provides the Tables Service.
*
* @packageDocumentation
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTablesSuiteFromConfig = exports.createTablesSuite = void 0;
const base_1 = require("@darlean/base");
const table_1 = require("./table");
__exportStar(require("./table"), exports);
function createTablesSuite() {
return new base_1.ActorSuite([
{
type: base_1.TABLES_SERVICE,
kind: 'singular',
creator: (context) => {
const id = context.id;
const p = context.portal.retrieve(base_1.PERSISTENCE_SERVICE, []);
return new table_1.TableActor(p, context.deser, id, 0);
}
}
]);
}
exports.createTablesSuite = createTablesSuite;
function createTablesSuiteFromConfig(runtimeEnabled) {
if (runtimeEnabled) {
return createTablesSuite();
}
}
exports.createTablesSuiteFromConfig = createTablesSuiteFromConfig;