scopedid

generic identifier class with types and optional versions

ScopedId

generic identifier class with types and optional versions

$ npm install scopedid
var ScopedId = require('scopedid')

var userId = '511083bb08ce6b1b00000003' // ObjectId string

var id = ScopedId('users', userId)

var id2 = ScopedId('users', userId)

ScopedId.equals(id, id2)
// => true

ScopedId.isValid(id)
// => true

ScopedId.toString()
// => 'users/511083bb08ce6b1b00000003'
ScopedId : {
  _id: ObjectId,
  scope: String,
  versionId : ObjectId|String (optional)
}

versionId can be an ObjectId or a string representing a version ref (like a branch).

See ObjectId

{scope}/{_id} or {scope}/{_id}/{versionId}

From package root,

$ npm install
$ npm test

jden jason@denizac.org

MIT. (c) 2013 Agile Diagnosis team@agilediagnosis.com. See LICENSE.md