-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove unnecessary patch type errors
- Loading branch information
1 parent
dc45f93
commit ff5ca9e
Showing
11 changed files
with
15 additions
and
57 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
packages/cli/src/lib/commands/assert/options/budgetPath.model.ts
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/cli/src/lib/commands/assert/options/budgets.model.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 2 additions & 12 deletions
14
packages/cli/src/lib/commands/assert/utils/budgets/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
import { readFile, writeFile } from '../../../../core/file'; | ||
import { logVerbose } from '../../../../core/loggin'; | ||
import Budget from 'lighthouse/types/lhr/budget'; | ||
import { DEFAULT_ASSERT_BUDGET_PATH } from '../../options/budgetPath.constant'; | ||
import { readFile } from '../../../../core/file'; | ||
import { DEFAULT_ASSERT_BUDGET_PATH } from '../../constants'; | ||
|
||
export function readBudgets(budgetPath: string = DEFAULT_ASSERT_BUDGET_PATH): Budget[] { | ||
const budgetsJson = JSON.parse(readFile(budgetPath, {fail: true}) || '{}'); | ||
return budgetsJson; | ||
} | ||
|
||
export function writeBudgets(config: Budget[], budgetPath: string = DEFAULT_ASSERT_BUDGET_PATH): void { | ||
logVerbose(`Update budgets under ${budgetPath}`); | ||
|
||
if (JSON.stringify(readBudgets()) !== JSON.stringify(config)) { | ||
writeFile(budgetPath, JSON.stringify(config)); | ||
logVerbose(`New budgets ${JSON.stringify(config)}`); | ||
} else { | ||
logVerbose(`No updates for ${budgetPath} to save.`); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters