Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
azanul / server / node_modules / mongoose / lib / helpers / discriminator / areDiscriminatorValuesEqual.js
Size: Mime:
'use strict';

const isBsonType = require('../isBsonType');

module.exports = function areDiscriminatorValuesEqual(a, b) {
  if (typeof a === 'string' && typeof b === 'string') {
    return a === b;
  }
  if (typeof a === 'number' && typeof b === 'number') {
    return a === b;
  }
  if (isBsonType(a, 'ObjectId') && isBsonType(b, 'ObjectId')) {
    return a.toString() === b.toString();
  }
  return false;
};