// Find an element
// -- throws an exception unless results.length !== 1
find('string')
// Find any/all elements
// -- finds any number of elements (including 0)
// -- could be used by the find function
findAll('string')
// Find a specific number of elements
// -- throws an exception unless results.length == number
find(3, 'string')
// alternatively
find('string', {length: 3})
I believe this would remove the necessity for tryfind, as you could just do a findAll. This loosely borrows it's behavior/syntax from ActiveRecord, where find() will throw an exception or return 1 element and find_all just returns any number of elements and doesn't throw an exception in any case.
Proposed functionality for find/findAll:
I believe this would remove the necessity for tryfind, as you could just do a findAll. This loosely borrows it's behavior/syntax from ActiveRecord, where find() will throw an exception or return 1 element and find_all just returns any number of elements and doesn't throw an exception in any case.