From 77302575574513c9002b9d99900ac6c833d75842 Mon Sep 17 00:00:00 2001 From: Pacharapol Withayasakpunt Date: Fri, 13 May 2022 08:24:25 +0700 Subject: [PATCH] update scripts --- scripts/wk-api/test.ts | 12 ++++++++++++ src/wanikani.ts | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 scripts/wk-api/test.ts diff --git a/scripts/wk-api/test.ts b/scripts/wk-api/test.ts new file mode 100644 index 0000000..adadb18 --- /dev/null +++ b/scripts/wk-api/test.ts @@ -0,0 +1,12 @@ +import { WaniKani } from '@/wanikani'; + +async function main() { + const wk = new WaniKani(); + wk.$axios + .get('/level_progressions') + .then((r) => console.dir(r.data, { depth: null })); +} + +if (require.main === module) { + main(); +} diff --git a/src/wanikani.ts b/src/wanikani.ts index 7503baa..5041d49 100644 --- a/src/wanikani.ts +++ b/src/wanikani.ts @@ -416,6 +416,7 @@ export class WaniKani { sentenceCloze?: string; }, opts: { + prependEnglishCloze?: boolean; overwrite?: boolean; } = {}, ) { @@ -504,6 +505,7 @@ export class WaniKani { const notJa = '[^\\p{sc=Han}\\p{sc=Katakana}\\p{sc=Hiragana}]+'; if ( + opts.prependEnglishCloze && clozeSent && !new RegExp( `(^${notJa}
|

${notJa}$)`,