"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Entity = void 0;
class Entity {
    constructor($owner) {
        this.$owner = $owner;
    }
    get $path() {
        return this.$owner instanceof Entity ? this.$owner.$path + '/' + this.$key : '';
    }
    toJSON() {
        const json = {};
        for (const key of Object.keys(this)) {
            if (key[0] === '$' || key[0] === '_') {
                continue;
            }
            json[key] = this[key];
        }
        return json;
    }
}
exports.Entity = Entity;
//# sourceMappingURL=entity.js.map