Skip to content
Merged
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
12 changes: 11 additions & 1 deletion lib/common/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export class Logger implements ILogger {
this.logMessage(args, LoggerLevel.INFO);
}

/**
* DEPRECATED
* Present only for backwards compatibility as some plugins (nativescript-plugin-firebase)
* use $logger.out in their hooks
*/
out(...args: any[]): void {
this.info(args);
}

debug(...args: any[]): void {
const encodedArgs: string[] = this.getPasswordEncodedArguments(args);
this.logMessage(encodedArgs, LoggerLevel.DEBUG);
Expand Down Expand Up @@ -159,7 +168,8 @@ export class Logger implements ILogger {
const result: any = {};
const cleanedData = _.cloneDeep(data);

const dataToCheck = data.filter(el => typeof el === "object");
// objects created with Object.create(null) do not have `hasOwnProperty` function
const dataToCheck = data.filter(el => typeof el === "object" && el.hasOwnProperty && typeof el.hasOwnProperty === "function");

for (const element of dataToCheck) {
if (opts.length === 0) {
Expand Down