@rustable/utils
Version:
Essential utilities for object cloning, string manipulation, and value comparison in TypeScript, inspired by Rust's standard library.
18 lines (15 loc) • 328 B
JavaScript
import { deepClone } from './clone.mjs';
;
const symbol = Symbol("val.ptr");
function Val(value) {
const cloned = deepClone(value);
Object.defineProperty(cloned, symbol, {
value,
enumerable: false,
configurable: false,
writable: false
});
return cloned;
}
Val.ptr = symbol;
export { Val };