refactor(core): remove lodash

closes: #2452
This commit is contained in:
Daniel 2018-04-13 12:33:45 +02:00
parent 3b440c6df8
commit 86b637e85a
3 changed files with 17 additions and 22 deletions

View File

@ -1,5 +1,3 @@
import * as _ from 'lodash';
export function checkReady() {
const DEVICE_READY_TIMEOUT = 5000;
@ -18,7 +16,7 @@ export function checkReady() {
});
setTimeout(() => {
if (!didFireReady && !_.isUndefined(window.cordova)) {
if (!didFireReady && window.cordova) {
console.warn(
`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`
);

View File

@ -1,4 +1,3 @@
import { isUndefined } from 'lodash';
import { Observable, fromEvent } from 'rxjs';
import { CordovaOptions } from './interfaces';
@ -525,7 +524,7 @@ export function wrapInstance(
reject
);
}
if (result && !isUndefined(result.then)) {
if (result && result.then) {
result.then(resolve, reject);
} else {
reject();

View File

@ -1,14 +1,12 @@
import * as _ from 'lodash';
export function instancePropertyGet(pluginObj: any, key: string) {
if (!_.isUndefined(pluginObj._objectInstance) && !_.isUndefined(pluginObj._objectInstance[key])) {
if (pluginObj._objectInstance && pluginObj._objectInstance[key]) {
return pluginObj._objectInstance[key];
}
return null;
}
export function instancePropertySet(pluginObj: any, key: string, value: any) {
if (!_.isUndefined(pluginObj._objectInstance) && !_.isUndefined(pluginObj._objectInstance[key])) {
if (pluginObj._objectInstance && pluginObj._objectInstance[key]) {
pluginObj._objectInstance[key] = value;
}
}