Check if there is a global console to silent eslint
This commit is contained in:
parent
c361031e36
commit
48b106e610
|
@ -54,6 +54,9 @@ var types = Object.freeze({
|
||||||
});
|
});
|
||||||
Object.defineProperty(realmConstructor, 'Types', {
|
Object.defineProperty(realmConstructor, 'Types', {
|
||||||
get: function() {
|
get: function() {
|
||||||
|
if (typeof console != 'undefined') {
|
||||||
|
/* global console */
|
||||||
|
/* eslint-disable no-console */
|
||||||
var stack = new Error().stack.split("\n").slice(2).join("\n");
|
var stack = new Error().stack.split("\n").slice(2).join("\n");
|
||||||
var msg = '`Realm.Types` is deprecated! Please specify the type name as lowercase string instead!\n'+stack;
|
var msg = '`Realm.Types` is deprecated! Please specify the type name as lowercase string instead!\n'+stack;
|
||||||
if (console.warn != undefined) {
|
if (console.warn != undefined) {
|
||||||
|
@ -62,6 +65,8 @@ Object.defineProperty(realmConstructor, 'Types', {
|
||||||
else {
|
else {
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
}
|
}
|
||||||
|
/* eslint-enable no-console */
|
||||||
|
}
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue