Namespace: typeMappingsMixin

typeMappingsMixin

Mixin for creating custom objects.

Source:

Example

const typeMappingsMixin = {
  object: function(arg) {
    try {
      switch (arg) {
        case "test":
          return {
            name: "John",
          }
        default:
          return {};
      }
    } catch (error) {
      return error;
    }
  }
}

module.exports = {
  typeMappingsMixin,
}

Methods

(static) object(arg) → {any}

Takes the argument and attempts to find a matching object to return.

Parameters:
Name Type Description
arg String

The argument passed to typeMappings

Source:
Returns:
Type
any