Permalink
Cannot retrieve contributors at this time
29 lines (23 sloc)
970 Bytes
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?
codeql-action/node_modules/concordance/lib/complexValues/arrayBuffer.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const typedArray = require('./typedArray') | |
function describe (props) { | |
return new DescribedArrayBufferValue(Object.assign({ | |
buffer: Buffer.from(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 DeserializedArrayBufferValue(state, recursor) | |
} | |
exports.deserialize = deserialize | |
const tag = Symbol('ArrayBufferValue') | |
exports.tag = tag | |
// ArrayBuffers can be represented as regular Buffers, allowing them to be | |
// treated as TypedArrays for the purposes of this package. | |
class ArrayBufferValue extends typedArray.TypedArrayValue {} | |
Object.defineProperty(ArrayBufferValue.prototype, 'tag', { value: tag }) | |
const DescribedArrayBufferValue = typedArray.DescribedMixin(ArrayBufferValue) | |
const DeserializedArrayBufferValue = typedArray.DeserializedMixin(ArrayBufferValue) |