Files
marqdo/tests/applications/wine/producer.js
cflmyandCursor 8f1010f967 Ship oracle journal values, bytecode/frontend hardening, and replay-policy Lean.
Host exposes oracle journals as language values with refuse/copy gates; bytecode and foreign session paths get modularized; applications and verification replay-policy sources land with Lake builds ignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 15:04:27 +08:00

14 lines
623 B
JavaScript

function scaledDecimal(s, digits) {
var parts = s.split('.');
var tail = parts.length > 1 ? parts[1] : '';
if (tail.length > digits) throw Error('unsupported decimal precision');
return Number(parts[0])*10**digits + Number(tail.padEnd(digits,'0'));
}
var lines = data.trim().split(/\r?\n/);
var header = lines[0].split(';').map(s=>s.replaceAll('"',''));
var bridge = lines.slice(1).map(line=>{
var fields=line.split(';');
return {quality:Number(fields[header.indexOf('quality')]),density_ppm:scaledDecimal(fields[header.indexOf('density')],6),ph_cent:scaledDecimal(fields[header.indexOf('pH')],2)};
});
bridge;