@kingjs/reflect.define-field
v1.0.0
Published
Constrains `kingjs/reflect.define-property` to a single overload for declaring a field.
Downloads
2
Readme
@kingjs/reflect.define-field
Constrains kingjs/reflect.define-property
to a single overload for declaring a field.
Usage
var assert = require('assert');
var defineField = require('@kingjs/reflect.define-field');
var target = defineField({ }, 'foo', { value: 1 })
assert.deepEqual(target.foo, { value: 1 });
API
defineAccessor(target, name, value)
Overloads
defineField(target, name, value)
=> defineProperty(target, name, { value });
Parameters
target
: The target on which the property will be defined.name
: The name of the property.value
: The value of the field.
Install
With npm installed, run
$ npm install @kingjs/reflect.define-field
Dependencies
|Package|Version|
|---|---|
|@kingjs/reflect.define-property
|^1.0.2
|
Source
https://repository.kingjs.net/reflect/define-field
License
MIT