Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ActionSelector<Source, Target, TargetProperty>

interface

ActionSelector

typeparam

Result Type

description

An Object that allows to perform a function over a source property's value

example

const source = {
  foo: {
    bar: 'bar'
  }
};
let schema = {
  barqux: {
    path: 'foo.bar',
    fn: value => `${value}qux` // Apply a function over the source property's value
  }
};

morphism(schema, source);
//=> { barqux: 'barqux' }

Type parameters

  • Source

    Source/Input Type

  • Target

  • TargetProperty: keyof Target

Hierarchy

  • ActionSelector

Index

Properties

Properties

fn

fn: function

Type declaration

    • (fieldValue: any, object: Source, items: Source, objectToCompute: Target): Target[TargetProperty]
    • Parameters

      • fieldValue: any
      • object: Source
      • items: Source
      • objectToCompute: Target

      Returns Target[TargetProperty]

path

path: ActionString<Source> | ActionAggregator<Source>

Generated using TypeDoc