/node_modules/mongodb/node_modules/bson/lib/bson/index.js
https://bitbucket.org/gagginaspinnata/todo-app-with-angularjs · JavaScript · 74 lines · 64 code · 3 blank · 7 comment · 3 complexity · 6dd9fb285d9fdfe2543fc6654c2d0a91 MD5 · raw file
- try {
- exports.BSONPure = require('./bson');
- exports.BSONNative = require('../../ext');
- } catch(err) {
- // do nothing
- }
- [ './binary_parser'
- , './binary'
- , './code'
- , './db_ref'
- , './double'
- , './max_key'
- , './min_key'
- , './objectid'
- , './symbol'
- , './timestamp'
- , './long'].forEach(function (path) {
- var module = require('./' + path);
- for (var i in module) {
- exports[i] = module[i];
- }
- });
- // Exports all the classes for the NATIVE JS BSON Parser
- exports.native = function() {
- var classes = {};
- // Map all the classes
- [ './binary_parser'
- , './binary'
- , './code'
- , './db_ref'
- , './double'
- , './max_key'
- , './min_key'
- , './objectid'
- , './symbol'
- , './timestamp'
- , './long'
- , '../../ext'
- ].forEach(function (path) {
- var module = require('./' + path);
- for (var i in module) {
- classes[i] = module[i];
- }
- });
- // Return classes list
- return classes;
- }
- // Exports all the classes for the PURE JS BSON Parser
- exports.pure = function() {
- var classes = {};
- // Map all the classes
- [ './binary_parser'
- , './binary'
- , './code'
- , './db_ref'
- , './double'
- , './max_key'
- , './min_key'
- , './objectid'
- , './symbol'
- , './timestamp'
- , './long'
- , '././bson'].forEach(function (path) {
- var module = require('./' + path);
- for (var i in module) {
- classes[i] = module[i];
- }
- });
- // Return classes list
- return classes;
- }