Skip to content

Commit

Permalink
Convert mod.utilities from a method to a function.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieMcKinstry committed Nov 11, 2022
1 parent f0b3513 commit 59e583b
Show file tree
Hide file tree
Showing 60 changed files with 99 additions and 99 deletions.
6 changes: 3 additions & 3 deletions pkg/codegen/nodejs/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -1581,13 +1581,13 @@ func (mod *modContext) sdkImportsWithPath(nested, utilities bool, dirpath string
}
// Add utility imports if enabled.
if utilities {
imports = append(imports, mod.utilitiesImport(relRoot))
imports = append(imports, utilitiesImport(relRoot))
}

return imports
}

func (mod *modContext) utilitiesImport(relRoot string) string {
func utilitiesImport(relRoot string) string {
return fmt.Sprintf("import * as utilities from \"%s/utilities\";", relRoot)
}

Expand Down Expand Up @@ -2236,7 +2236,7 @@ func (mod *modContext) genIndex(exports []fileInfo) string {
imports = mod.sdkImports(false, true)
} else if len(children) > 0 || len(mod.functions) > 0 {
// Even if there are no resources, exports ref utilities.
imports = append(imports, mod.utilitiesImport(mod.getRelativePath()))
imports = append(imports, utilitiesImport(mod.getRelativePath()))
}
mod.genHeader(w, imports, nil, nil)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"baseUrl": ".",
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
Expand All @@ -12,7 +12,7 @@
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["*"]
"@/*": ["*"]
},
"strict": true
},
Expand Down

0 comments on commit 59e583b

Please sign in to comment.