How to use the propIs function from ramda

Find comprehensive JavaScript ramda.propIs code examples handpicked from public code repositorys.

3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
 * @param {*} obj
 * @return {Boolean}
 * @see R.is, R.propSatisfies
 * @example
 *
 *      R.propIs(Number, 'x', {x: 1, y: 2});  //=> true
 *      R.propIs(Number, 'x', {x: 'foo'});    //=> false
 *      R.propIs(Number, 'x', {});            //=> false
 */
var propIs = _curry3(function propIs(type, name, obj) {
fork icon0
star icon0
watch icon0

+ 53 other calls in file

5
6
7
8
9
10
11
12
13
14
15
16
const isValidURL = and([R.is(String), testRegex(/^https?:\/\//ig)]);


const isValidDomain = and([R.is(String), testRegex(/^(([a-z0-9-]+)\.)+[a-z]+$/ig)]);


const validateCnameRecord = type => and([
  R.propIs(String, type),
  R.compose(withLengthEq(1), R.keys), // CNAME cannot be used with any other record
  R.propSatisfies(withLengthGte(4), type),
  R.propSatisfies(isValidDomain, type),
]);
fork icon0
star icon0
watch icon0

+ 5 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)