Skip to content
Permalink
9bfb9ba527
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (23 sloc) 949 Bytes
'use strict'
const typedArray = require('./typedArray')
function describe (props) {
return new DescribedDataViewValue(Object.assign({
buffer: typedArray.getBuffer(props.value),
// Set isArray and isList so the property recursor excludes the byte accessors
isArray: true,
isList: true,
}, props))
}
exports.describe = describe
function deserialize (state, recursor) {
return new DeserializedDataViewValue(state, recursor)
}
exports.deserialize = deserialize
const tag = Symbol('DataViewValue')
exports.tag = tag
// DataViews can be represented as regular Buffers, allowing them to be treated
// as TypedArrays for the purposes of this package.
class DataViewValue extends typedArray.TypedArrayValue {}
Object.defineProperty(DataViewValue.prototype, 'tag', { value: tag })
const DescribedDataViewValue = typedArray.DescribedMixin(DataViewValue)
const DeserializedDataViewValue = typedArray.DeserializedMixin(DataViewValue)