index.js
/**
   * Defines a procedure by the given `name`.
   * @param  {string}   name             The name of the procedure
   * @param  {Function} fn               The procedure function
   * @param  {Boolean}  [override=false] Override if a procedure with this name already exists
   */
Defines a procedure by the given `name`.
@param  {string}   name             The name of the procedure
@param  {Function} fn               The procedure function
@param  {Boolean}  [override=false] Override if a procedure with this name already exists
Defines a procedure by the given ` name ` . @param { string } name The name of the procedure @param { Function } fn The procedure function @param { Boolean } [ override = false ] Override if a procedure with this name already exists
define (name, fn, override = false) {
    if (!name || typeof name !== 'string') {
      throw new TypeError('name must be a string')
    }
    if (!fn || typeof fn !== 'function') {
      throw new TypeError('fn must be a function')
    }
    if (!override && this._procedures.has(name)) {
      throw new Error(`${name} already defined`)
    }
    this._procedures.set(name, fn)
  }
define ( name , fn , override = false ) { if ( ! name || typeof name !== 'string' ) { throw new TypeError ( 'name must be a string' ) } if ( ! fn || typeof fn !== 'function' ) { throw new TypeError ( 'fn must be a function' ) } if ( ! override && this . _procedures . has ( name ) ) { throw new Error ( ` ${ name } ` ) } this . _procedures . set ( name , fn ) }
Defines a procedure by the given `name`.
Defines a procedure by the given ` name ` .