Skip to content

Commit

Permalink
Ensure pascal case used for node enums
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Jan 15, 2024
1 parent 839559c commit 46f9a5a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/SDK/Language/Deno.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,4 @@ public function getParamExample(array $param): string

return $output;
}

public function getFilters(): array
{
return [
new TwigFilter('caseEnumKey', function (string $value) {
return $this->toPascalCase($value);
}),
];
}
}
2 changes: 1 addition & 1 deletion src/SDK/Language/JS.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function getFilters(): array
{
return [
new TwigFilter('caseEnumKey', function (string $value) {
return $this->toUpperSnakeCase($value);
return $this->toPascalCase($value);
}),
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/SDK/Language/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function getName(): string

/**
* @param array $parameter
* @param array $nestedTypes
* @param array $spec
* @return string
*/
public function getTypeName(array $parameter, array $spec = []): string
Expand Down
2 changes: 1 addition & 1 deletion tests/languages/node/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function start() {
response = await general.upload('string', 123, ['string in array'], appwrite.InputFile.fromBuffer(buffer, 'large_file.mp4'))
console.log(response.result);

response = await general.enum(MockType.first);
response = await general.enum(MockType.First);
console.log(response.result);

try {
Expand Down

0 comments on commit 46f9a5a

Please sign in to comment.