@x5e/gink
Version:
an eventually consistent database
30 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Property = void 0;
const Database_1 = require("./Database");
const builders_1 = require("./builders");
const Keyed_1 = require("./Keyed");
const Container_1 = require("./Container");
class Property extends Keyed_1.Keyed {
constructor(database, address) {
super(database, address, builders_1.Behavior.PROPERTY);
}
static get(database, muid) {
database = database || Database_1.Database.recent;
if (!muid) {
muid = { timestamp: -1, medallion: -1, offset: builders_1.Behavior.PROPERTY };
}
return new Property(database, muid);
}
static async create(database, meta) {
database = database || Database_1.Database.recent;
const muid = await Container_1.Container.addContainer({
behavior: builders_1.Behavior.PROPERTY,
database,
meta,
});
return new Property(database, muid);
}
}
exports.Property = Property;
//# sourceMappingURL=Property.js.map