realm-js/lib/index.js

15 lines
569 B
JavaScript
Raw Normal View History

2015-10-28 17:37:17 +00:00
/* Copyright 2015 Realm Inc - All Rights Reserved
* Proprietary and Confidential
*/
'use strict';
if (typeof Realm != 'undefined') {
// The global Realm constructor should be available on device (using JavaScriptCore).
module.exports = Realm; // eslint-disable-line no-undef
} else if (navigator.userAgent) {
// The userAgent will be defined when running in a browser (such as Chrome debugging mode).
2015-10-06 19:36:56 +00:00
module.exports = require('./realm');
} else {
throw new Error('Missing Realm constructor - please ensure RealmReact framework is included!');
}