How to use the undertaker/lib/helpers/metadata.get function in undertaker

To help you get started, we’ve selected a few undertaker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-docs / gulp.d / lib / create-task.js View on Github external
module.exports = ({ name, desc, opts, call: fn, loop }) => {
  if (name) {
    const displayName = fn.displayName
    if (displayName === '' || displayName === '') {
      metadata.get(fn).tree.label = `${displayName} ${name}`
    }
    fn.displayName = name
  }
  if (loop) {
    const delegate = fn
    name = delegate.displayName
    delegate.displayName = `${name}:loop`
    fn = () => watch(loop, { ignoreInitial: false }, delegate)
    fn.displayName = name
  }
  if (desc) fn.description = desc
  if (opts) fn.flags = opts
  return fn
}

undertaker

Task registry that allows composition through series/parallel methods.

MIT
Latest version published 8 months ago

Package Health Score

79 / 100
Full package analysis