feat(README, filledDataView, sizedDataView)

This commit is contained in:
2025-08-08 12:32:55 +03:00
parent c5c0c17db2
commit c3e0e286a8
17 changed files with 322 additions and 30 deletions

View File

@ -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) {