Skip to content

Added any.label method#440

Closed
agraddy wants to merge 2 commits intohapijs:masterfrom
agraddy:any-label
Closed

Added any.label method#440
agraddy wants to merge 2 commits intohapijs:masterfrom
agraddy:any-label

Conversation

@agraddy
Copy link

@agraddy agraddy commented Sep 21, 2014

Added any.label() method as described in #414.

It looked like language.root value was already available in the error message, but it was just not taking precedence over the original key. I changed the order from this:

var localized = this.options.language;
this.context.key = this.context.key || localized.root || Language.errors.root;

To this:

var localized = this.options.language;
this.context.key = localized.root || this.context.key || Language.errors.root;

I then added the any.label() method as a convenience method. I believe it should be set up so that language.root takes precedence over any.label().

@agraddy agraddy mentioned this pull request Sep 21, 2014
@phated
Copy link
Contributor

phated commented Sep 30, 2014

Just ran up against this. Would like to see something like this land.

@Marsup Marsup self-assigned this Nov 5, 2014
@Marsup Marsup added the feature New functionality or improvement label Nov 5, 2014
@Marsup Marsup added this to the 4.8.0 milestone Nov 5, 2014
@Marsup
Copy link
Collaborator

Marsup commented Nov 5, 2014

This is merged. I reworked the readme a bit because Joi.firstName() doesn't exist yet ;)
Sorry for the delay, I'm still catching up on all the issues.

@Marsup Marsup closed this Nov 5, 2014
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants