JCloudYu/beson · deserialize.esm.js
javascript logo
function __deserializeDate(buffer, start, options) {
	let end = start + 8;
	let dataView = new DataView(buffer);
	let data = new Date(dataView.getFloat64(start, true));
	return { anchor: end, value: data };
}
Similar code snippets
1.
JCloudYu/beson · deserialize.esm.js
Match rating: 81.56% · See similar code snippets
javascript logo
function __deserializeFloat64(buffer, start, options) {
	let end = start + 8;
	let dataView = new DataView(buffer);
	let data = dataView.getFloat64(start, true);
	return { anchor: end, value: data };
}
2.
JCloudYu/beson · deserialize.esm.js
Match rating: 75.46% · See similar code snippets
javascript logo
function __deserializeFloat32(buffer, start, options) {
	let end = start + 4;
	let dataView = new DataView(buffer);
	let data = dataView.getFloat32(start, true);
	return { anchor: end, value: data };
}
3.
JCloudYu/beson · deserialize.esm.js
Match rating: 70.63% · See similar code snippets
javascript logo
function __deserializeArray(buffer, start, options) {
	let dataView = new DataView(buffer);
	let length = dataView.getUint32(start, true);
	start += 4;
	let end = start + length;
	let data = [];
	while (start < end) {
		let subType, subData;
		({ anchor: start, value: subType } = __deserializeType(buffer, start, options));
		({ anchor: start, value: subData } = __deserializeData(subType, buffer, start, options));
		data.push(subData);
	}
	return { anchor: end, value: data };
}
4.
JCloudYu/beson · deserialize.esm.js
Match rating: 69.54% · See similar code snippets
javascript logo
function __deserializeInt8(buffer, start, options) {
	let end = start + 1;
	let dataView = new DataView(buffer);
	let data = dataView.getInt8(start);
	return { anchor: end, value:options.use_native_types ? data : Int8.from(data) };
}
5.
JCloudYu/beson · deserialize.esm.js
Match rating: 68.25% · See similar code snippets
javascript logo
function __deserializeObject(buffer, start, options) {
	let dataView = new DataView(buffer);
	let length = dataView.getUint32(start, true);
	start += 4;
	let end = start + length;
	let data = {};
	while (start < end) {
		let subType, subKey, subData;
		({ anchor: start, value: subType } = __deserializeType(buffer, start, options));
		({ anchor: start, value: subKey } = __deserializeShortString(buffer, start, options));
		({ anchor: start, value: subData } = __deserializeData(subType, buffer, start, options));
		data[subKey] = subData;
	}
	return { anchor: end, value: data };
}
6.
JCloudYu/beson · deserialize.esm.js
Match rating: 68.22% · See similar code snippets
javascript logo
function __deserializeArrayStreaming(buffer, start, options) {
	let end = start;
	let dataView = new DataView(buffer);
	let endData = new Uint16Array(TYPE_HEADER.ARRAY_END);
	let data = [];
	while (start < buffer.byteLength) {
		let tmpType = dataView.getUint16(start, true);
		if (tmpType === endData[0]) {
			end += 2;
			break;
		}
		
		let subType, subData;
		({ anchor: start, value: subType } = __deserializeType(buffer, start, options));
		({ anchor: start, value: subData } = __deserializeData(subType, buffer, start, options));
		data.push(subData);
		end = start;
	}
	return { anchor: end, value: data };
}
7.
JCloudYu/beson · deserialize.esm.js
Match rating: 67.82% · See similar code snippets
javascript logo
function __deserializeUInt8(buffer, start, options) {
	let end = start + 1;
	let dataView = new DataView(buffer);
	let data = dataView.getUint8(start);
	return { anchor: end, value:options.use_native_types ? data : UInt8.from(data) };
}
8.
JCloudYu/beson · deserialize.esm.js
Match rating: 67.55% · See similar code snippets
javascript logo
function __deserializeObjectStreaming(buffer, start, options) {
	let end = start;
	let dataView = new DataView(buffer);
	let endData = new Uint16Array(TYPE_HEADER.OBJECT_END);
	let data = {};
	while (start < buffer.byteLength) {
		let tmpType = dataView.getUint16(start, true);
		if (tmpType === endData[0]) {
			end += 2;
			break;
		}

		let subType, subKey, subData;
		({ anchor: start, value: subType } = __deserializeType(buffer, start, options));
		({ anchor: start, value: subKey } = __deserializeShortString(buffer, start, options));
		({ anchor: start, value: subData } = __deserializeData(subType, buffer, start, options));
		data[subKey] = subData;
		end = start;
	}
	return { anchor: end, value: data };
}
9.
JCloudYu/beson · deserialize.esm.js
Match rating: 67.07% · See similar code snippets
javascript logo
function __deserializeObjectId(buffer, start, options) {
	let step = 1;
	let length = 12;
	let end = start + length;
	let dataView = new DataView(buffer);
	let dataArray = [];
	for (let i = start; i < end; i += step) {
		dataArray.push(dataView.getUint8(i));
	}
	let data = new ObjectId(Uint8Array.from(dataArray).buffer);
	return { anchor: end, value: data };
}
10.
JCloudYu/beson · deserialize.esm.js
Match rating: 66.95% · See similar code snippets
javascript logo
function __deserializeContent(buffer, start, options) {
	let type, data;
	({ anchor: start, value: type } = __deserializeType(buffer, start, options));
	({ anchor: start, value: data } = __deserializeData(type, buffer, start, options));
	return { anchor: start, value: data };
}