UNPKG

@gent-js/gent

Version:

template-based data generator.

14 lines (13 loc) 486 B
import { AbstractJsonable } from "../abstractJsonable.js"; import { transformJsonableObjectIntoJsonObject } from "../stringifyJsonable.js"; export class ObjectJsonable extends AbstractJsonable { content; type = "object"; constructor(content, probability, weight) { super(probability, weight); this.content = content; } toJSONImpl(keyOrIndex, context) { return transformJsonableObjectIntoJsonObject(this.content, keyOrIndex, context); } }