未验证 提交 5c1ff815 编写于 作者: A Alex Dima

Avoid lookbehind (not supported in Safari)

上级 b71972bb
......@@ -159,7 +159,7 @@ steps:
set -e
yarn test-browser --build --browser chromium --browser webkit --browser firefox --tfs "Browser Unit Tests"
displayName: Run unit tests (Browser)
timeoutInMinutes: 10
timeoutInMinutes: 5
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
......
......@@ -1056,7 +1056,11 @@ export class SnakeCaseAction extends AbstractCaseAction {
}
protected _modifyText(text: string, wordSeparators: string): string {
return text.replace(/(?<=\p{Ll})(\p{Lu})|(?<!\b|_)(\p{Lu})(?=\p{Ll})/gmu, '_$&').toLocaleLowerCase();
return (text
.replace(/(\p{Ll})(\p{Lu})/gmu, '$1_$2')
.replace(/([^\b_])(\p{Lu})(\p{Ll})/gmu, '$1_$2$3')
.toLocaleLowerCase()
);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册