Skip to content

Better support for custom directives #825

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rwysocki-equinix
Copy link

  • Add support for directives without arguments like @required()
  • Add support for custom directive mapping

Closes #422 , #781

* Add support for directives without arguments like `@required()`
* Add support for custom directive mapping

Closes Code-Hex#422, Code-Hex#781
Comment on lines -47 to -74
describe('formatDirectiveObjectArguments', () => {
const cases: {
name: string
arg: DirectiveObjectArguments
want: FormattedDirectiveObjectArguments
}[] = [
{
name: 'normal',
arg: {
uri: 'url',
email: 'email',
},
want: {
uri: ['url', '$2'],
email: ['email', '$2'],
},
},
{
name: 'contains array',
arg: {
startWith: ['matches', '/^$2/'],
email: 'email',
},
want: {
startWith: ['matches', '/^$2/'],
email: ['email', '$2'],
},
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is important to maintain backward compatibility. Where have these test cases gone? I would like to see them restored if possible.

Copy link
Owner

@Code-Hex Code-Hex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the direction is good and it would be helpful if you could respond to the comments.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow functions in directive parameters
2 participants