Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove lodash dependency #1053

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/src/DTO/NotificationIOS.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import {Notification} from './Notification';
import * as _ from 'lodash';

function isObject(value: any) {
var type = typeof value;
return value != null && (type == "object" || type == "function");
}

export class NotificationIOS extends Notification {
identifier: string;
Expand All @@ -13,12 +17,12 @@ export class NotificationIOS extends Notification {
}

get alert(): any {
if (_.isObject(this.aps.alert)) {
if (isObject(this.aps.alert)) {
return this.aps.alert;
} else if (_.isString(this.aps.alert)) {
} else if (typeof this.aps.alert == "string") {
return {
body: this.aps.alert
}
body: this.aps.alert,
};
}
}

Expand Down
8 changes: 4 additions & 4 deletions lib/src/adapters/UniqueIdProvider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as _ from 'lodash';
var id = 0;

export class UniqueIdProvider {
generate(): number {
return parseInt(_.uniqueId());
}
generate(): number {
return id++;
}
}