mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-18 02:46:32 +00:00
[JS] Add ".js" suffix to all import statements to generate a browser compatible mjs version. (#7086)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { BitWidth } from './bit-width'
|
||||
import { BitWidth } from './bit-width.js'
|
||||
|
||||
export function toByteWidth(bitWidth: BitWidth): number {
|
||||
return 1 << bitWidth;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { BitWidth } from './bit-width'
|
||||
import { paddingSize, iwidth, uwidth, fwidth, toByteWidth, fromByteWidth } from './bit-width-util'
|
||||
import { toUTF8Array } from './flexbuffers-util'
|
||||
import { ValueType } from './value-type'
|
||||
import { isNumber, isTypedVectorElement, toTypedVector } from './value-type-util'
|
||||
import { StackValue } from './stack-value'
|
||||
import { BitWidth } from './bit-width.js'
|
||||
import { paddingSize, iwidth, uwidth, fwidth, toByteWidth, fromByteWidth } from './bit-width-util.js'
|
||||
import { toUTF8Array } from './flexbuffers-util.js'
|
||||
import { ValueType } from './value-type.js'
|
||||
import { isNumber, isTypedVectorElement, toTypedVector } from './value-type-util.js'
|
||||
import { StackValue } from './stack-value.js'
|
||||
|
||||
interface StackPointer {
|
||||
stackPosition: number,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BitWidth } from './bit-width'
|
||||
import { toByteWidth, fromByteWidth } from './bit-width-util'
|
||||
import { toUTF8Array, fromUTF8Array } from './flexbuffers-util'
|
||||
import { Reference } from './reference'
|
||||
import { BitWidth } from './bit-width.js'
|
||||
import { toByteWidth, fromByteWidth } from './bit-width-util.js'
|
||||
import { toUTF8Array, fromUTF8Array } from './flexbuffers-util.js'
|
||||
import { Reference } from './reference.js'
|
||||
|
||||
export function validateOffset(dataView: DataView, offset: number, width: number): void {
|
||||
if (dataView.byteLength <= offset + width || (offset & (toByteWidth(width) - 1)) !== 0) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { fromByteWidth } from './bit-width-util'
|
||||
import { ValueType } from './value-type'
|
||||
import { isNumber, isIndirectNumber, isAVector, fixedTypedVectorElementSize, isFixedTypedVector, isTypedVector, typedVectorElementType, packedType, fixedTypedVectorElementType } from './value-type-util'
|
||||
import { indirect, keyForIndex, keyIndex, readFloat, readInt, readUInt, valueForIndexWithKey } from './reference-util'
|
||||
import { fromUTF8Array } from './flexbuffers-util';
|
||||
import { BitWidth } from './bit-width';
|
||||
import { fromByteWidth } from './bit-width-util.js'
|
||||
import { ValueType } from './value-type.js'
|
||||
import { isNumber, isIndirectNumber, isAVector, fixedTypedVectorElementSize, isFixedTypedVector, isTypedVector, typedVectorElementType, packedType, fixedTypedVectorElementType } from './value-type-util.js'
|
||||
import { indirect, keyForIndex, keyIndex, readFloat, readInt, readUInt, valueForIndexWithKey } from './reference-util.js'
|
||||
import { fromUTF8Array } from './flexbuffers-util.js';
|
||||
import { BitWidth } from './bit-width.js';
|
||||
|
||||
export function toReference(buffer: ArrayBuffer): Reference {
|
||||
const len = buffer.byteLength;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Builder } from './builder'
|
||||
import { BitWidth } from './bit-width'
|
||||
import { paddingSize, uwidth, fromByteWidth } from './bit-width-util'
|
||||
import { ValueType } from './value-type'
|
||||
import { isInline, packedType } from './value-type-util'
|
||||
import { Builder } from './builder.js'
|
||||
import { BitWidth } from './bit-width.js'
|
||||
import { paddingSize, uwidth, fromByteWidth } from './bit-width-util.js'
|
||||
import { ValueType } from './value-type.js'
|
||||
import { isInline, packedType } from './value-type-util.js'
|
||||
|
||||
export class StackValue {
|
||||
constructor(private builder: Builder, public type: ValueType, public width: number, public value: number | boolean | null = null, public offset: number = 0) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValueType } from './value-type'
|
||||
import { ValueType } from './value-type.js'
|
||||
|
||||
export function isInline(value: ValueType): boolean {
|
||||
return value === ValueType.BOOL
|
||||
|
||||
Reference in New Issue
Block a user