open-index/open-npm huggingface dataset:
npm package: @kingjs/poset.for-each
Description: Perform a depth first walk of a poset expressed as an adjacency list.
Author: Chris King
Latest version: 1.0.14

# @[kingjs](https://www.npmjs.com/package/kingjs)/[poset](https://www.npmjs.com/package/@kingjs/poset).for-each
Invokes a callback on vertices of a poset such that dependent vertices are called back first.
## Usage
Given a [poset](https://en.wikipedia.org/wiki/Partially_ordered_set) where `'a'` depends on `'b'` and `'c'` which, in turn, both depend on `'d'` generate a total ordering like this:
```js
var forEach = require('@kingjs/poset.for-each');

//    a
//   / \
//  b   c
//   \ /
//    d
var poset = {
  a: [ 'b', 'c' ],
  b: [ 'd' ],
  c: [ 'd' ]
};

var totalOrder = [];

forEach.call(poset, function(vertex) {
  totalOrder.push(vertex);
});

totalOrder;
```
result:
```js
[ 'd', 'b', 'c', 'a' ] 
// or
[ 'd', 'c', 'b', 'a' ]
```
## API
```ts
declare function forEach(
  this: AdjacencyList,
  action: (vertex) => void,
  roots?: string | string[]
)
```
### Interfaces
- `AdjacencyList`: see [@kingjs/poset][poset]
### Parameters
- `this`: A poset expressed as an descriptor where each property represents a named vertex and each property value is an array of strings each representing the name of adjacent vertices. 
- `action`: Action to take when visiting a vertex.
  - `vertex`: The name of the vertex being visited.
- `roots`: The vertex or vertices from which to commence the traversal. If none are provided, all vertices are used as roots. 
## Remarks
If a cycle is detected, then an exception is thrown listing the vertices involved in the cycle.

Algorithm will _randomly_ decide the direction to traverse the adjacency vertices. This helps callers ensure they only rely on dependencies defined in the adjacency list and not on dependencies  that are artifacts of its expression. This is why the example in the usage section may generate two different results.  
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/poset.for-each
```
## License
MIT

![Analytics](https://analytics.kingjs.net/poset/for-each)

  [poset]: https://www.npmjs.com/package/@kingjs/poset
  [adjacency list]:(https://en.wikipedia.org/wiki/Adjacency_list
npm package: @kingjs/poset.inherit
Description: Inherits properties of dependent vertices.
Author: Chris King
Latest version: 1.0.11

# @[kingjs](https://www.npmjs.com/package/kingjs)/[poset](https://www.npmjs.com/package/@kingjs/poset).inherit
Inherits properties of dependent vertices.
## Usage
Create descriptors of the tire counts of `car`, `truck`, and `bigRig` by inheriting common properties from `vehicle` like this:

```js
var inherit = require('@kingjs/poset.inherit');
var decode = require('@kingjs/poset.decode');

var decodeAndInherit = function(encodedPoset) {
  var vertices = { };
  var poset = decode.call(encodedPoset, vertices);
  return inherit.call(poset, vertices);
}

var vehicleDescriptors = {
  car$vehicle: { },
  truck$vehicle: { },
  bigRig$vehicle: { tires: 18 },
  vehicle: { tires: 4 }
};

decodeAndInherit(vehicleDescriptors);
```
result:
```js
{
  car: { tires: 4 },
  truck: { tires: 4 },
  bigRig: { tires: 18 },
  vehicle: { tires: 4 }
}
```
Given a [poset](https://en.wikipedia.org/wiki/Partially_ordered_set) composed of vertex 
- `'A'` with property `'a'` that depends on 
- `'B'` and `'C'` with properties `'b'` and `'c'` respectively and which both depend on 
- `'D'` with property `'d'`.

Assume all properties have value `0`. Now, 
- have `'B'` and `'C'` inherit `'D'`'s properties and 
- `'A'` inherit `'B'` and `'C'`'s properties
  - as well as `'D'`'s properties transitively, 

like this:
```js
var inherit = require('@kingjs/poset.inherit');
var decode = require('@kingjs/poset.decode');

var decodeAndInherit = function(encodedPoset) {
  var vertices = { };
  var poset = decode.call(encodedPoset, vertices);
  return inherit.call(poset, vertices);
}

//     A={a:0}             A={a:0,b:0,c:0,d:0}
//     /     \                   /     \
// B={b:0}  C={c:0}  ->  B={b:0,d:0}  C={c:0,d:0}
//     \     /                   \     /
//     D={d:0}                   D={d:0}
decodeAndInherit({
  A$B$C: { a:0 },
  B$D: { b:0 },
  C$D: { c:0 },
  D: { d:0 },
});
```
result:
```js
{
  A: { a:0, b:0, c:0, d:0 },
  B: { b:0, d:0 },
  C: { c:0, d:0 },
  D: { d:0 }
}
```
## API
```ts
declare function(
  this: AdjacencyList,
  vertices: VertexProperties
): any
```
### Interfaces
- `AdjacencyList`: see [@kingjs/poset][poset]
- `VertexProperties`: see [@kingjs/poset][poset]
### Parameters
- `this`: A descriptor whose every property represents a vertex and whose value is an array of strings representing the vertex's adjacent vertices.
- `vertices`: A descriptor whose every property represents a vertex and whose value represents the properties associated with the vertex.
### Returns
A descriptor with a property for each vertex whose value is a descriptor which inherits the properties of its dependent vertices. 
## Remarks
Throws if inherited properties that share the same name do not also have the same value.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/poset.inherit
```
## License
MIT

![Analytics](https://analytics.kingjs.net/poset/inherit)

  [poset]: https://en.wikipedia.org/wiki/Partially_ordered_set
npm package: @kingjs/property-descriptor.construct-accessor
Description: Construct an object `{ target, name, descriptor: { get, set } }` where `name`, `get`, and `set` are harvested from named functions, or  are passed separately as a string and functions, or as a string and an object.
Latest version: 1.0.0
Deprecated: see @kingjs/reflect.define-accessor

# @[kingjs][@kingjs]/[property-descriptor][ns0].[construct-accessor][ns1]
Construct an object `{ target, name, descriptor: { get, set } }` where `name`, `get`, and `set` are harvested from named functions, or  are passed separately as a string and functions, or as a string and an object.
## Usage
```js
var constructAccessor = require('@kingjs/property-descriptor.construct-accessor');
var assert = require('assert')

var target = { };
var get = function foo() { }
var set = function foo() { }
var bar = 'bar';

function assertConstruction(construction, expectedName) {
  var { target, name, descriptor } = construction;
  assert(target == target);
  assert(name == expectedName);
  assert(descriptor.get == get);
  assert(descriptor.set == set);
}

// 1. Named Functions
// constructAccessor(target, namedGetter, namedSetter)
var construction = constructAccessor(target, get, set);
assertConstruction(construction, get.name);

// 2. Name + Anonymous Functions
// constructAccessor(target, name, getter, setter)
var construction = constructAccessor(target, bar, get, set);
assertConstruction(construction, bar);

// 3. Descriptor Composed of Named Functions
// constructAccessor(target, { namedGetter, namedSetter })
var construction = constructAccessor(target, { get, set });
assertConstruction(construction, get.name);

// 4. Name + Descriptor Composed of Anonymous Functions
// constructAccessor(target, name, { getter, setter })
var construction = constructAccessor(target, bar, { get, set });
assertConstruction(construction, bar);

```

## API
```ts
constructAccessor(target, x[, y[, z]])
```
### Parameters
- `target`: The target on which the property will be declared.
- `x`: See the example for a list of overrides.
- `y`: See the example for a list of overrides.
- `z`: See the example for a list of overrides.
### Returns
An object with `{ target, name, descriptor: { value } }` properties where the descriptor properties are harvested from the arguments.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.construct-accessor
```
## Source
https://repository.kingjs.net/property-descriptor/construct-accessor
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/construct-accessor)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.construct-accessor
npm package: @kingjs/property-descriptor.construct-field
Description: Construct an object `{ target, name, descriptor: { value } }`.
Latest version: 1.0.0
Deprecated: see @kingjs/reflect.define-field

# @[kingjs][@kingjs]/[property-descriptor][ns0].[construct-field][ns1]
Construct an object `{ target, name, descriptor: { value } }`.
## Usage
```js
var assert = require('assert');
var createField = require('@kingjs/property-descriptor.construct-field');

function Type() { }
var value = 42; 

// construct/deconstruct a description of a property that acts like a field
var { target, name, descriptor } = createField(Type.prototype, 'field', value);
assert(target == Type.prototype);
assert(name == 'field');
assert(descriptor.value == value);

// define the property
Object.defineProperty(target, name, descriptor);
assert(target[name] == value);
```

## API
```ts
createField(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 property.
### Returns
An object `{ target, name, descriptor: { value } }` whose values correspond to their respective arguments.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.construct-field
```
## Source
https://repository.kingjs.net/property-descriptor/construct-field
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/construct-field)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.construct-field
npm package: @kingjs/property-descriptor.construct-property
Description: Construct an object `{ target, name, descriptor: { value } }` where name and value are harvested from a named function or are passed separately where if value is an object it's copied else it's is wrapped.
Latest version: 1.0.0
Deprecated: see @kingjs/reflect.define-property

# @[kingjs][@kingjs]/[property-descriptor][ns0].[construct-property][ns1]
Construct an object `{ target, name, descriptor: { value } }` where name and value are harvested from a named function or are passed separately where if value is an object it's copied else it's is wrapped.
## Usage
```js
var assert = require('assert')
var constructProperty = require('@kingjs/property-descriptor.construct-property');

function Type() { };
var prototype = Type.prototype;

// 1. Named Function
// constructProperty(target, namedFunction)
var myFunction = function myFunction() { };
var { target, name, descriptor } = constructProperty(
  prototype, myFunction
);
assert(target == prototype);
assert(name == 'myFunction');
assert(descriptor.value == myFunction);

// 2. Name + Non-Object Value
// constructProperty(target, name, [
//  undef|null|symbol|number|boolean|string|function
// ])
var { target, name, descriptor } = constructProperty(
  prototype, 'nonObject', true
);
assert(target == prototype);
assert(name == 'nonObject');
assert(descriptor.value === true);

// 3. Name + Object Value
// constructProperty(target, name, descriptor)
var { target, name, descriptor } = constructProperty(
  prototype, 'soTrue', { get: true }
);
assert(target == prototype);
assert(name == 'soTrue');
assert(descriptor.get === true);
```

## API
```ts
createProperty(target, x[, y])
```
### Parameters
- `target`: The target on which the property will be declared.
- `x`: See the example for a list of overrides.
- `y`: See the example for a list of overrides.
### Returns
An object with `{ target, name, descriptor: { value } }` properties where the descriptor properties are harvested from the arguments.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.construct-property
```
## Source
https://repository.kingjs.net/property-descriptor/construct-property
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/construct-property)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.construct-property
npm package: @kingjs/property-descriptor.create-alias
Description: Packages the a target, a name, and a descriptor that  is an alias of another accessor or function.
Latest version: 1.0.1
Deprecated: No replacement; Trivial

# @[kingjs][@kingjs]/[property-descriptor][ns0].[create-alias][ns1]
Packages the a target, a name, and a descriptor that  is an alias of another accessor or function.
## Usage
```js
var assert = require('assert');
var createAlias = require('@kingjs/property-descriptor.create-alias');

// alias a function; foo -> Foo
var { target, name, descriptor } = createAlias({ Foo: () => 0 }, 'foo', 'Foo', true);
assert(descriptor.value.name = 'foo -> Foo');
Object.defineProperty(target, name, descriptor);

// get Foo via foo
assert(target.foo() == 0);

// alias an accessor; bar -> Bar
var { target, name, descriptor } = createAlias({ Bar: 1 }, 'bar', 'Bar');
assert(descriptor.get.name = 'bar -> Bar');
assert(descriptor.set.name = 'bar -> Bar');
Object.defineProperty(target, name, descriptor);

// get Bar via bar
assert(target.bar == 1);

// set Bar via bar
target.bar = 2;
assert(target.Bar == 2);
```

## API
```ts
createAlias(target, alias, name[, isFunction])
```
### Parameters
- `target`: The target on which the property will be defined.
- `alias`: The alias.
- `name`: The name of the accessor or function being aliased.
- `isFunction`: True, if the alias target is a function.
### Returns
An object with properties `target`, `name`, and `descriptor`  which describes thunks to a property of the specified `name`.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.create-alias
```
## Source
https://repository.kingjs.net/property-descriptor/create-alias
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/create-alias)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.create-alias
npm package: @kingjs/property-descriptor.create-field
Description: Package target, name and a descriptor formed by wrapping value.
Latest version: 1.0.0
Deprecated: see @kingjs/property-descriptor.construct-field

# @[kingjs][@kingjs]/[property-descriptor][ns0].[create-field][ns1]
Package a target, a name and a descriptor formed by wrapping a value.
## Usage
```js
var assert = require('assert');
var createField = require('@kingjs/property-descriptor.create-field');

var value = 42; 
var { target, name, descriptor } = createField({ }, 'field', value);

Object.defineProperty(target, name, descriptor);
assert(target[name] == value);
```

## API
```ts
createField(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 property.
### Returns
An object with properties `target`, `name`, and `descriptor` which itself has a property `value` each with values corresponding to their respective arguments.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.create-field
```
## Source
https://repository.kingjs.net/property-descriptor/create-field
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/create-field)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.create-field
npm package: @kingjs/property-descriptor.create-from-context
Description: Package a target, a name, and a descriptor created by a callback using `name` and `target`.
Latest version: 1.0.2
Deprecated: No replacement; Trivial

# @[kingjs][@kingjs]/[property-descriptor][ns0].[create-from-context][ns1]
Package a target, a name, and a descriptor created by a callback using `name` and `target`.
## Usage
```js
var assert = require('assert');
var createFromContext = require('@kingjs/property-descriptor.create-from-context');

function Type() { };
Type.info = x => x.toUpperCase();;

function init(name, target) {
  var ctor = target.constructor;
  return { value: () => ctor.info(name) };
}

var { target, name, descriptor } = createFromContext(Type.prototype, 'foo', init);
Object.defineProperty(target, name, descriptor);
var instance = new Type();
assert(instance.foo() == 'FOO');
```

## API
```ts
createFromContext(target, name, callback(name, target))
```
### Parameters
- `target`: The target on which the property is defined.
- `name`: The name of property being described.
- `callback`: Returns a a descriptor given `name` and `target`.
  - `name`: The name of property being described.
  - `target`: The target on which the property is defined.
### Returns
An object with `target`, `name`, and `descriptor` properties where the descriptor is created by the callback using `name` and `target`.
### Remarks
The implementation is trivial but the concept of a property being completely defined by a name plus metadata attached to the target is quite powerful. It allows a mini declarative DSL to be created  and expressed as attributes attached to functions.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.create-from-context
```
## Source
https://repository.kingjs.net/property-descriptor/create-from-context
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/create-from-context)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.create-from-context
npm package: @kingjs/property-descriptor.create-property
Description: Returns an object with a target, a name, and a descriptor  which is created by harvesting argument overloads.
Latest version: 1.0.0

# @[kingjs][@kingjs]/[property-descriptor][ns0].[create-property][ns1]
Returns an object with a target, a name, and a descriptor  which is created by harvesting argument overloads.
## Usage
```js
var assert = require('assert')
var createProperty = require('@kingjs/property-descriptor.create-property');

function Type() { };
var prototype = Type.prototype;

// createProperty(target, namedFunction)
var myFunction = function myFunction() { };
var { target, name, descriptor } = createProperty(
  prototype, myFunction
);
assert(target == prototype);
assert(name == 'myFunction');
assert(descriptor.value == myFunction);

// createProperty(target, name, [
//  undef|null|symbol|number|boolean|string|function
// ])
var { target, name, descriptor } = createProperty(
  prototype, 'nonObject', true
);
assert(target == prototype);
assert(name == 'nonObject');
assert(descriptor.value === true);

// createProperty(target, name, descriptor)
var { target, name, descriptor } = createProperty(
  prototype, 'soTrue', { get: true }
);
assert(target == prototype);
assert(name == 'soTrue');
assert(descriptor.get === true);
```

## API
```ts
createProperty(target, x, y)
```
### Parameters
- `target`: The target on which the property will be declared.
- `x`: See the example for a list of overrides.
- `y`: See the example for a list of overrides.
### Returns
An object with `target`, `name`, and `descriptor` properties where the descriptor properties are harvested from the arguments.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.create-property
```
## Source
https://repository.kingjs.net/property-descriptor/create-property
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/create-property)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.create-property
npm package: @kingjs/property-descriptor.initialize.bind
Description: Binds functions in the descriptor to a target.
Latest version: 1.0.3
Deprecated: No replacement; Trivial

# @[kingjs][@kingjs]/[property-descriptor][ns0].[initialize][ns1].[bind][ns2]
Binds functions in the descriptor to a target.
## Usage
```js
var assert = require('assert');
var bind = require('@kingjs/property-descriptor.initialize.bind');

var target = { id: 'target' };

var foo = {
  value: function() { return this; }
}
foo = bind.call(foo, target, 'foo');
assert(foo.value.name = 'foo (bound)');

var bar = {
  get: function() { return this.value; }, 
  set: function(value) { this.value = value; }
}
bar = bind.call(bar, target, 'bar');
assert(bar.get.name = 'bar (bound)');
assert(bar.set.name = 'bar (bound)');

var host = { id: 'host' };
Object.defineProperties(host, { foo, bar });

assert(host.foo() == target);
host.bar = 0;
assert(host.bar == target.value);

```
## API
```ts
bind(this, target, name)
```
### Parameters
- `this`: The descriptor whose functions will be bound.
- `target`: The target to bind to each function in the descriptor.
- `name`: The name to assign to the bound functions.
### Returns
Returns the descriptor with its functions bound to the target.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.initialize.bind
```
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/initialize/bind)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize
[ns2]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize.bind
npm package: @kingjs/property-descriptor.initialize.extension
Description: Lazily declare an accessor or function  but only for specific polymorphic types.
Latest version: 1.0.1
Deprecated: see @kingjs/property-descriptor.target-instance-of

# @[kingjs][@kingjs]/[property-descriptor][ns0].[initialize][ns1].[extension][ns2]
Lazily declare an accessor or function  but only for specific polymorphic types.
## Usage
```js
var assert = require('assert')
var initializeExtension = require('@kingjs/property-descriptor.initialize.extension');

function capitalize() {
  var firstChar = this.charAt(0);

  // capitalize
  firstChar = firstChar.toUpperCase();
  
  var result = firstChar + this.substring(1, this.length);
  return result;
}

var Capitalize = Symbol(capitalize.name);

Object.defineProperty(
  Object.prototype,
  Capitalize,
  initializeExtension.call(
    { value: capitalize },
    Capitalize,
    () => String
  )
);

var test = 'foobar'[Capitalize]();
assert(test == 'Foobar');

var descriptor = Object.getOwnPropertyDescriptor(String.prototype, Capitalize);
assert(descriptor.value == capitalize);

assert.throws(() => [][Capitalize]());

```

## API
```ts
extension(this, name, callback())
```
### Parameters
- `this`: A descriptor describing an accessor or function.
- `name`: The symbol of the property being described.
- `callback`: Returns a type `this` must be polymorphic with before patching the definition.

### Returns
A descriptor whose accessors or function has been replaced with a stub which checks that `this` is polymorphic with the extended type before patching and invoking the accessor or function.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.initialize.extension
```
## Source
https://repository.kingjs.net/property-descriptor/initialize/extension
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/initialize/extension)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize
[ns2]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize.extension
npm package: @kingjs/property-descriptor.initialize.external
Description: Overwrites a descriptors properties with those of the result of a callback invoked with the name and target.
Latest version: 1.0.2
Deprecated: see @kingjs/property-descriptor.create-from-context

# @[kingjs][@kingjs]/[property-descriptor][ns0].[initialize][ns1].[external][ns2]
Overwrites a descriptors properties with those of the result of a callback invoked with the name and target.
## Usage
```js
var assert = require('assert');
var external = require('@kingjs/property-descriptor.initialize.external');

function Target() { };
function Foo() { }

var descriptor = {
  configurable: true,
  enumerable: false,
}

external.call(descriptor, () => Foo, 'foo', Target);
assert(descriptor.value == Foo);
assert(!descriptor.enumerable);
assert(descriptor.configurable);

function init(name, target) {
  assert(name == 'foo');
  assert(target == Target);
  return {
    enumerable: true,
    value: Foo 
  };
}

external.call(descriptor, init, 'foo', Target);
assert(descriptor.value == Foo);
assert(descriptor.enumerable);
assert(descriptor.configurable);
```

## API
```ts
external(this, callback(name, target), name, target)
```
### Parameters
- `this`: The descriptor that delegates its initialization to `callback`.
- `callback`: Returns a function or a descriptor given `name` and `target`.
  - `name`: The name of property being described.
  - `target`: The target on which the property is defined.
- `name`: The name of property being described.
- `target`: The target on which the property is defined.
### Returns
The descriptor whose properties have been overwritten with those of the callback result.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.initialize.external
```
## Source
https://repository.kingjs.net/property-descriptor/initialize/external
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/initialize/external)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize
[ns2]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize.external
npm package: @kingjs/property-descriptor.initialize.lambda
Description: Replaces a descriptors strings with functions.
Latest version: 1.0.2
Deprecated: see @kingjs/property-descriptor.lambdize

# @[kingjs][@kingjs]/[property-descriptor][ns0].[initialize][ns1].[lambda][ns2]
Replaces a descriptors strings with functions.
## Usage
```js
var assert = require('assert');
var lambda = require('@kingjs/property-descriptor.initialize.lambda');

var target = { };

var foo = {
  value: '0'
}
foo = lambda.call(foo, 'Foo');
assert(foo.value.name = 'Foo');

var bar = {
  get: 'this.field', 
  set: 'this.field = value'
}
bar = lambda.call(bar, 'Bar');
assert(bar.get.name = 'Bar');
assert(bar.set.name = 'Bar');

Object.defineProperties(target, { foo, bar });
assert(target.foo() == 0);
target.bar = 1;
assert(target.field == 1);
assert(target.bar == 1);
```
## API
```ts
lambda(this, name)
```
### Parameters
- `this`: The descriptor whose strings will become lambda functions.
- `name`: The name of the lambda functions.
### Returns
The descriptor whose strings are replaced with lambda functions.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.initialize.lambda
```
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/initialize/lambda)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize
[ns2]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize.lambda
npm package: @kingjs/property-descriptor.initialize.name
Description: Renames functions in the descriptor. Allows for optional parenthesized tag.
Latest version: 1.0.1
Deprecated: see @kingjs/property-descriptor.rename

# @[kingjs][@kingjs]/[property-descriptor][ns0].[initialize][ns1].[name][ns2]
Renames functions in the descriptor. Allows for optional parenthesized tag.
## Usage
```js
var assert = require('assert');
var name = require('@kingjs/property-descriptor.initialize.name');

var foo = {
  value: function() { }
}
foo = name.call(foo, 'Foo', 'thunk');
assert(foo.value.name == 'Foo (thunk)');

var bar = {
  get: function() { }, 
  set: function(value) { }
}
bar = name.call(bar, 'Bar', 'stub');
assert(bar.get.name == 'Bar (stub)');
assert(bar.set.name == 'Bar (stub)');

```
## API
```ts
name(this, name[, type])
```
### Parameters
- `this`: The descriptor whose functions will be renamed.
- `name`: The name to assign to each function.
- `type`: An optional tag to parenthesize and append to the name (e.g. a stub id).
### Returns
Returns the descriptor with its functions renamed.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.initialize.name
```
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/initialize/name)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize
[ns2]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize.name
npm package: @kingjs/property-descriptor.initialize.thunk
Description: Replaces a descriptors functions with thunks to a specified name.
Latest version: 1.0.1
Deprecated: see @kingjs/property-descriptor.create-alias

# @[kingjs][@kingjs]/[property-descriptor][ns0].[initialize][ns1].[thunk][ns2]
Replaces a descriptors functions with thunks to a specified name.
## Usage
```js
var assert = require('assert');
var thunk = require('@kingjs/property-descriptor.initialize.thunk');

var target = { 
  Foo: () => 0,
  Bar: 1,
};

var foo = {
  value: null
}
foo = thunk.call(foo, 'Foo');
assert(foo.value.name = 'Foo (thunk)');

var bar = {
  get: null, 
  set: null
}
bar = thunk.call(bar, 'Bar');
assert(bar.get.name = 'Bar (thunk)');
assert(bar.set.name = 'Bar (thunk)');

Object.defineProperties(target, { foo, bar });
assert(target.foo() == 0);
assert(target.bar == 1);
target.bar = 2;
assert(target.Bar == 2);
```
## API
```ts
thunk(this, name)
```
### Parameters
- `this`: The descriptor whose functions will thunk to name.
- `name`: The name on thunk to.
### Returns
Returns the descriptor with functions that thunk to name.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.initialize.thunk
```
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/initialize/thunk)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize
[ns2]: https://www.npmjs.com/package/@kingjs/property-descriptor.initialize.thunk
npm package: @kingjs/property-descriptor.lambdize
Description: Wraps strings found in a descriptor's `value`, `get` or `set` into an appropriate corresponding lambda functions.
Latest version: 1.0.2

# @[kingjs][@kingjs]/[property-descriptor][ns0].[lambdize][ns1]
Wraps strings found in a descriptor's `value`, `get` or `set` into an appropriate corresponding lambda functions.
## Usage
```js
var assert = require('assert');
var lambdize = require('@kingjs/property-descriptor.lambdize');

// create a lambda function that simply returns zero
var fooDescriptor = lambdize.call({ value: '0' }, 'foo');
assert(fooDescriptor.value.name = 'foo');
var target = Object.defineProperty({ }, 'foo', fooDescriptor);
assert(target.foo() == 0);

// create lambda accessors that simply access a property `field`
var barDescriptor = lambdize.call({ 
  get: 'this.field', 
  set: 'this.field = value'
}, 'bar');
assert(barDescriptor.get.name = 'bar');
assert(barDescriptor.set.name = 'bar');
var target = Object.defineProperty({ field: 1 }, 'bar', barDescriptor);
assert(target.bar == 1);
target.bar = 2;
assert(target.field == 2);
```

## API
```ts
lambdize(this[, name])
```
### Parameters
- `this`: The descriptor whose `value`, `get` or `set` property, if strings, will be replaced with appropriate corresponding lambda functions. Only `set` has arguments, a single parameter named `value`.
- `name`: The name to assign any freshly created lambda functions.
### Returns
Returns `this` after it's strings are replaced with lambda functions.
### Remarks
A normal lambda uses the `this` from the surrounding lexical scope.  These pseduo-lambda's use the `this` supplied at runtime.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.lambdize
```
## Source
https://repository.kingjs.net/property-descriptor/lambdize
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/lambdize)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.lambdize
npm package: @kingjs/property-descriptor.rename
Description: Renames functions found in a descriptor.
Latest version: 1.0.3
Deprecated: see @kingjs/reflect.descriptor.rename

# @[kingjs][@kingjs]/[property-descriptor][ns0].[rename][ns1]
Renames functions found in a descriptor.
## Usage
```js
var assert = require('assert');
var rename = require('@kingjs/property-descriptor.rename');

var foo = {
  value: function foo() { }
}
foo = rename.call(foo, '${name} (thunk)');
assert(foo.value.name == 'foo (thunk)');

var bar = {
  get: function getBar() { }, 
  set: function setBar(value) { }
}
bar = rename.call(bar, '${name} (stub)');
assert(bar.get.name == 'getBar (stub)');
assert(bar.set.name == 'setBar (stub)');

```

## API
```ts
rename(this, template)
```
### Parameters
- `this`: The descriptor whose functions will be renamed.
- `template`: The name to assign to each function. A  placeholder for `name` will be expanded to the name of  the function being replaced.
### Returns
Returns the descriptor with its functions renamed.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.rename
```
## Source
https://repository.kingjs.net/property-descriptor/rename
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/rename)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.rename
npm package: @kingjs/property-descriptor.target-instance-of
Description: Add a precondition to an accessor or function descriptor  which throws unless `this` at runtime is an `instanceof` a specific type.
Latest version: 1.0.6

# @[kingjs][@kingjs]/[property-descriptor][ns0].[target-instance-of][ns1]
Add a precondition to an accessor or function descriptor  which throws unless `this` at runtime is an `instanceof` a specific type.
## Usage
```js
var assert = require('assert')
var targetInstanceOf = require('@kingjs/property-descriptor.target-instance-of');

/**
 * @this String The string to capitalize.
 * 
 * @returns A capitalized version of @this.
 */
function capitalize() {
  var firstChar = this.charAt(0);

  // capitalize
  firstChar = firstChar.toUpperCase();
  
  var result = firstChar + this.substring(1, this.length);
  return result;
}

// use a symbol instead of a name so as not to pollute builtin
// types with properties that may collied with other frameworks
var Capitalize = Symbol(capitalize.name);

// extend String with capitalize
Object.defineProperty(
  Object.prototype,
  Capitalize,
  targetInstanceOf.call(
    { value: capitalize },
    () => String,
    Capitalize
  )
);

// call capitalize on a string
var test = 'foobar'[Capitalize]();
assert(test == 'Foobar');

// note that capitalize has been added to String.prototype (even 
// though we originally defined capitalize on Object.prototype). 
var descriptor = Object.getOwnPropertyDescriptor(String.prototype, Capitalize);
assert(descriptor.value == capitalize);

// cannot capitalize an array! The stub has detected the type of
// `this`, being an `Array`, is not an instanceof `String` and so 
// throws. Its derivation by restriction!
assert.throws(() => [][Capitalize]());

```

## API
```ts
targetInstanceOf(this, callback(parameters)[, name])
```
### Parameters
- `this`: A descriptor describing an accessor or function.
- `callback`: Returns the type `this` must be an `instanceof` at runtime in order to access the property.
- `name`: The name of the property being described. If provided, `this` descriptor will be declared on the deepest prototype of the runtime  `this` for which is `instanceof` returns true.
### Returns
A descriptor whose accessors or function throws at runtime unless `this` at runtime is an `instanceof` the type return by `callback`.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.target-instance-of
```
## Source
https://repository.kingjs.net/property-descriptor/target-instance-of
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/target-instance-of)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.target-instance-of
npm package: @kingjs/readme-template
Description: The master readme template for the `kingjs` scope.
Latest version: 1.0.6
Deprecated: see @kingjs/create-readme

# @[kingjs][@kingjs]/[readme-template][ns0]
The master readme template for the `kingjs` scope.
## Usage
Given a `package.json` like this:
```
{
  "name": "@kingjs/readme-template.test",
  "version": "1.0.0",
  "description": "Test of the master readme template for the `kingjs` scope.",
  "main": "index.js",
  "files": [
    "*.js"
  ],
  "repository": {
    "type": "git",
    "url": "https://repository.kingjs.net/readme-template"
  },
  "license": "MIT",
  "dependencies": {
    "@kingjs/readme-template": "^1.0.5"
  },
  "devDependencies": {},
  "readmeTemplate": "@kingjs/readme-template"
}

```
And given a `index.js` like this:
```js
/**
 * @this any This comment
 * @param foo Foo comment
 * @param [bar] Bar comment
 * @param [baz] Baz comment
 * @returns The return comment.
 */
function example(foo, bar, baz) { }

```
Then...
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/readme-template
```
## License
MIT

![Analytics](https://analytics.kingjs.net/readme-template)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/readme-template
npm package: @kingjs/reflect.built-in-symbols
Description: A mapping from symbol to name for  each `Symbol` property whose value is a symbol.
Latest version: 1.0.0

# @[kingjs][@kingjs]/[reflect][ns0].[built-in-symbols][ns1]
A mapping from symbol to name for  each `Symbol` property whose value is a symbol.
## Usage
```js
var assert = require('assert')
var builtInSymbols = require('@kingjs/reflect.built-in-symbols');

// all builtInSymbols are in Symbol
for (var symbol of Object.getOwnPropertySymbols(builtInSymbols)) {
  var name = builtInSymbols[symbol];
  assert(Symbol[name] === symbol);
}

// all Symbols are in builtInSymbols
for (var name of Object.getOwnPropertyNames(Symbol)) {
  var symbol = Symbol[name];
  if (typeof symbol != 'symbol')
    continue;
  assert(builtInSymbols[symbol] == name);
}
```






## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/reflect.built-in-symbols
```

## Source
https://repository.kingjs.net/reflect/built-in-symbols
## License
MIT

![Analytics](https://analytics.kingjs.net/reflect/built-in-symbols)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/reflect
[ns1]: https://www.npmjs.com/package/@kingjs/reflect.built-in-symbols
npm package: @kingjs/reflect.define-accessor
Description: Extends `kingjs/reflect.define-property` with richer overloads.
Latest version: 1.0.2

# @[kingjs][@kingjs]/[reflect][ns0].[define-accessor][ns1]
Extends `kingjs/reflect.define-property` with richer overloads.
## Usage
```js
var assert = require('assert');
var defineFunction = require('@kingjs/reflect.define-accessor');

var target = defineFunction({ bar: 1 }, 
  function foo() { return this.bar; },
  function(value) { return this.bar = value; }
);
assert(target.foo == 1);
target.foo = 2;
assert(target.bar == 2);
assert(target.propertyIsEnumerable('foo'));

var target = defineFunction({ bar: 1 }, 'foo', 
  function() { return this.bar; },
  function(value) { this.bar = value; }
);
assert(target.foo == 1);
target.foo = 2;
assert(target.bar == 2);
assert(target.propertyIsEnumerable('foo'));

var target = defineFunction({ bar: 1 }, 'foo', 
  'this.bar', 
  'this.bar = value'
);
assert(target.foo == 1);
target.foo = 2;
assert(target.bar == 2);
assert(target.propertyIsEnumerable('foo'));

```

## API
```ts
defineAccessor(target, name, descriptor)
```
## Overloads
```js
defineAccessor(target, get[, set])
  => defineProperty(target, get.name || set.name, { get, set });

defineAccessor(target, name, get[, set])
  => defineProperty(target, name, { get, set });

defineAccessor(target, name, string[, string])
  => defineProperty(target, name, { get: lambda, set: lambda });

// inherited from @kingjs/reflect.define-property
defineAccessor(...)
  => defineProperty(...);
```

### Parameters
- `target`: The target on which the property will be defined.
- `name`: The name of the property.
- `descriptor`: A descriptor describing the property.



## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/reflect.define-accessor
```
## Dependencies
|Package|Version|
|---|---|
|[`@kingjs/is`](https://www.npmjs.com/package/@kingjs/is)|`^1.0.9`|
|[`@kingjs/reflect.define-property`](https://www.npmjs.com/package/@kingjs/reflect.define-property)|`^1.0.2`|
## Source
https://repository.kingjs.net/reflect/define-accessor
## License
MIT

![Analytics](https://analytics.kingjs.net/reflect/define-accessor)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/reflect
[ns1]: https://www.npmjs.com/package/@kingjs/reflect.define-accessor
npm package: @kingjs/reflect.define-field
Description: Constrains `kingjs/reflect.define-property` to a single overload for declaring a field.
Latest version: 1.0.0

# @[kingjs][@kingjs]/[reflect][ns0].[define-field][ns1]
Constrains `kingjs/reflect.define-property` to a single overload for declaring a field.
## Usage
```js
var assert = require('assert');
var defineField = require('@kingjs/reflect.define-field');

var target = defineField({ }, 'foo', { value: 1 })
assert.deepEqual(target.foo, { value: 1 });
```

## API
```ts
defineAccessor(target, name, value)
```
## Overloads
```js
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](https://npmjs.org/) installed, run
```
$ npm install @kingjs/reflect.define-field
```
## Dependencies
|Package|Version|
|---|---|
|[`@kingjs/reflect.define-property`](https://www.npmjs.com/package/@kingjs/reflect.define-property)|`^1.0.2`|
## Source
https://repository.kingjs.net/reflect/define-field
## License
MIT

![Analytics](https://analytics.kingjs.net/reflect/define-field)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/reflect
[ns1]: https://www.npmjs.com/package/@kingjs/reflect.define-field
npm package: @kingjs/reflect.define-function
Description: Extends `kingjs/reflect.define-property` with richer overloads.
Latest version: 1.0.3

# @[kingjs][@kingjs]/[reflect][ns0].[define-function][ns1]
Extends `kingjs/reflect.define-property` with richer overloads.
## Usage
```js
var assert = require('assert');
var defineFunction = require('@kingjs/reflect.define-function');

var target = defineFunction({ bar: 1 }, 'foo', 'this.bar');
assert(target.foo() == 1);
```

## API
```ts
defineFunction(target, name, descriptor)
```
## Overloads
```js
defineField(target, name, string)
  => defineProperty(target, name, { value: lambda, function: true });

// inherited from @kingjs/reflect.define-property
defineField(...)
  => defineProperty(...);
```

### Parameters
- `target`: The target on which the property will be defined.
- `name`: The name of the property.
- `descriptor`: A descriptor describing the property.



## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/reflect.define-function
```
## Dependencies
|Package|Version|
|---|---|
|[`@kingjs/is`](https://www.npmjs.com/package/@kingjs/is)|`^1.0.9`|
|[`@kingjs/reflect.define-property`](https://www.npmjs.com/package/@kingjs/reflect.define-property)|`^1.0.2`|
## Source
https://repository.kingjs.net/reflect/define-function
## License
MIT

![Analytics](https://analytics.kingjs.net/reflect/define-function)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/reflect
[ns1]: https://www.npmjs.com/package/@kingjs/reflect.define-function
npm package: @kingjs/reflect.define-interface
Description: Defines or aliases a group of global symbols.
Latest version: 1.0.1
Deprecated: see @kingjs/create-interface

# @[kingjs][@kingjs]/[reflect][ns0].[define-interface][ns1]
Defines or aliases a group of global symbols.
## Usage
```js
var assert = require('assert');
var defineInterface = require('@kingjs/reflect.define-interface');

var {
  IInterface,
  IInterface: { Id }
} = defineInterface;

function readMe() {
  var target = { };

  var { IFoo } = defineInterface(target, 'IFoo', {
    id: Symbol.for('@kingjs/IFoo'),
    members: { 
      Foo: Symbol.for('IFoo (custom)'),
      Baz: null,
      iterator: Symbol.iterator
    }
  });

  var { IBar } = defineInterface(target, 'IBar', {
    id: Symbol.for('IBar'),
    members: { Bar: null },
    extends: [ IFoo ]
  });

  var { IBaz } = defineInterface(target, 'IBaz', {
    id: Symbol.for('IBaz')
  });

  assert(IFoo[Id] in IBar);

  assert(target.IFoo == IFoo);
  assert(target.IBar == IBar);
  
  assert.throws(IFoo);
  assert.throws(IBar);

  assert(IFoo.prototype === null);
  assert(IBar.prototype === null);

  assert(Symbol.keyFor(IFoo.Baz) == '@kingjs/IFoo.Baz');
  assert(Symbol.keyFor(IFoo.Foo) == 'IFoo (custom)');
  assert(Symbol.keyFor(IBar.Bar) == 'IBar.Bar');

  assert(Symbol.keyFor(IFoo[Id]) == '@kingjs/IFoo');
  assert(Symbol.keyFor(IBar[Id]) == 'IBar');

  assert(IFoo.name == '@kingjs/IFoo');
  assert(IBar.name == 'IBar');

  assert(IInterface[Id] in IFoo);
  assert(IInterface[Id] in IBar);

  function FooBar() { }

  FooBar.prototype[IFoo[Id]] = IFoo;
  FooBar.prototype[IFoo.Foo] = 'Foo';
  FooBar.prototype[IFoo.Baz] = 'Baz';

  FooBar.prototype[IBar[Id]] = IBar;
  FooBar.prototype[IBar.Bar] = 'Bar';

  var fooBar = new FooBar();
  assert(IFoo[Id] in fooBar);
  assert(fooBar instanceof IFoo);
  assert(IBar[Id] in fooBar);
  assert(fooBar instanceof IBar);
  assert(fooBar instanceof IBaz == false);
}
readMe();
```




### Remarks


## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/reflect.define-interface
```
## Dependencies
|Package|Version|
|---|---|
|[`@kingjs/reflect.built-in-symbols`](https://www.npmjs.com/package/@kingjs/reflect.built-in-symbols)|`^1.0.0`|
## Source
https://repository.kingjs.net/reflect/define-interface
## License
MIT

![Analytics](https://analytics.kingjs.net/reflect/define-interface)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/reflect
[ns1]: https://www.npmjs.com/package/@kingjs/reflect.define-interface