This package has been deprecated

Author message:

moved to https://www.npmjs.com/package/active-lodash

@eins78/active-lodash

0.0.1 • Public • Published

active-lodash

NPM version Build Status Coveralls Status Dependency Status

A version of lodash customized to feel more like Ruby/Rails/ActiveSupport.

Features

  • custom, reduced, modern build of lodash

  • non-destructive merge, assign, extend, etc.
    (They are always returning a new object)

  • present() and presence()

  • Does not extend prototypes.
    (If you want that, have a look at rodash or activesupport)

  • <your idea here>

Install

npm i -D @eins78/active-lodash

Usage

import f from '@eins78/active-lodash'

or

var f = require('@eins78/active-lodash')

then

assert.equal((f(23).presence() || 42), 23)
assert.equal((f(null).presence() || 42), 42)

assert.equal(f.present({a: 1}), true)
assert.equal(f.present([1]), true)
assert.equal(f.present(true), true)
assert.equal(f.present(false), true)
assert.equal(f.present(function () {}), true)

assert.equal(f.present({}), false)
assert.equal(f.present([]), false)
assert.equal(f.present(undefined), false)
assert.equal(f.present(null), false)

(See tests for more Examples.)

License

CC-0 © Max F. Albrecht

Package Sidebar

Install

npm i @eins78/active-lodash

Weekly Downloads

1

Version

0.0.1

License

CC0-1.0

Last publish

Collaborators

  • eins78