Skip to content

Commit

Permalink
build+deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
eddow committed Nov 2, 2024
1 parent ef6ac8e commit c32c00a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ import D, { constructedObject } from 'flat-diamond'
### When the class is from a library

Seclusion is your friend
[Seclusion](#seclusion-and-construction) is your friend

# Seclusion

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flat-diamond",
"version": "1.0.3",
"version": "1.0.4",
"exports": {
".": {
"import": "./lib/esm.js",
Expand Down
8 changes: 4 additions & 4 deletions src/seclude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export function Seclude<TBase extends Ctor, Keys extends (keyof InstanceType<TBa
}
}
}
const privates = new WeakMap<Secluded, TBase>(),
const privates = new WeakMap<GateKeeper, TBase>(),
diamondSecluded = !fLegs(base),
diamond = diamondSecluded ? (Diamond(PropertyCollector) as TBase) : PropertyCollector
class Secluded extends (diamond as any) {
class GateKeeper extends (diamond as any) {
static secluded(obj: TBase): TBase | undefined {
return privates.get(obj)
}
Expand Down Expand Up @@ -199,6 +199,6 @@ export function Seclude<TBase extends Ctor, Keys extends (keyof InstanceType<TBa
},
getPrototypeOf: (target) => diamond.prototype
})
Object.setPrototypeOf(Secluded.prototype, fakeCtor.prototype)
return Secluded as any
Object.setPrototypeOf(GateKeeper.prototype, fakeCtor.prototype)
return GateKeeper as any
}

0 comments on commit c32c00a

Please sign in to comment.