index.js
function uuid(version) {
    var v = (version) ? version : '';

    // verify its a valid string
    this.assert(
      (typeof this._obj === 'string' || this._obj instanceof String),
      'expected #{this} to be of type #{exp} but got #{act}',
      'expected #{this} to not be of type #{exp}',
      'string',
      typeof(this._obj)
    );

    // assert it is a valid uuid
    var regex = getRegEx(v);
    this.assert(
      regex.test(this._obj),
      'expected #{this} to be a valid UUID ' + v,
      'expected #{this} to not be a UUID ' + v
    );    
  }
function uuid(version) {
    var v = (version) ? version : '';

    // verify its a valid string
    this.assert(
      (typeof this._obj === 'string' || this._obj instanceof String),
      'expected #{this} to be of type #{exp} but got #{act}',
      'expected #{this} to not be of type #{exp}',
      'string',
      typeof(this._obj)
    );

    // assert it is a valid uuid
    var regex = getRegEx(v);
    this.assert(
      regex.test(this._obj),
      'expected #{this} to be a valid UUID ' + v,
      'expected #{this} to not be a UUID ' + v
    );    
  }
function uuid ( version ) { var v = ( version ) ? version : '' ; // verify its a valid string this . assert ( ( typeof this . _obj === 'string' || this . _obj instanceof String ) , 'expected #{this} to be of type #{exp} but got #{act}' , 'expected #{this} to not be of type #{exp}' , 'string' , typeof ( this . _obj ) ) ; // assert it is a valid uuid var regex = getRegEx ( v ) ; this . assert ( regex . test ( this . _obj ) , 'expected #{this} to be a valid UUID ' + v , 'expected #{this} to not be a UUID ' + v ) ; }
Validates a uuid
@param  {String} version
Validates a uuid