Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Export assignment isWritablePropertyIn

  • isWritablePropertyIn(value: any, property: any): boolean
  • Tests if an object's own or inherited property is writable.

    Parameters

    • value: any

      value to test

    • property: any

      property to test

    Returns boolean

    boolean indicating if an object property is writable

    Example

    var defineProperty = require( `@stdlib/utils/define-property` );
    
    var obj = {
        'boop': true
    };
    
    defineProperty( obj, 'beep', {
        'configurable': false,
        'enumerable': false,
        'writable': false,
        'value': 'beep'
    });
    
    var bool = isWritablePropertyIn( obj, 'boop' );
    // returns true
    
    bool = isWritablePropertyIn( obj, 'beep' );
    // returns false