update scripts

This commit is contained in:
polv committed 2022-05-13 08:24:25 +07:00
1 parent baa5bc091e
commit 7730257557
2 files changed
+14

No files matched your search

+12
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
View File
@@ -416,6 +416,7 @@ export class WaniKani {
sentenceCloze?: string; sentenceCloze?: string;
}, },
opts: { opts: {
prependEnglishCloze?: boolean;
overwrite?: boolean; overwrite?: boolean;
} = {}, } = {},
) { ) {
@@ -504,6 +505,7 @@ export class WaniKani {
const notJa = '[^\\p{sc=Han}\\p{sc=Katakana}\\p{sc=Hiragana}]+'; const notJa = '[^\\p{sc=Han}\\p{sc=Katakana}\\p{sc=Hiragana}]+';
if ( if (
opts.prependEnglishCloze &&
clozeSent && clozeSent &&
!new RegExp( !new RegExp(
`(^${notJa}<br/?>|<br/?><br/?>${notJa}$)`, `(^${notJa}<br/?>|<br/?><br/?>${notJa}$)`,