feat(README, filledDataView, sizedDataView)
This commit is contained in:
12
src/index.js
12
src/index.js
@ -1,5 +1,5 @@
|
||||
import { limits } from './limits'
|
||||
import { memcpy } from './mem'
|
||||
import { sizedDataView, filledDataView, memcpy } from './mem'
|
||||
import { Type } from './Type'
|
||||
import { Int } from './Int'
|
||||
import { ConstString } from './ConstString'
|
||||
@ -10,6 +10,8 @@ import { Struct } from './Struct'
|
||||
|
||||
export {
|
||||
limits,
|
||||
sizedDataView,
|
||||
filledDataView,
|
||||
memcpy,
|
||||
Type,
|
||||
Int,
|
||||
@ -217,7 +219,13 @@ export function sizeof(...args) {
|
||||
if (arg2 instanceof Type) {
|
||||
return arg2.sizeof(arg, ...inner_args2)
|
||||
}
|
||||
throw new Error('unknown size of ' + args)
|
||||
throw new Error(
|
||||
'unknown size of ' +
|
||||
args.map((arg) => {
|
||||
if (typeof arg == 'function') return arg.name
|
||||
return arg
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
export function isSerializableType(type) {
|
||||
|
||||
Reference in New Issue
Block a user