From ba01183b4e10e16fbcc01c09df21d9a0ba4182c6 Mon Sep 17 00:00:00 2001 From: Valery Aligorsky Date: Sun, 29 Aug 2021 12:56:24 +0200 Subject: [PATCH] fix(typos): fix typo in ExportsAnalyzerResult abstract property BREAKING CHANGE: rename abstact to abstract --- lib/exportsAnalyzer.ts | 6 +++--- lib/fileAnalyzer.ts | 2 +- test/exportsAnalyzer.spec.ts | 16 ++++++++-------- test/plugins/SPDXLicenseRemovePlugin.spec.ts | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/exportsAnalyzer.ts b/lib/exportsAnalyzer.ts index 9c8d5e5..4033b5d 100644 --- a/lib/exportsAnalyzer.ts +++ b/lib/exportsAnalyzer.ts @@ -5,7 +5,7 @@ import { ExportType } from './types'; const error = Debug('sol-merger:error'); export interface ExportsAnalyzerResult { - abstact: boolean; + abstract: boolean; type: ExportType; name: string; is: string; @@ -18,7 +18,7 @@ export class ExportsAnalyzer { /** * Analyzes all the exports of the file (Contract, Interface, Library) * - * Single export statement to process. Basicly it analizes next things: + * Single export statement to process. Basically it analyzes next things: * * 1. Get the type of the export * 2. Get the body of the export @@ -31,7 +31,7 @@ export class ExportsAnalyzer { const visitor = new SolidityExportVisitor(this.contents); visitor.visit((e) => { results.push({ - abstact: e.abstract, + abstract: e.abstract, type: e.type, name: e.name, body: this.contents.substring(e.body.start, e.body.end + 1).trim(), diff --git a/lib/fileAnalyzer.ts b/lib/fileAnalyzer.ts index b2440fc..5fc86f5 100644 --- a/lib/fileAnalyzer.ts +++ b/lib/fileAnalyzer.ts @@ -40,7 +40,7 @@ export class FileAnalyzer { }); } - const abstract = e.abstact ? 'abstract ' : ''; + const abstract = e.abstract ? 'abstract ' : ''; return `${abstract}${e.type} ${newName || e.name} ${is}${e.body}`; } /** diff --git a/test/exportsAnalyzer.spec.ts b/test/exportsAnalyzer.spec.ts index 4124bd1..e035dbd 100644 --- a/test/exportsAnalyzer.spec.ts +++ b/test/exportsAnalyzer.spec.ts @@ -33,37 +33,37 @@ describe('ExportsAnalyzer', () => { const exports = exportsAnalyzer.analyzeExports(); assert.deepEqual(exports, [ - { abstact: false, type: 'contract', name: 'A', is: '', body: '{ }' }, + { abstract: false, type: 'contract', name: 'A', is: '', body: '{ }' }, { - abstact: false, + abstract: false, type: 'contract', name: 'B', is: 'is A ', body: '{\n // some body here...\n }', }, { - abstact: false, + abstract: false, type: 'library', name: 'L', is: '', body: '{\n // l...\n }', }, { - abstact: false, + abstract: false, type: 'interface', name: 'I', is: '', body: '{\n // i...\n }', }, { - abstact: false, + abstract: false, body: '{\n uint weight;\n bool voted;\n }', is: '', name: 'S', type: 'struct', }, { - abstact: false, + abstract: false, body: '{\n Created,\n Locked,\n Inactive\n }', is: '', @@ -83,14 +83,14 @@ describe('ExportsAnalyzer', () => { assert.deepEqual(exports, [ { - abstact: false, + abstract: false, body: '// Some contracts without exports', is: '', name: 'Comment#9', type: 'comment', }, { - abstact: false, + abstract: false, body: '// Some contract text that is not required here', is: '', name: 'Comment#52', diff --git a/test/plugins/SPDXLicenseRemovePlugin.spec.ts b/test/plugins/SPDXLicenseRemovePlugin.spec.ts index 935b99f..f2f34ce 100644 --- a/test/plugins/SPDXLicenseRemovePlugin.spec.ts +++ b/test/plugins/SPDXLicenseRemovePlugin.spec.ts @@ -9,7 +9,7 @@ describe('SPDXLicenseRemovePlugin', () => { const comment: ExportsAnalyzerResult = { type: ExportType.comment, - abstact: false, + abstract: false, body: `// SPDX-License-Identifier: MIT `, is: '', name: 'Test', @@ -24,7 +24,7 @@ describe('SPDXLicenseRemovePlugin', () => { const comment: ExportsAnalyzerResult = { type: ExportType.comment, - abstact: false, + abstract: false, body: `/* SPDX-License-Identifier: MIT SPDX-License-Identifier: EPL-1.0+