New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chaid

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chaid - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

chaid.js

@@ -6,2 +6,4 @@ function normalize (target) {

return target
if (typeof target.toHexString === 'function')
return target.toHexString()
if (typeof target.id != 'undefined')

@@ -11,4 +13,2 @@ return target.id.toString()

return target._id.toString()
if (typeof target.toHexString === 'function')
return target.toHexString()
throw new Error('chaid could not get an id from ' + target)

@@ -15,0 +15,0 @@ }

{
"name": "chaid",
"version": "1.0.0",
"version": "1.0.1",
"description": "Id equality assertions for chai",

@@ -29,3 +29,4 @@ "author": "Adam Hull <adam@hmlad.com>",

"jshint": "*",
"mocha": "~1.x.x"
"mocha": "~1.x.x",
"bson-objectid": "~1.0.1"
},

@@ -32,0 +33,0 @@ "jshintConfig": {

@@ -1,2 +0,2 @@

chaid
chaId
==============

@@ -9,3 +9,4 @@

Chaid converts many different id representations to strings for comparison:
Ids come in [lots of flavors](http://bites.goodeggs.com/posts/ids-in-mongoose-json-and-backbone/). Sometimes they're strings, sometimes objects. Sometimes you'll find them at `.id`, other times at `._id`. ChaId lets you test for equality by comparing string representations of ids, with minimal fretting about initial representation or location:
```js

@@ -12,0 +13,0 @@ {_id: 'foo'}.should.have.id('foo')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc