mirror of
https://github.com/morluto/rea.git
synced 2026-10-12 02:19:24 +00:00
* feat(javascript): recover code-split bundles from multiple inputs recover_javascript_sources accepted a single path, and validateModuleSet bound every module's provenance to that one snapshot. A code-split app (runtime + chunks, or an Electron main/preload/renderer set) had to be recovered one file per call, and modules recovered alone could not resolve imports across chunks: cross-chunk require(id) references stayed as numeric ids with property reads. Add an optional additional_paths input. The listed files are concatenated, in order after path, into the single engine snapshot, so one Wakaru run sees every module and cross-chunk imports resolve. validateModuleSet's single-snapshot binding is unchanged. Module provenance is attributed back to the input file its first extraction range starts in, with byte ranges rebased to that file's own offsets; a module whose ranges cross an input boundary keeps the concatenated snapshot identity and offsets, recorded as an explicit limitation. Single-path behavior is byte-for-byte unchanged (one segment, offset 0). Fixes #1605 * fix(javascript): preserve source identity in multi-input recovery --------- Co-authored-by: JingHao-Leon <[email protected]> Co-authored-by: morluto <[email protected]>
15 lines
299 B
JavaScript
15 lines
299 B
JavaScript
export class Cart {
|
|
constructor() {
|
|
this.items = [];
|
|
}
|
|
add(price) {
|
|
this.items.push(price);
|
|
return this;
|
|
}
|
|
total() {
|
|
return this.items.reduce((sum, price) => sum + price, 0);
|
|
}
|
|
}
|
|
export const formatPrice = (value) => `$${value.toFixed(2)}`;
|
|
export const TAX_RATE = 0.08;
|