tutorials/delete-idle-instances/index.js
/**
 * Validates that a request options contains the expected fields.
 *
 * @param {!object} options the request options to validate.
 * @return {!object} the options object.
 */
Validates that a request options contains the expected fields.
@param {!object} options the request options to validate.
@return {!object} the options object.
Validates that a request options contains the expected fields . @param { !object } options the request options to validate . @return { !object } the options object .
function _validateOptions (options) {
  if (options.label) {
    const parts = options.label.split('=');
    if (parts.length < 2) {
      throw new Error(`Label ${options.label} is not a key=value pair.`);
    }
    options.label.key = parts[1];
  }
  return options;
}
function _validateOptions ( options ) { if ( options . label ) { const parts = options . label . split ( '=' ) ; if ( parts . length < 2 ) { throw new Error ( ` ${ options . label } ` ) ; } options . label . key = parts [ 1 ] ; } return options ; }
Validates that a request options contains the expected fields.
Validates that a request options contains the expected fields .