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

probe.gl

Package Overview
Dependencies
Maintainers
6
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

probe.gl - npm Package Compare versions

Comparing version 3.1.0-alpha.10 to 3.1.0-alpha.11

8

dist/es5/index.js

@@ -94,2 +94,8 @@ "use strict";

});
Object.defineProperty(exports, "Stat", {
enumerable: true,
get: function get() {
return _stat["default"];
}
});
Object.defineProperty(exports, "Log", {

@@ -161,2 +167,4 @@ enumerable: true,

var _stat = _interopRequireDefault(require("./lib/stat"));
var _log = _interopRequireDefault(require("./lib/log"));

@@ -163,0 +171,0 @@

52

dist/es5/lib/stats.js

@@ -18,6 +18,10 @@ "use strict";

function Stats(_ref) {
var id = _ref.id;
var id = _ref.id,
stats = _ref.stats;
(0, _classCallCheck2["default"])(this, Stats);
this.id = id;
this.stats = {};
this._initializeStats(stats);
Object.seal(this);

@@ -30,11 +34,8 @@ }

var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'count';
this.stats[name] = this.stats[name] || new _stat["default"](name, type);
return this.stats[name];
return this._getOrCreate({
name: name,
type: type
});
}
}, {
key: "size",
value: function size() {
return Object.keys(this.stats).length;
}
}, {
key: "reset",

@@ -69,2 +70,37 @@ value: function reset() {

}
}, {
key: "_initializeStats",
value: function _initializeStats() {
var _this = this;
var stats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
stats.forEach(function (stat) {
return _this._getOrCreate(stat);
});
}
}, {
key: "_getOrCreate",
value: function _getOrCreate(stat) {
if (!stat || !stat.name) {
return null;
}
var name = stat.name,
type = stat.type;
if (!this.stats[name]) {
if (stat instanceof _stat["default"]) {
this.stats[name] = stat;
} else {
this.stats[name] = new _stat["default"](name, type);
}
}
return this.stats[name];
}
}, {
key: "size",
get: function get() {
return Object.keys(this.stats).length;
}
}]);

@@ -71,0 +107,0 @@ return Stats;

@@ -9,2 +9,3 @@ import './init';

export { default as Stats } from './lib/stats';
export { default as Stat } from './lib/stat';
export { default as Log } from './lib/log';

@@ -11,0 +12,0 @@ export { COLOR } from './utils/color';

import Stat from './stat';
export default class Stats {
constructor(_ref) {
let id = _ref.id;
let id = _ref.id,
stats = _ref.stats;
this.id = id;
this.stats = {};
this._initializeStats(stats);
Object.seal(this);

@@ -12,7 +16,9 @@ }

let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'count';
this.stats[name] = this.stats[name] || new Stat(name, type);
return this.stats[name];
return this._getOrCreate({
name,
type
});
}
size() {
get size() {
return Object.keys(this.stats).length;

@@ -48,3 +54,27 @@ }

_initializeStats() {
let stats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
stats.forEach(stat => this._getOrCreate(stat));
}
_getOrCreate(stat) {
if (!stat || !stat.name) {
return null;
}
const name = stat.name,
type = stat.type;
if (!this.stats[name]) {
if (stat instanceof Stat) {
this.stats[name] = stat;
} else {
this.stats[name] = new Stat(name, type);
}
}
return this.stats[name];
}
}
//# sourceMappingURL=stats.js.map

@@ -9,2 +9,3 @@ import './init';

export { default as Stats } from './lib/stats';
export { default as Stat } from './lib/stat';
export { default as Log } from './lib/log';

@@ -11,0 +12,0 @@ export { COLOR } from './utils/color';

@@ -7,3 +7,4 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

function Stats(_ref) {
var id = _ref.id;
var id = _ref.id,
stats = _ref.stats;

@@ -14,2 +15,5 @@ _classCallCheck(this, Stats);

this.stats = {};
this._initializeStats(stats);
Object.seal(this);

@@ -22,11 +26,8 @@ }

var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'count';
this.stats[name] = this.stats[name] || new Stat(name, type);
return this.stats[name];
return this._getOrCreate({
name: name,
type: type
});
}
}, {
key: "size",
value: function size() {
return Object.keys(this.stats).length;
}
}, {
key: "reset",

@@ -61,2 +62,37 @@ value: function reset() {

}
}, {
key: "_initializeStats",
value: function _initializeStats() {
var _this = this;
var stats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
stats.forEach(function (stat) {
return _this._getOrCreate(stat);
});
}
}, {
key: "_getOrCreate",
value: function _getOrCreate(stat) {
if (!stat || !stat.name) {
return null;
}
var name = stat.name,
type = stat.type;
if (!this.stats[name]) {
if (stat instanceof Stat) {
this.stats[name] = stat;
} else {
this.stats[name] = new Stat(name, type);
}
}
return this.stats[name];
}
}, {
key: "size",
get: function get() {
return Object.keys(this.stats).length;
}
}]);

@@ -63,0 +99,0 @@

4

package.json

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

"license": "MIT",
"version": "3.1.0-alpha.10",
"version": "3.1.0-alpha.11",
"keywords": [

@@ -36,3 +36,3 @@ "javascript",

},
"gitHead": "6b69db218a049d7bdc8d5d0f134460cbd3868251"
"gitHead": "0bd781fa52e2dce0c6dca432e51737a62b9121d0"
}

@@ -16,2 +16,3 @@ import './init';

export {default as Stats} from './lib/stats';
export {default as Stat} from './lib/stat';

@@ -18,0 +19,0 @@ // LOGGING

import Stat from './stat';
export default class Stats {
constructor({id}) {
constructor({id, stats}) {
this.id = id;
this.stats = {};
this._initializeStats(stats);
Object.seal(this);

@@ -12,7 +15,6 @@ }

get(name, type = 'count') {
this.stats[name] = this.stats[name] || new Stat(name, type);
return this.stats[name];
return this._getOrCreate({name, type});
}
size() {
get size() {
return Object.keys(this.stats).length;

@@ -49,2 +51,22 @@ }

}
_initializeStats(stats = []) {
stats.forEach(stat => this._getOrCreate(stat));
}
_getOrCreate(stat) {
if (!stat || !stat.name) {
return null;
}
const {name, type} = stat;
if (!this.stats[name]) {
if (stat instanceof Stat) {
this.stats[name] = stat;
} else {
this.stats[name] = new Stat(name, type);
}
}
return this.stats[name];
}
}

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