Sha256: 008a1dc49357214f9d9538a879d75189c9e85674ab3eb1d71af6d2e0884dc8a3
Contents?: true
Size: 710 Bytes
Versions: 15
Compression:
Stored size: 710 Bytes
Contents
describe('_', function() { it('can process a single item through _.mapIfArray', function() { var item = {}; var result = _.mapIfArray(item, function(item) { return item; }); expect(result).toEqual(item); }); it('can process an array through _.mapIfArray', function() { var items = [{name: 'mapMany1'}, {name: 'mapMany2'}]; var result = _.mapIfArray(items, function(item) { return item.name; }); expect(result).toEqual(['mapMany1', 'mapMany2']); }); it('can strip null values from an object with _.compactObject', function() { var testObject = {a: 1, b: null, c: 2, d: null}; expect(_.compactObject(testObject)).toEqual({a: 1, c: 2}); }); });
Version data entries
15 entries across 15 versions & 1 rubygems