mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-26 06:34:20 +08:00
12 lines
384 B
JavaScript
12 lines
384 B
JavaScript
// The tmpdir.js shape: a module.exports table with accessor entries over
|
|
// mutable module state — every read runs the getter (Node's semantics),
|
|
// so mutations through the exported setter are visible per read.
|
|
'use strict';
|
|
let current = 'first';
|
|
function bump(v) { current = v; }
|
|
module.exports = {
|
|
bump,
|
|
get value() { return current; },
|
|
set value(v) { current = v; },
|
|
};
|