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();
la.toFloat64();
la.equals(lb);
// $ExpectError
la.equals(10);
/**
* ByteBuffer
*/
const arr = new Uint8Array(10);
let bb = new fb.ByteBuffer(arr);
// $ExpectError arg is required
new fb.ByteBuffer();
// $ExpectError arg must be number
new fb.ByteBuffer("s");
fb.ByteBuffer.allocate(10);
// $ExpectError
fb.ByteBuffer.allocate();
// $ExpectError
fb.ByteBuffer.allocate("s");
bb.bytes();
bb.position();
bb.setPosition(1);
// $ExpectError
bb.setPosition();
// $ExpectError
bb.setPosition("s");
// $ExpectError
new fb.Long.create();
// $ExpectError
new fb.Long.create("s", "t");
la.toFloat64();
la.equals(lb);
// $ExpectError
la.equals(10);
/**
* ByteBuffer
*/
const arr = new Uint8Array(10);
let bb = new fb.ByteBuffer(arr);
// $ExpectError arg is required
new fb.ByteBuffer();
// $ExpectError arg must be number
new fb.ByteBuffer("s");
fb.ByteBuffer.allocate(10);
// $ExpectError
fb.ByteBuffer.allocate();
// $ExpectError
fb.ByteBuffer.allocate("s");
bb.bytes();
bb.position();
bb.setPosition(1);
// $ExpectError
b.createString();
// $ExpectError
b.createString(0);
b.createLong(1, 2);
// $ExpectError
b.createLong();
// $ExpectError
b.createLong("s", "t");
/**
* flatbuffers
*/
new fb.flatbuffers.Long(1, 2);
new fb.flatbuffers.ByteBuffer(arr);
new fb.flatbuffers.Builder();
b.createString(arr);
// $ExpectError
b.createString();
// $ExpectError
b.createString(0);
b.createLong(1, 2);
// $ExpectError
b.createLong();
// $ExpectError
b.createLong("s", "t");
/**
* flatbuffers
*/
new fb.flatbuffers.Long(1, 2);
new fb.flatbuffers.ByteBuffer(arr);
new fb.flatbuffers.Builder();
// @flow
import fb from "flatbuffers";
/**
* Long
*/
let la = new fb.Long(1, 2);
// $ExpectError
new fb.Long();
// $ExpectError
new fb.Long("s", "t");
// $ExpectError
new fb.Long(1);
let lb = fb.Long.create(1, 2);
// $ExpectError
new fb.Long.create();
// $ExpectError
new fb.Long.create("s", "t");
la.toFloat64();
la.equals(lb);
// $ExpectError
la.equals(10);
/**
// @flow
import fb from "flatbuffers";
/**
* Long
*/
let la = new fb.Long(1, 2);
// $ExpectError
new fb.Long();
// $ExpectError
new fb.Long("s", "t");
// $ExpectError
new fb.Long(1);
let lb = fb.Long.create(1, 2);
// $ExpectError
new fb.Long.create();
// $ExpectError
new fb.Long.create("s", "t");
la.toFloat64();
la.equals(lb);
// $ExpectError
la.equals(10);
/**
* ByteBuffer
*/
// @flow
import fb from "flatbuffers";
/**
* Long
*/
let la = new fb.Long(1, 2);
// $ExpectError
new fb.Long();
// $ExpectError
new fb.Long("s", "t");
// $ExpectError
new fb.Long(1);
let lb = fb.Long.create(1, 2);
// $ExpectError
new fb.Long.create();
// $ExpectError
new fb.Long.create("s", "t");
la.toFloat64();
la.equals(lb);