Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid JavaScript is generated when using Index Signatures #1179

Closed
colinaaa opened this issue Jul 25, 2024 · 2 comments
Closed

Invalid JavaScript is generated when using Index Signatures #1179

colinaaa opened this issue Jul 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@colinaaa
Copy link

Bug Report

📝 Summary

Write a short summary of the bug in here.

  • Typia Version: 6.5.3
  • Expected behavior: Create a valid JavaScript
  • Actual behavior: Create an invalid JavaScript with SyntaxError

When using typia with Index Signatures, invalid JavaScript is generated:

                        "string" === typeof value[0] || $report(_exceptionable, {
                            path: _path + $join(key[0]",
                            expected: "string",
                            value: value[0]
                        })

⏯ Playground Link

https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGcAHYwCmUGqAxrXAGIQRwDeZccYVDAAWAZwD8ALh59+cANpYc00TCjUA5gF1p81eqrby-AL7kTFJhCqq4AN1QAbYABMhtaQApqYAK4xpXyoAayoIAHcqAEo4AF4APgRkNAA6AEkANSdXIWBrAB4OCETY2UJUpihadyznNzoAUQBHXydRQs54zyjyMisbCEdaFMcIDU9efgc69wAaMhMesiA

💻 Code occuring the bug

import typia from "typia";

interface Foo {
  paths?: {
    [from: string]: [string];
  };
}

const validate: (input: unknown) => typia.IValidation<Foo> =
  typia.createValidateEquals<Foo>();

console.log({
  validate,
});
@samchon samchon self-assigned this Jul 26, 2024
@samchon samchon added the bug Something isn't working label Jul 26, 2024
samchon added a commit that referenced this issue Jul 26, 2024
Fix #1179: tuple type in dynamic object case.
@samchon
Copy link
Owner

samchon commented Jul 26, 2024

Uprade to v6.5.5, then be fixed.

@colinaaa
Copy link
Author

Thank you @samchon. It works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants