We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const NameType = new Archetype({ first: { $type: 'string' }, last: { $type: 'string' } }).compile('NameType'); const Params = new Archetype({ names: { $type: [{ $type: NameType, $transform: JSON.parse }], $default: [] } }).compile('Params'); app.get('/', function(req, res) { const { names } = new Params(req.query); res.json(names.map(n => `${n.first} ${n.last}`).join(',')); }); run().catch(error => console.error(error)); async function run() { await app.listen(3000); const root = 'http://localhost:3000'; const names = [ { first: 'James', last: 'Kirk' }, { first: 'Leonard', last: 'McCoy' } ]; console.log(await superagent.get(`${root}`).then(res => res.text)); console.log(await superagent.get(`${root}?names=${JSON.stringify(names[0])}`).then(res => res.text)); let url = `${root}?names=${JSON.stringify(names[0])}&names=${JSON.stringify(names[1])}`; console.log(await superagent.get(url).then(res => res.text)); }
The text was updated successfully, but these errors were encountered:
test(unmarshal): repro #13
c6a2eaa
78bc272
No branches or pull requests
The text was updated successfully, but these errors were encountered: