Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / chain-able / test / fp / pluck.js
Size: Mime:
const pluck = require('../../src/deps/loop/fantasy/pluck')

describe.skip('pluck', function() {
  var people = [
    {name: 'Fred', age: 23},
    {name: 'Wilma', age: 21},
    {name: 'Pebbles', age: 2},
  ]

  it('returns a function that maps the appropriate property over an array', function() {
    var nm = R.pluck('name')
    eq(typeof nm, 'function')
    eq(nm(people), ['Fred', 'Wilma', 'Pebbles'])
  })

  it.skip('behaves as a transducer when given a transducer in list position', function() {
    var numbers = [{a: 1}, {a: 2}, {a: 3}, {a: 4}]
    var transducer = R.compose(R.pluck('a'), R.map(R.add(1)), R.take(2))
    eq(R.transduce(transducer, R.flip(R.append), [], numbers), [2, 3])
  })
})