Skip to content

Commit 4172761

Browse files
committed
Refactor: Prevented unintended arrays changes
1 parent dc2f10c commit 4172761

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/recipes/hanayama_huzzles/HanayamaHuzzle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class HanayamaHuzzle implements Trackable {
77
public readonly level: string,
88
public readonly index: string,
99
public readonly name: string,
10-
public readonly imageLinks: string[],
10+
public readonly imageLinks: readonly string[],
1111
public readonly status = ''
1212
) {
1313
this.identifier = name;

src/recipes/hanayama_huzzles/HanayamaHuzzlesRecipe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export class HanayamaHuzzlesRecipe implements Recipe {
1313
static readonly NAME = 'Hanayama Huzzles';
1414
static readonly WEBPAGE = 'https://hanayama-toys.com/product-category/puzzles/huzzle';
1515

16-
static readonly #HEADERS = ['Level', 'Index', 'Name', 'Picture', 'Status'];
17-
static readonly #SCRAPE_URLS = [
16+
static readonly #HEADERS: readonly string[] = ['Level', 'Index', 'Name', 'Picture', 'Status'];
17+
static readonly #SCRAPE_URLS: readonly string[] = [
1818
'https://hanayama-toys.com/product-category/puzzles/huzzle/level-1-fun',
1919
'https://hanayama-toys.com/product-category/puzzles/huzzle/level-2-easy',
2020
'https://hanayama-toys.com/product-category/puzzles/huzzle/level-3-normal',

src/recipes/helpers/RecipeListUpdater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RecipeMarkdownListUpdater } from './RecipeMarkdownListUpdater';
44

55
export class RecipeListUpdater<T extends Trackable> {
66
constructor(
7-
private headers: string[],
7+
private headers: readonly string[],
88
private recipeMarkdownListUpdater: RecipeMarkdownListUpdater,
99
private trackablesUpdater: TrackablesUpdater
1010
) {}
@@ -13,7 +13,7 @@ export class RecipeListUpdater<T extends Trackable> {
1313
content: string,
1414
markdownTableStringToTrackables: (markdownTableString: string) => T[],
1515
scrapeTrackables: () => Promise<T[]>,
16-
trackablesToMarkdownTableString: (headers: string[], trackables: T[]) => string
16+
trackablesToMarkdownTableString: (headers: readonly string[], trackables: T[]) => string
1717
): Promise<string> {
1818
return this.recipeMarkdownListUpdater.update(content, async markdownList => {
1919
const currentTrackables = markdownList != null ? markdownTableStringToTrackables(markdownList) : [];

src/recipes/iq_puzzles/IQPuzzlesRecipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class IQPuzzlesRecipe implements Recipe {
1313
static readonly NAME = 'IQ Puzzles';
1414
static readonly WEBPAGE = 'https://www.iqpuzzle.com';
1515

16-
static readonly #HEADERS = ['Name', 'Picture', 'Status'];
16+
static readonly #HEADERS: readonly string[] = ['Name', 'Picture', 'Status'];
1717
static readonly #SCRAPE_URL = 'https://www.iqpuzzle.com';
1818

1919
#marker = new RecipeMarker(IQPuzzlesRecipe.NAME);

0 commit comments

Comments
 (0)