-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace image-handler with images-info-saver
- Loading branch information
Showing
34 changed files
with
944 additions
and
1,105 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export class Cache<Key, Value> { | ||
private _getKeyHash: (key: Key) => string; | ||
private _cache: Map<string, Value>; | ||
|
||
constructor(hashFn: (key: Key) => string) { | ||
this._getKeyHash = hashFn; | ||
this._cache = new Map(); | ||
} | ||
|
||
has(key: Key): boolean { | ||
const keyHash = this._getKeyHash(key); | ||
|
||
return this._cache.has(keyHash); | ||
} | ||
|
||
get(key: Key): Value | undefined { | ||
const keyHash = this._getKeyHash(key); | ||
|
||
return this._cache.get(keyHash); | ||
} | ||
|
||
set(key: Key, value: Value): this { | ||
const keyHash = this._getKeyHash(key); | ||
|
||
if (value !== undefined) { | ||
this._cache.set(keyHash, value); | ||
} else { | ||
this._cache.delete(keyHash); | ||
} | ||
|
||
return this; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const ERROR_TITLE_TEXT_LENGTH = 200; | ||
|
||
export const NEW_ISSUE_LINK = 'https://github.com/gemini-testing/html-reporter/issues/new'; |
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
Oops, something went wrong.