Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment isDataProperty

  • isDataProperty(value: any, property: any): boolean
  • Tests if an object's own property has a data descriptor.

    Parameters

    • value: any

      value to test

    • property: any

      property to test

    Returns boolean

    boolean indicating if an object property has a data descriptor

    Example

    var defineProperty = require( `@stdlib/utils/define-property` );
    
    var obj = {
        'boop': true
    };
    
    function getter() {
        return 'beep';
    }
    
    defineProperty( obj, 'beep', {
        'configurable': false,
        'enumerable': false,
        'get': getter
    });
    
    var bool = isDataProperty( obj, 'boop' );
    // returns true
    
    bool = isDataProperty( obj, 'beep' );
    // returns false