Skip to content

Commit 392ecb7

Browse files
committed
stricter regex for 'package.json'
1 parent 341f009 commit 392ecb7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func regexReplaceAppNameInManifest(src []byte, appName string) []byte {
162162

163163
// regexReplaceAppNameInPackageJSON replaces the top-level "name" field in a package.json file
164164
func regexReplaceAppNameInPackageJSON(src []byte, appName string) []byte {
165-
re := regexp.MustCompile(`(?m)^(\s*"name"\s*:\s*")([^"]*)(")`)
165+
re := regexp.MustCompile(`(?m)^(\s{2}"name"\s*:\s*")([^"]*)(")`)
166166
loc := re.FindSubmatchIndex(src)
167167
if loc == nil {
168168
return src

0 commit comments

Comments
 (0)