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