File size: 483 Bytes
96af7c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import { double } from './double.js';
import { array } from './array.js';
import { Float64Array } from '../utils/globals.js';
function toTypedMapper(data) {
return Float64Array.from(data);
}
function fromTypedUnmapper(value) {
if (!(value instanceof Float64Array))
throw new Error('Unexpected type');
return [...value];
}
export function float64Array(constraints = {}) {
return array(double(constraints), constraints).map(toTypedMapper, fromTypedUnmapper);
}
|