cesium
Version:
CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.
22 lines (19 loc) • 659 B
JavaScript
import getStringFromTypedArray from "./getStringFromTypedArray.js";
/**
* Parses JSON from a Uint8Array.
*
* @function
*
* @param {Uint8Array} uint8Array The Uint8Array to read from.
* @param {Number} [byteOffset=0] The byte offset to start reading from.
* @param {Number} [byteLength] The byte length to read. If byteLength is omitted the remainder of the buffer is read.
* @returns {Object} An object containing the parsed JSON.
*
* @private
*/
function getJsonFromTypedArray(uint8Array, byteOffset, byteLength) {
return JSON.parse(
getStringFromTypedArray(uint8Array, byteOffset, byteLength)
);
}
export default getJsonFromTypedArray;