Skip to content

Commit a0e72e8

Browse files
PatMyronkddejong
andauthored
Recognize templates with only Registry types (#201)
* Recognize templates with Registry types #99 https://github.com/aws-cloudformation/cloudformation-resource-schema/#resource-type-name * tightening regular expression pattern Co-authored-by: Kevin DeJong <[email protected]>
1 parent b4561e6 commit a0e72e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ function isCloudFormation(template: string, filename: string): Boolean {
145145
return true;
146146
}
147147
if (/\n?"?Resources"?\s*:/.exec(template)) {
148-
if (/"?Type"?\s*:\s*"?'?(AWS|Alexa|Custom)::/.exec(template)) {
148+
if (/"?Type"?\s*:\s*"?'?[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}/.exec(template)) {
149149
// filter out serverless.io templates
150150
if (!(/\nresources:/.exec(template) && /\nprovider:/.exec(template))) {
151151
connection.console.log("Determined this file is a CloudFormation Template. " + filename +
152-
". Found 'Resources' and 'Type: (AWS|Alexa|Custom)::'");
152+
". Found 'Resources' and 'Type: [a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}'");
153153
return true;
154154
}
155155
}

0 commit comments

Comments
 (0)