diff --git a/packages/core/stylus/src/contract.ts b/packages/core/stylus/src/contract.ts index 14977c1d2..78ded290b 100644 --- a/packages/core/stylus/src/contract.ts +++ b/packages/core/stylus/src/contract.ts @@ -100,23 +100,14 @@ export class ContractBuilder implements Contract { return [...this.constantsMap.values()]; } - addUseClause( - containerPath: string, - name: string, - options?: { groupable?: boolean; alias?: string } - ): void { + addUseClause(containerPath: string, name: string, options?: { groupable?: boolean; alias?: string }): void { // groupable defaults to true const groupable = options?.groupable ?? true; const alias = options?.alias ?? ''; const uniqueName = alias.length > 0 ? alias : name; const present = this.useClausesMap.has(uniqueName); if (!present) { - this.useClausesMap.set(uniqueName, { - containerPath, - name, - groupable, - alias, - }); + this.useClausesMap.set(uniqueName, { containerPath, name, groupable, alias }); } } @@ -152,10 +143,7 @@ export class ContractBuilder implements Contract { return this.implementedTraitsMap.has(name); } - addFunction( - baseTrait: BaseImplementedTrait, - fn: BaseFunction - ): ContractFunction { + addFunction(baseTrait: BaseImplementedTrait, fn: BaseFunction): ContractFunction { const t = this.addImplementedTrait(baseTrait); const signature = this.getFunctionSignature(fn); @@ -163,10 +151,7 @@ export class ContractBuilder implements Contract { // Look for the existing function with the same signature and return it if found for (let i = 0; i < t.functions.length; i++) { const existingFn = t.functions[i]; - if ( - existingFn !== undefined && - this.getFunctionSignature(existingFn) === signature - ) { + if (existingFn !== undefined && this.getFunctionSignature(existingFn) === signature) { return existingFn; } } @@ -184,21 +169,13 @@ export class ContractBuilder implements Contract { return [fn.name, '(', ...fn.args.map(a => a.name), ')'].join(''); } - addFunctionCodeBefore( - baseTrait: BaseImplementedTrait, - fn: BaseFunction, - codeBefore: string[] - ): void { + addFunctionCodeBefore(baseTrait: BaseImplementedTrait, fn: BaseFunction, codeBefore: string[]): void { this.addImplementedTrait(baseTrait); const existingFn = this.addFunction(baseTrait, fn); existingFn.codeBefore = [...(existingFn.codeBefore ?? []), ...codeBefore]; } - addFunctionTag( - baseTrait: BaseImplementedTrait, - fn: BaseFunction, - tag: string - ): void { + addFunctionTag(baseTrait: BaseImplementedTrait, fn: BaseFunction, tag: string): void { this.addImplementedTrait(baseTrait); const existingFn = this.addFunction(baseTrait, fn); existingFn.tag = tag;