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

cnd

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cnd - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

64

lib/BITSNPIECES.js

@@ -700,2 +700,66 @@ // Generated by CoffeeScript 1.9.0

this.size_of = function(x) {
return this._size_of(x, new Map());
};
this._size_of = function(x, seen) {
var CND, R, type;
CND = require('./main');
R = 0;
if (seen.has(x)) {
return R;
}
seen.set(x, 1);
switch (type = CND.type_of(x)) {
case 'boolean':
R += 4;
break;
case 'null':
case 'jsundefined':
case 'jsnan':
R += 1;
break;
case 'text':
case 'jsbuffer':
R += x.length * 2;
break;
case 'number':
R += 8;
break;
default:
R += this._size_of_container(x, seen);
}
return R;
};
this._size_of_container = function(x, seen) {
var R, key, _i, _len, _ref;
seen.set(x, 1);
R = 0;
_ref = Object.keys(x);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
R += this._size_of(x[key], seen);
}
return R;
};
this.get_local_ips = function() {
/* thx to http://stackoverflow.com/a/10756441/256361 */
var R, description, interface_, _, _i, _len, _ref;
R = [];
_ref = (require('os')).networkInterfaces();
for (_ in _ref) {
interface_ = _ref[_];
for (_i = 0, _len = interface_.length; _i < _len; _i++) {
description = interface_[_i];
if (description['family'] === 'IPv4' && !description['internal']) {
R.push(description['address']);
}
}
}
return R;
};
}).call(this);

2

package.json
{
"name": "cnd",
"version": "0.1.8",
"version": "0.1.9",
"description": "a grab-bag NodeJS package mainly for functionalities that used to live in coffeenode-trm, coffeenode-bitsnpieces, and coffeenode-types",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

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