Add lightweight correctness linting and resolve formatting conflicts

This commit is contained in:
Timothy J. Aveni
2026-09-15 15:31:50 -07:00
parent 0d3c013c07
commit 0854822923
13 changed files with 274 additions and 102 deletions
+16 -5
View File
@@ -2,11 +2,22 @@
* the raw ID. These handles do not themselves confer authority or a lease. */
const identities = new WeakMap();
class Reference {
constructor(id) { identities.set(this, id); Object.freeze(this); }
equals(other) { return isObjectReference(other) && identities.get(this) === identities.get(other); }
toJSON() { throw new Error("Object references cannot be serialized into ordinary data"); }
toString() { throw new Error("Object references cannot be coerced to strings"); }
[Symbol.toPrimitive]() { throw new Error("Object references cannot be coerced to scalar values"); }
constructor(id) {
identities.set(this, id);
Object.freeze(this);
}
equals(other) {
return isObjectReference(other) && identities.get(this) === identities.get(other);
}
toJSON() {
throw new Error("Object references cannot be serialized into ordinary data");
}
toString() {
throw new Error("Object references cannot be coerced to strings");
}
[Symbol.toPrimitive]() {
throw new Error("Object references cannot be coerced to scalar values");
}
}
export const isObjectReference = (value) => typeof value === "object" && value !== null && identities.has(value);
/** Internal transport boundary; intentionally not exported from the SDK entry. */