Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Export assignment isWriteOnlyProperty

  • isWriteOnlyProperty(value: any, property: any): boolean
  • Tests if an object's own property is write-only.

    Parameters

    • value: any

      value to test

    • property: any

      property to test

    Returns boolean

    boolean indicating if an object property is write-only

    Example

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