Skip to content

Commit 3739b68

Browse files
committed
improve whitespaces and formatting in js
1 parent 35ddfdb commit 3739b68

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

templates/cli/lib/type-generation/languages/javascript.js.twig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ class JavaScript extends LanguageMeta {
6262
}
6363

6464
getTemplate() {
65-
return `
66-
// This file is auto-generated by the Appwrite CLI.
67-
// You can regenerate it by running \`appwrite types -l <%- strict ? '--strict ' : '' %>js <%- path %>\`.
68-
69-
/**
65+
return `/**
7066
* @typedef {import('${this._getAppwriteDependency()}').Models.Document} Document
7167
*/
7268

69+
// This file is auto-generated by the Appwrite CLI.
70+
// You can regenerate it by running \`appwrite types -l <%- strict ? '--strict ' : '' %>js <%- path %>\`.
71+
7372
<% for (const collection of collections) { -%>
7473
<% for (const attribute of collection.attributes) { -%>
7574
<% if (attribute.format === 'enum') { -%>
@@ -80,14 +79,15 @@ class JavaScript extends LanguageMeta {
8079
<% } -%>
8180
<% } -%>
8281
<% } -%>
83-
<% for (const collection of collections) { %>/**
82+
<% for (const [index, collection] of Object.entries(collections)) { %>/**
8483
* @typedef {Document & {
8584
<% for (const attribute of collection.attributes) { -%>
8685
* <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %>;
8786
<% } -%>
8887
* }} <%- toPascalCase(collection.name) %>
8988
*/
90-
89+
<% if (index < collections.length - 1) { %>
90+
<% } -%>
9191
<% } %>`;
9292
}
9393

0 commit comments

Comments
 (0)