racker/node-swiz — pull request #23 by rphillips (2012-08-12 21:14:26+00:00)
Title: add hash element limit

This allows us to set a limit on the number of keys in a hash:

C().isHash(C().optional().isString(), C().isString(), 2).numItems(1, 5)

The snippet allows for {'a': 'a'}, { 'a': 'a', 'b': 'b' }, but not {'a' : 'a', 'b' : 'b', 'c' : 'c'}