Skip to content

Commit

Permalink
review fixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Mar 26, 2021
1 parent 316ac30 commit 528dbb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gulpfile.mjs
Expand Up @@ -162,7 +162,7 @@ function generateStandalone() {
let allList = "";

for (const plugin of pluginConfig) {
const camelPlugin = plugin.replace(/-([a-z])/g, c =>
const camelPlugin = plugin.replace(/-[a-z]/g, c =>
c[1].toUpperCase()
);
imports += `import ${camelPlugin} from "@babel/plugin-${plugin}";`;
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-types/src/converters/valueToNode.ts
Expand Up @@ -32,7 +32,7 @@ export default valueToNode as {
(value: unknown): t.Expression;
};

function isRegExp(value): boolean {
function isRegExp(value): value is RegExp {
return Object.prototype.toString.call(value) === "[object RegExp]";
}

Expand Down Expand Up @@ -84,7 +84,7 @@ function valueToNode(value: unknown): t.Expression {

// regexes
if (isRegExp(value)) {
const pattern = (value as RegExp).source;
const pattern = value.source;
const flags = value.toString().match(/\/([a-z]+|)$/)[1];
return regExpLiteral(pattern, flags);
}
Expand Down

0 comments on commit 528dbb6

Please sign in to comment.