ducjs
Version:
The duc 2D CAD file format is a cornerstone of our advanced design system, conceived to cater to professionals seeking precision and efficiency in their design work.
65 lines (64 loc) • 2.63 kB
JavaScript
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
export class JSONPatchOperation {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsJSONPatchOperation(bb, obj) {
return (obj || new JSONPatchOperation()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsJSONPatchOperation(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new JSONPatchOperation()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
op(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
path(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
from(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 8);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
value(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 10);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
static startJSONPatchOperation(builder) {
builder.startObject(4);
}
static addOp(builder, opOffset) {
builder.addFieldOffset(0, opOffset, 0);
}
static addPath(builder, pathOffset) {
builder.addFieldOffset(1, pathOffset, 0);
}
static addFrom(builder, fromOffset) {
builder.addFieldOffset(2, fromOffset, 0);
}
static addValue(builder, valueOffset) {
builder.addFieldOffset(3, valueOffset, 0);
}
static endJSONPatchOperation(builder) {
const offset = builder.endObject();
return offset;
}
static createJSONPatchOperation(builder, opOffset, pathOffset, fromOffset, valueOffset) {
JSONPatchOperation.startJSONPatchOperation(builder);
JSONPatchOperation.addOp(builder, opOffset);
JSONPatchOperation.addPath(builder, pathOffset);
JSONPatchOperation.addFrom(builder, fromOffset);
JSONPatchOperation.addValue(builder, valueOffset);
return JSONPatchOperation.endJSONPatchOperation(builder);
}
}