Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-readable-property/docs/types/index.d"

Index

Functions

Functions

Export assignment isReadableProperty

  • isReadableProperty(value: any, property: any): boolean
  • Tests if an object's own property is readable.

    Parameters

    • value: any

      value to test

    • property: any

      property to test

    Returns boolean

    boolean indicating if an object property is readable

    Example

    var defineProperty = require( `@stdlib/utils/define-property` );
    
    var obj = {
        'boop': true
    };
    
    function setter( v ) {
        obj.boop = v;
    }
    
    defineProperty( obj, 'beep', {
        'configurable': false,
        'enumerable': false,
        'set': setter
    });
    
    var bool = isReadableProperty( obj, 'boop' );
    // returns true
    
    bool = isReadableProperty( obj, 'beep' );
    // returns false