Skip to main content
Module

x/rambda/props.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { _isArray } from './_internals/_isArray'import { mapArray } from './map'
export function props(propsToPick, obj){ if (arguments.length === 1){ return _obj => props(propsToPick, _obj) } if (!_isArray(propsToPick)){ throw new Error('propsToPick is not a list') }
return mapArray(prop => obj[ prop ], propsToPick)}