-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2413604
commit e3bb9d9
Showing
13 changed files
with
271 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto eol=lf | ||
|
||
*.fflate -diff linguist-generated=true |
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,11 @@ | ||
|
||
const store = new Map() | ||
export function GM_deleteValue(key){ | ||
store.delete(key) | ||
} | ||
export function GM_getValue(key){ | ||
store.get(key) | ||
} | ||
export function GM_setValue(key, value) { | ||
store.set(key, value) | ||
} |
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
Large diffs are not rendered by default.
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
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,27 @@ | ||
import { expect, test, vi } from 'vitest' | ||
import { matchKatakanaOrTerm } from './gameText' | ||
|
||
test('japanese example', () => { | ||
vi.mock('./src/misc/store.ts', () => { | ||
return { | ||
useOptions: ()=> ({ | ||
enableGoogleTranslate: { value: false }, | ||
translateMode: { value: 'full' }, | ||
customTranslations: {}, | ||
matchSelectors: {}, | ||
katakanaLanguage: 'en', | ||
resetOptions: () => null | ||
}) | ||
} | ||
}) | ||
const text = '「クロの賞状:金賞」「クロの賞状:銀賞」「クロの賞状:銅賞」と引き換えられるご褒美が追加/変更されます。' | ||
const result = matchKatakanaOrTerm(text) | ||
expect(result.map(it => text.slice(it.start, it.end))).toMatchInlineSnapshot(` | ||
[ | ||
"クロの賞状:金賞", | ||
"クロの賞状:銀賞", | ||
"クロの賞状:銅賞", | ||
] | ||
`) | ||
vi.unmock('$') | ||
}) |
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.