def METHOD_NAME(blob, js_type):
    typeinfo = JS_TO_NPY_TYPEMAP[js_type]
    size, fmt = typeinfo['struct']
    dtype = np.dtype(typeinfo['dtype'])
    if len(blob) % size != 0:
        raise ValueError('given byte buffer is not aligned to the type')
    full_fmt = '<{0}{1}'.format(len(blob) // size, fmt)
    return np.array(struct.unpack(full_fmt, blob), dtype=dtype, copy=False)