Skip to content
James edited this page Jun 24, 2017 · 6 revisions

chain-able exports

Chain

  • default: (also as .Chain)
    • is a ChainedMap that contains all functionality created by using compose with default arguments

declaration

export declare class Chain extends ChainedMap implements Composed {
  public traverse(useThis?: boolean | Traversable): ChainAble

  // ---- transformchain ---

  // stored in .meta
  public transform(key: Primitive, value: any): ChainAble

  // remaps a key from 1 to another
  public remap(from: string | Obj | Primitive, to: string | Obj | Primitive): ChainAble

  // returns traverser using this.entries()
  public traverse(useThis?: boolean): TraverseChain
  // returns traverser using obj
  public traverse(obj: Traversable): TraverseChain

  // --- shorthandchain ---

  // sets a value only when .has is false
  public setIfEmpty(name: Primitive, value: any): ChainAble

  // .return(anyValue)
  public return(value: any): any

  // wrap a function, call it, return this
  public wrap(fn: Fn): ChainAble

  // special property in .meta
  public debug(should?: boolean): ChainAble

  // --- observechain ---

  // stored in .meta
  public observe(properties: strings, fn: FnArgIsObj): ChainAble

  // --- dotpropchain ---

  // disables dot-prop in .set, .has, .get, .delete
  public dot(enabled: boolean): ChainAble
}

'merge', 'compose', 'clean', 'is', 'traverse', 'camelCase', 'toArr', 'dot', 'matcher', 'eq', 'reduce', 'meta', 'validators',

all exports are also available as modular imports

import ChainedMap from 'chain-able/ChainedMap'
Clone this wiki locally