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

@probe.gl/stats

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@probe.gl/stats - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

4

dist/lib/stats.d.ts

@@ -20,3 +20,3 @@ import Stat from './stat';

/** Acquire a stat. Create if it doesn't exist. */
get(name: string, type?: string): Stat | null;
get(name: string, type?: string): Stat;
get size(): number;

@@ -34,5 +34,5 @@ /** Reset all stats */

type?: string;
}): Stat | null;
}): Stat;
}
export {};
//# sourceMappingURL=stats.d.ts.map

@@ -6,3 +6,3 @@ {

"type": "module",
"version": "4.0.0",
"version": "4.0.1",
"keywords": [

@@ -37,3 +37,3 @@ "javascript",

},
"gitHead": "691bfc682941f6ef68960ede7b711d014d74bb85"
"gitHead": "6320ab819621b18ea25008a88458edf7f9069fd4"
}

@@ -27,3 +27,3 @@ // probe.gl, MIT license

/** Acquire a stat. Create if it doesn't exist. */
get(name: string, type: string = 'count'): Stat | null {
get(name: string, type: string = 'count'): Stat {
return this._getOrCreate({name, type});

@@ -69,17 +69,15 @@ }

_getOrCreate(stat: Stat | {name: string, type?: string}): Stat | null {
if (!stat || !stat.name) {
return null;
}
_getOrCreate(stat: Stat | {name: string, type?: string}): Stat {
const {name, type} = stat;
if (!this.stats[name]) {
let result = this.stats[name];
if (!result) {
if (stat instanceof Stat) {
this.stats[name] = stat;
result = stat;
} else {
this.stats[name] = new Stat(name, type);
result = new Stat(name, type);
}
this.stats[name] = result;
}
return this.stats[name] || null;
return result;
}
}

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