mirror of
https://github.com/swc-project/swc.git
synced 2024-12-02 12:05:54 +03:00
19ce2737b1
**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.
2 lines
379 B
JavaScript
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;
|