New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

is-mongo-objectid

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-mongo-objectid

Super fast function to check if a String is a MongoDB ObjectID based on ES6 Sets.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

isMongoObjectID

Greenkeeper badge

Travis_CI_badge

Coverage Status

Super fast function to check if a String is a MongoDB ObjectID based on ES6 Sets.

Why?

Because performance does matter.

isMongoObjectID is almost 6x faster than objectid.isValid (from objectid module)

Measurements

We check 2 Strings: one with objectID formant and another with invalid format for each case. (We use performance-node module for measures).

After several execution we get the following results:

{ name: 'objectid.isValid(id)-measure',
  startTime: 0.8244399875402451,
  duration: 6.259790003299713,
  entryType: 'measure' }
{ name: 'isValidObjectID(id)-measure',
  startTime: 24.24372299015522,
  duration: 1.0192510038614273,
  entryType: 'measure' }

Keywords

objectid

FAQs

Package last updated on 26 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts