Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xylabs/logger

Package Overview
Dependencies
Maintainers
7
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/logger - npm Package Compare versions

Comparing version 2.13.4 to 2.13.5

dist/browser/IdLogger.d.cts

23

dist/browser/index.js
// src/Logger.ts
var LoggerStub = 1;
import { handleError } from "@xylabs/error";
var getFunctionName = (depth = 2) => {
try {
throw Error();
} catch (ex) {
return handleError(ex, (error) => {
let newIndex = void 0;
const stackParts = error.stack?.split("\n")[depth].split(" ");
const funcName = stackParts?.find((item, index) => {
if (item.length > 0 && item !== "at") {
if (item === "new") {
newIndex = index;
}
return item;
}
}) ?? "<unknown>";
return newIndex ? `${funcName} ${stackParts?.[newIndex + 1]}` : funcName;
});
}
};
export {
LoggerStub
getFunctionName
};
//# sourceMappingURL=index.js.map

2

dist/browser/Logger.d.ts

@@ -13,3 +13,3 @@ export type LogFunction = (message?: unknown) => void;

}
export declare const LoggerStub = 1;
export declare const getFunctionName: (depth?: number) => string;
//# sourceMappingURL=Logger.d.ts.map
// src/Logger.ts
var LoggerStub = 1;
import { handleError } from "@xylabs/error";
var getFunctionName = (depth = 2) => {
try {
throw Error();
} catch (ex) {
return handleError(ex, (error) => {
var _a;
let newIndex = void 0;
const stackParts = (_a = error.stack) == null ? void 0 : _a.split("\n")[depth].split(" ");
const funcName = (stackParts == null ? void 0 : stackParts.find((item, index) => {
if (item.length > 0 && item !== "at") {
if (item === "new") {
newIndex = index;
}
return item;
}
})) ?? "<unknown>";
return newIndex ? `${funcName} ${stackParts == null ? void 0 : stackParts[newIndex + 1]}` : funcName;
});
}
};
export {
LoggerStub
getFunctionName
};
//# sourceMappingURL=index.js.map

@@ -13,3 +13,3 @@ export type LogFunction = (message?: unknown) => void;

}
export declare const LoggerStub = 1;
export declare const getFunctionName: (depth?: number) => string;
//# sourceMappingURL=Logger.d.ts.map

@@ -13,2 +13,5 @@ {

"description": "Primary SDK for using XYO Protocol 2.0",
"dependencies": {
"@xylabs/error": "~2.13.5"
},
"devDependencies": {

@@ -57,4 +60,4 @@ "@xylabs/ts-scripts-yarn3": "^3.1.21",

"sideEffects": false,
"version": "2.13.4",
"version": "2.13.5",
"type": "module"
}

@@ -0,1 +1,3 @@

import { handleError } from '@xylabs/error'
export type LogFunction = (message?: unknown) => void

@@ -15,3 +17,22 @@

//to satisfy export
export const LoggerStub = 1
export const getFunctionName = (depth = 2) => {
try {
throw Error()
} catch (ex) {
return handleError(ex, (error) => {
let newIndex: number | undefined = undefined
const stackParts = error.stack?.split('\n')[depth].split(' ')
const funcName =
stackParts?.find((item, index) => {
if (item.length > 0 && item !== 'at') {
//check if constructor
if (item === 'new') {
newIndex = index
}
return item
}
}) ?? '<unknown>'
return newIndex ? `${funcName} ${stackParts?.[newIndex + 1]}` : funcName
})
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc