Documentationcurrent version
Help us improve the docs by fixing typos and proposing enhancements.

Nikita

Metadata "raw_input"

The raw_input metadata enables preventing arguments passed to an action to move into the 'config' property. It is only used when registering an action and shall be considered as an advanced usage.

  • Type: boolean
  • Default: false

Usage

The raw_input metadata property is commonly used along the args property of the action:

nikita
// Register an action
.registry.register('my_action', {
  metadata: {
    raw_input: true  },
  handler: function({config, args}){
    console.info(args)
    // Print `[ { who: 'Nikita' }, 'whoami' ]`
  }
})
// Call the action
.my_action({who: 'Nikita'}, 'whoami')

Notes about configuration

The config property is empty when passing arguments to the action with the metadata enabled:

nikita
// Register an action
.registry.register('my_action', {
  metadata: {    raw_input: true
  },
  handler: function({config}){
    console.info(config)
    // Print config as `{}`
  }
})
// Call the action
.my_action({who: 'Nikita'})
Edit on GitHub
Navigate
About

Nikita is an open source project hosted on GitHub and developed by Adaltas.