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

timer-logs

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timer-logs - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.idea/vcs.xml

14

package.json
{
"name": "timer-logs",
"version": "1.0.1",
"version": "1.0.2",
"devDependencies": {

@@ -13,3 +13,13 @@ "@types/node": "^"

"license": "MIT",
"types": "./Timer.d.ts"
"types": "./Timer.d.ts",
"scripts": {
"build": "tsc --removeComments && tsc --declaration --emitDeclarationOnly"
},
"keywords": [
"nodejs",
"typescript",
"logging",
"timer",
"google cloud logging"
]
}

10

Timer.d.ts

@@ -16,5 +16,6 @@ declare type Config = {

};
/** filename of the typescript source file where the log is coming from */
filename: string;
};
export declare class Timer {
export default class Timer {
private readonly startTime;

@@ -27,4 +28,4 @@ private finishTime;

* Create a new Timer object. Can have multiple timers within this object.
* Should only have one of these per file
* @param config optional configuration object with message and severity
* Should only have one of these per file. Creating this object beings a timer automatically
* @param config required configuration object, requires filename, others are optional
*/

@@ -121,2 +122,5 @@ constructor(config: Config);

}
/**
* Postgres error type thrown by pg library
*/
declare type PostgresError = {

@@ -123,0 +127,0 @@ message: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Timer = void 0;
class Timer {

@@ -107,2 +106,2 @@ constructor(config) {

}
exports.Timer = Timer;
exports.default = Timer;

@@ -1,7 +0,1 @@

//todo:
// - add the option of adding metadata to the log after its been started (details setter)
// - make 'class' a built-in, required param in the constructor (force)
// - add error handling methods, such as handlePostgresError(e)
// this should really be in every single interface method, from the top to the return
type Config = {

@@ -20,3 +14,3 @@ /**

details?: { [key: string]: string | number }
// filename of the typescript source file where the log is coming from. Soon to become mandatory
/** filename of the typescript source file where the log is coming from */
filename: string

@@ -32,4 +26,4 @@ }

* Create a new Timer object. Can have multiple timers within this object.
* Should only have one of these per file
* @param config optional configuration object with message and severity
* Should only have one of these per file. Creating this object beings a timer automatically
* @param config required configuration object, requires filename, others are optional
*/

@@ -40,4 +34,2 @@ constructor(config: Config) {

this.config.details = config?.details ?? {}
// TODO: split filename by '/' and save each item as its own key:value in the log.
// - such as ./interface/getCompanyProfile.ts becomes {level1:'interface', level2:'getCompanyProfile.ts'}
this.savedTimes = {}

@@ -216,3 +208,5 @@ if (this.config?.label !== undefined) this.start(this.config.label)

}
/**
* Postgres error type thrown by pg library
*/
type PostgresError = {

@@ -219,0 +213,0 @@ message: string

@@ -5,4 +5,3 @@ {

"target": "ES2019",
"sourceMap": false,
"removeComments": true
"sourceMap": false
},

@@ -9,0 +8,0 @@ "exclude": [

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