Skip to content

Commit

Permalink
More code shrinkage
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Jan 18, 2024
1 parent d133101 commit b080538
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ export class Cache<T extends Container<any>> {
for (const item of cache.children) this.remove(item);
return this;
}

clone(): Cache<T> {
return new Cache<T>().merge(this);
}
}

/**
Expand Down Expand Up @@ -448,19 +444,16 @@ export class Rule extends Cache<Rule | Style> implements Container<Rule> {
/**
* The FreeStyle class implements the API for everything else.
*/
export class FreeStyle
extends Cache<Rule | Style>
implements Container<FreeStyle>
{
export class FreeStyle extends Cache<Rule | Style> {
constructor(
public cid: string,
public prefix: string,
changes?: Changes,
) {
super(changes);
}

register(compiled: Compiled) {
const className = `${this.cid}${compiled.id}`;
const className = `${this.prefix}${compiled.id}`;

if (process.env.NODE_ENV !== "production" && compiled.displayName) {
const name = `${compiled.displayName}_${className}`;
Expand All @@ -481,7 +474,7 @@ export class FreeStyle
}

clone(): FreeStyle {
return new FreeStyle(this.cid, this.changes).merge(this);
return new FreeStyle(this.prefix, this.changes).merge(this);
}
}

Expand Down

0 comments on commit b080538

Please sign in to comment.