diff options
author | 2022-08-11 23:33:05 +0000 | |
---|---|---|
committer | 2022-08-11 23:33:05 +0000 | |
commit | 52068e2644dd417f92fa1c0e527817e5f761f29f (patch) | |
tree | 6e3c54a3c64eb76468c73c681c6e7ca0325c85c1 | |
parent | 7127b1bb35ca4e8f419e18683e380a4917eca4bb (diff) | |
download | astro-52068e2644dd417f92fa1c0e527817e5f761f29f.tar.gz astro-52068e2644dd417f92fa1c0e527817e5f761f29f.tar.zst astro-52068e2644dd417f92fa1c0e527817e5f761f29f.zip |
[ci] format
Diffstat (limited to '')
-rw-r--r-- | packages/astro/src/core/add/index.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/astro/src/core/add/index.ts b/packages/astro/src/core/add/index.ts index 25f0b0c83..a9152654e 100644 --- a/packages/astro/src/core/add/index.ts +++ b/packages/astro/src/core/add/index.ts @@ -302,17 +302,17 @@ async function parseAstroConfig(configURL: URL): Promise<t.File> { // - @npm/thingy => npmThingy // - @jane/foo.js => janeFoo const toIdent = (name: string) => { - const ident = name - .trim() + const ident = name + .trim() // Remove astro or (astrojs) prefix and suffix - .replace(/[-_\.]?astro(?:js)?[-_\.]?/g, '') + .replace(/[-_\.]?astro(?:js)?[-_\.]?/g, '') // drop .js suffix - .replace(/\.js/, '') + .replace(/\.js/, '') // convert to camel case - .replace(/(?:[\.\-\_\/]+)([a-zA-Z])/g, (_, w) => w.toUpperCase()) + .replace(/(?:[\.\-\_\/]+)([a-zA-Z])/g, (_, w) => w.toUpperCase()) // drop invalid first characters - .replace(/^[^a-zA-Z$_]+/, ''); - return `${ident[0].toLowerCase()}${ident.slice(1)}`; + .replace(/^[^a-zA-Z$_]+/, ''); + return `${ident[0].toLowerCase()}${ident.slice(1)}`; }; function createPrettyError(err: Error) { |