lib/snippet.js
function Snippet(file) {
  if (!(this instanceof Snippet)) {
    return new Snippet(file);
  }
  if (typeof file === 'string') {
    file = {path: file};
  }

  this.history = [];

  if (typeof file === 'object') {
    this.visit('set', file);
  }

  this.cwd = this.cwd || process.cwd();
  this.content = this.content || null;
  this.options = this.options || {};
}
function Snippet(file) {
  if (!(this instanceof Snippet)) {
    return new Snippet(file);
  }
  if (typeof file === 'string') {
    file = {path: file};
  }

  this.history = [];

  if (typeof file === 'object') {
    this.visit('set', file);
  }

  this.cwd = this.cwd || process.cwd();
  this.content = this.content || null;
  this.options = this.options || {};
}
function Snippet ( file ) { if ( ! ( this instanceof Snippet ) ) { return new Snippet ( file ) ; } if ( typeof file === 'string' ) { file = { path : file } ; } this . history = [ ] ; if ( typeof file === 'object' ) { this . visit ( 'set' , file ) ; } this . cwd = this . cwd || process . cwd ( ) ; this . content = this . content || null ; this . options = this . options || { } ; }
Create a new `Snippet`, optionally passing a `file` object
to start with.

@param {Object} `file`
@api public
Create a new Snippet optionally passing a file object to start with .