Browse Source

update scripts

main
parent
commit
7730257557
2 changed files with 14 additions and 0 deletions
  1. +12
    -0
      scripts/wk-api/test.ts
  2. +2
    -0
      src/wanikani.ts

+ 12
- 0
scripts/wk-api/test.ts View File

@ -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();
}

+ 2
- 0
src/wanikani.ts View File

@ -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}<br/?>|<br/?><br/?>${notJa}$)`,

Loading…
Cancel
Save