src/engine/inject/accessors.js
function inject (taskKey) {
    var accessorName = null
    var taskName = graph.task[taskKey]

    /**
     * Accessor-like function.
     *
     * @param {*} data that JSON can serialize
     */

    function accessor (data) {
      // Behave like a setter if an argument is provided.
      if (arguments.length === 1) {
        var json = JSON.stringify(data)

        if (no(json)) {
          throw new Error('JSON do not serialize data:' + data)
        }

        graph.data[accessorName] = data
      }

      // Always behave also like a getter.
      return graph.data[accessorName]
    }

    if (regexAccessor.test(taskName)) {
      accessorName = taskName.substring(1)

      funcs[taskName] = accessor
    }
  }
function inject (taskKey) {
    var accessorName = null
    var taskName = graph.task[taskKey]

    /**
     * Accessor-like function.
     *
     * @param {*} data that JSON can serialize
     */

    function accessor (data) {
      // Behave like a setter if an argument is provided.
      if (arguments.length === 1) {
        var json = JSON.stringify(data)

        if (no(json)) {
          throw new Error('JSON do not serialize data:' + data)
        }

        graph.data[accessorName] = data
      }

      // Always behave also like a getter.
      return graph.data[accessorName]
    }

    if (regexAccessor.test(taskName)) {
      accessorName = taskName.substring(1)

      funcs[taskName] = accessor
    }
  }
function inject ( taskKey ) { var accessorName = null var taskName = graph . task [ taskKey ] /**
     * Accessor-like function.
     *
     * @param {*} data that JSON can serialize
     */ function accessor ( data ) { // Behave like a setter if an argument is provided. if ( arguments . length === 1 ) { var json = JSON . stringify ( data ) if ( no ( json ) ) { throw new Error ( 'JSON do not serialize data:' + data ) } graph . data [ accessorName ] = data } // Always behave also like a getter. return graph . data [ accessorName ] } if ( regexAccessor . test ( taskName ) ) { accessorName = taskName . substring ( 1 ) funcs [ taskName ] = accessor } }
Inject accessor.

@param {String} taskKey
Inject accessor .