How to use the pelias-model.Document.prototype function in pelias-model

To help you get started, we’ve selected a few pelias-model examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pelias / openstreetmap / test / stream / document_constructor.js View on Github external
stream.pipe( through.obj( function( doc, enc, next ){
      t.equal( Object.getPrototypeOf(doc), Document.prototype, 'correct proto' );
      t.equal( doc.getId(), 'X/1', 'correct id' );
      t.equal( doc.getLayer(), 'venue', 'defaults to venue' );
      t.end(); // test will fail if not called (or called twice).
      next();
    }));
    stream.write({ id: 1, type: 'X' });