Socket
Socket
Sign inDemoInstall

main

Package Overview
Dependencies
8
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.22 to 0.0.23

2

package.json
{
"name": "main",
"version": "0.0.22",
"version": "0.0.23",
"main": "index.js",

@@ -5,0 +5,0 @@ "description": "Provides useful tools for writing command line scripts",

@@ -24,9 +24,16 @@ "use strict";

it('should handle Objects', function() {
toolsSync.str({ foo: 'bar'}).should.equal(
it('should handle Objects (pretty)', function() {
toolsSync.str({ foo: 'bar'}, true).should.equal(
'{\n "foo": "bar"\n}');
toolsSync.str(['foo']).should.equal(
toolsSync.str(['foo'], true).should.equal(
'[\n "foo"\n]');
});
it('should handle Objects (normal)', function() {
toolsSync.str({ foo: 'bar'}).should.equal(
'{"foo":"bar"}');
toolsSync.str(['foo']).should.equal(
'["foo"]');
});
it('should handle anything else', function() {

@@ -33,0 +40,0 @@ toolsSync.str(5).should.equal('5');

@@ -7,3 +7,3 @@ "use strict";

exports.str = function(thing) {
exports.str = function(thing, prettify) {
// If it's a string, get out of here!

@@ -15,3 +15,8 @@ if (typeof thing === 'string') { return thing; }

if (typeof thing === 'object') {
try { var json = JSON.stringify(thing, null, 4); return json; }
try {
var json = prettify
? JSON.stringify(thing, null, 4)
: JSON.stringify(thing);
return json;
}
catch (e) {}

@@ -18,0 +23,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc