1.0.2 • Published 6 years ago

@kingjs/descriptor.clear v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@kingjs/descriptor.clear

Returns a descriptor with a named property removed.

Usage

Remove the property 'x' like this:

var clear = require('@kingjs/descriptor.clear');

var descriptor = { x:0 };
clear.call(descriptor, 'x');

result:

{ }

API

declare function clear(
  this: Descriptor,
  name: string
): Descriptor

Interfaces

Parameters

  • this: The descriptor from which property 'name' will be removed.
  • name: The name of the property to be removed.

Returns

Returns a descriptor with property name removed. A copy is returned if the descriptor has an inherited property name or the descriptor is frozen.

Install

With npm installed, run

$ npm install @kingjs/descriptor.clear

License

MIT

Analytics