swc/crates/swc_ecma_minifier/tests/full/next-30498/1/output.js
Donny/강동윤 19ce2737b1
feat(es/minifier): Collapse let without init (#5909)
**Description:**

This patch applies the variable collapsing logic for the variables declared with `var` to the variables declared with `let`. This requires some patch about the behavior of visitors about `BlockStmt`, so this patch includes relevant changes.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5696.
2022-09-21 15:04:29 +00:00

2 lines
379 B
JavaScript

export function string_create(){return new StringSchema}export class StringSchema extends BaseSchema{matches(e,t){let s,r,a=!1;return t&&("object"==typeof t?{excludeEmptyString:a=!1,message:s,name:r}=t:s=t),this.test({name:r||"matches",message:s||string.matches,params:{regex:e},test:t=>isAbsent(t)||""===t&&a||-1!==t.search(e)})}}string_create.prototype=StringSchema.prototype;