New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

code-stringify

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-stringify - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/expected

2

package.json
{
"name": "code-stringify",
"version": "1.0.1",
"version": "1.0.2",
"description": "Code-this is node.js module that converts JavaScript variables into source codes. Unlike `JSON.stringify`, code-stringify also deals with reference(object) types of variables.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,4 +0,2 @@

[![NPM version](https://badge.fury.io/js/code-stringify.png)](http://badge.fury.io/js/code-stringify)
[![Build Status](https://travis-ci.org/kaelzhang/node-code-stringify.png?branch=master)](https://travis-ci.org/kaelzhang/node-code-stringify)
[![Dependency Status](https://gemnasium.com/kaelzhang/node-code-stringify.png)](https://gemnasium.com/kaelzhang/node-code-stringify)
[![Build Status](https://travis-ci.org/kaelzhang/node-code-stringify.svg?branch=master)](https://travis-ci.org/kaelzhang/node-code-stringify)

@@ -32,5 +30,5 @@ # Code-this

fs.writeFileSync(
'output.js',
'module.exports = ' + code(a, null, 2)
);
'output.js',
'module.exports = ' + code(a, null, 2)
)
```

@@ -63,9 +61,8 @@

## Known Issues
- Code-this can't deal with recursive objects or arrays SO FAR.
- Can't deal with recursive objects or arrays SO FAR.
- `space` parameter could not affect the code indent inside functions.
- Code-this could not deal with variable scope so far.
- Could not deal with variable scope so far.
Those issues or tasks which should be done to enhance the module might be fixed in the future. Or there will be a million thanks if you fork and contribute ~~
Those issues or tasks which should be done to enhance the module might be fixed in the future. Or there will be a million thanks if you fork and contribute ~~

@@ -5,17 +5,39 @@ 'use strict';

var expect = require('chai').expect;
var fs = require('fs')
var node_path = require('path')
var obj = {
0: 1,
2: 1,
a: 1,
b: '2',
c: true,
d: function(n){return n;},
e: [ {a: 1}, [1, '2'], '1' ],
f: 1,
g: 1,
h: 1,
i: 1
bc: '2',
def: true,
'g-h': function(n){return n;},
$i: [
{
a: 1
},
[
1,
'2'
],
'1'
],
a0: 1,
'0ab': 1
}
var expected = fs.readFileSync(
node_path.join(__dirname, 'expected')
).toString()
code.QUOTE = '\''
describe('complex', function () {
it('all together', function () {
var result = code(obj, null, 2)
expect(result).to.equal(expected)
})
})
describe("primitive types", function(){

@@ -22,0 +44,0 @@ it("number", function(){

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