Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bb.writeFloat32(0, 10);
// $ExpectError
bb.writeFloat32(0);
// $ExpectError
bb.writeFloat32("s", "t");
bb.writeFloat64(0, 10);
// $ExpectError
bb.writeFloat64(0);
// $ExpectError
bb.writeFloat64("s", "t");
/**
* Builder
*/
let b = new fb.Builder();
new fb.Builder(0);
// $ExpectError
new fb.Builder("s");
fb.Builder.growByteBuffer(bb);
// $ExpectError
fb.Builder.growByteBuffer();
// $ExpectError
fb.Builder.growByteBuffer(0);
// $ExpectError
fb.Builder.growByteBuffer("s");
b.forceDefaults(true);
// $ExpectError
b.forceDefaults(0);
// $ExpectError
// $ExpectError
bb.writeFloat32(0);
// $ExpectError
bb.writeFloat32("s", "t");
bb.writeFloat64(0, 10);
// $ExpectError
bb.writeFloat64(0);
// $ExpectError
bb.writeFloat64("s", "t");
/**
* Builder
*/
let b = new fb.Builder();
new fb.Builder(0);
// $ExpectError
new fb.Builder("s");
fb.Builder.growByteBuffer(bb);
// $ExpectError
fb.Builder.growByteBuffer();
// $ExpectError
fb.Builder.growByteBuffer(0);
// $ExpectError
fb.Builder.growByteBuffer("s");
b.forceDefaults(true);
// $ExpectError
b.forceDefaults(0);
// $ExpectError
b.forceDefaults("str");
// $ExpectError
bb.writeFloat32("s", "t");
bb.writeFloat64(0, 10);
// $ExpectError
bb.writeFloat64(0);
// $ExpectError
bb.writeFloat64("s", "t");
/**
* Builder
*/
let b = new fb.Builder();
new fb.Builder(0);
// $ExpectError
new fb.Builder("s");
fb.Builder.growByteBuffer(bb);
// $ExpectError
fb.Builder.growByteBuffer();
// $ExpectError
fb.Builder.growByteBuffer(0);
// $ExpectError
fb.Builder.growByteBuffer("s");
b.forceDefaults(true);
// $ExpectError
b.forceDefaults(0);
// $ExpectError
b.forceDefaults("str");
b.dataBuffer();
function getParameter(type, path, defaultValue) {
const builder = new flatbuffers.Builder(512);
const pathOffset = builder.createString(path);
const isObject = type === __std.ParamType.Object;
const defaultValueOffset = isObject
&& defaultValue !== undefined
&& builder.createString(JSON.stringify(defaultValue));
__std.ParamArgs.startParamArgs(builder);
__std.ParamArgs.addPath(builder, pathOffset);
__std.ParamArgs.addType(builder, type);
if (isObject) {
__std.ParamArgs.addDefaultValue(builder, defaultValueOffset);
}
const argsOffset = __std.ParamArgs.endParamArgs(builder);
__std.Message.startMessage(builder);
__std.Message.addArgsType(builder, __std.Args.ParamArgs);