@kingjs/descriptor.write

1.0.9 • Public • Published

@kingjs/descriptor.write

Writes a value to a descriptor, cloning descriptors if frozen.

Usage

Set a few properties on a descriptor like this.

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

var target = { foo: 0 };
write.call(target, 'bar', 0);

result:

{
  foo: 0,
  bar: 0,
}

API

declare function write(
  descriptor: Descriptor,
  name: string,
  value: any
): Descriptor

Interfaces

Parameters

  • this: The descriptor whose property will be updated.
  • name: The property to write.
  • value: The updated value.

Returns

Returns a clone of this with updated properties.

Install

With npm installed, run

$ npm install @kingjs/descriptor.write

License

MIT

Analytics

Readme

Keywords

none

Package Sidebar

Install

npm i @kingjs/descriptor.write

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

3.23 kB

Total Files

4

Last publish

Collaborators

  • kingces95