UNPKG

@sudoo/marked

Version:

JavaScript & TypeScript code runner in JavaScript, safe with marked territory, asynchronous

40 lines (39 loc) 969 B
"use strict"; /** * @author WMXPY * @namespace Variable_SandClass * @description Sand Class Instance */ Object.defineProperty(exports, "__esModule", { value: true }); exports.SandClassInstance = void 0; class SandClassInstance { static create(targetClass) { return new SandClassInstance(targetClass); } constructor(targetClass) { this._targetClass = targetClass; this._body = targetClass.body.clone(); } get targetClass() { return this._targetClass; } get body() { return this._body; } lookFor(key) { if (this._body.has(key)) { return this._body.get(key); } return this._targetClass.lookFor(key); } lookForHas(key) { if (this._body.has(key)) { return true; } return this._targetClass.lookForHas(key); } toNative() { return this.body.map; } } exports.SandClassInstance = SandClassInstance;