Closed
Description
Would be good to make that we can define aliases in the constructor options. The reason is that we can set it in ServiceBroker options of Moleculer.
Proposal:
const v = new Validator({
aliases: {
username: {
type: 'string',
min: 4,
max: 30
},
password: {
type: 'string',
min: 6,
max: 100,
empty: false
}
}
});
And I will change the Moleculer side and we can use it as
//moleculer.config.js
module.exports = {
nodeID: "node-100",
validator: {
type: "FastestValidator",
options: {
useNewCustomCheckerFunction: true,
aliases: { ... },
defaults: { ... },
messages: { ... }
}
}
}