chore(i18n,curriculum): processed translations (#42897)

This commit is contained in:
camperbot
2021-07-17 16:01:27 +05:30
committed by GitHub
parent 49021a0f46
commit cd70669795
20 changed files with 168 additions and 208 deletions

View File

@@ -101,19 +101,11 @@ assert(
`handleSubmit` 应该调用 `event.preventDefault`
```js
const handleSubmit = MyForm.prototype.handleSubmit.toString();
const allMatches = handleSubmit.match(/\bevent\.preventDefault\(\s*?\)/g) ?? [];
const blockCommented = handleSubmit.match(
/\/\*.*?\bevent\.preventDefault\(\s*?\).*?\*\//gs
);
const lineCommented = handleSubmit.match(
/\/\/.*?\bevent\.preventDefault\(\s*?\)/g
);
const commentedMatches = [...(blockCommented ?? []), ...(lineCommented ?? [])];
assert(
// At least one event.preventDefault() call exists and is not commented out
allMatches.length > commentedMatches.length
__helpers.isCalledWithNoArgs(
'event.preventDefault',
MyForm.prototype.handleSubmit.toString()
)
);
```