Skip to content

Commit

Permalink
Merge ca9d811 into c9782fd
Browse files Browse the repository at this point in the history
  • Loading branch information
abdonrd committed Oct 15, 2019
2 parents c9782fd + ca9d811 commit 09005d2
Show file tree
Hide file tree
Showing 15 changed files with 2,737 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.yml
Expand Up @@ -2,6 +2,9 @@ extends: eslint:recommended
env:
node: true
browser: true
parserOptions:
sourceType: "module"
ecmaVersion: 2015
rules:
block-scoped-var: 2
callback-return: 2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@ node_modules
.nyc_output/
coverage/
.DS_Store
dist/
5 changes: 2 additions & 3 deletions .travis.yml
@@ -1,8 +1,7 @@
language: node_js
node_js:
- "4"
- "6"
- "7"
- "8"
- "10"
- "12"
after_script:
- coveralls < coverage/lcov.info
2 changes: 1 addition & 1 deletion example/key_cmp.js
@@ -1,4 +1,4 @@
var stringify = require('../');
var stringify = require('../dist/index.cjs.js');

var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
Expand Down
2 changes: 1 addition & 1 deletion example/nested.js
@@ -1,3 +1,3 @@
var stringify = require('../');
var stringify = require('../dist/index.cjs.js');
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
console.log(stringify(obj));
2 changes: 1 addition & 1 deletion example/str.js
@@ -1,3 +1,3 @@
var stringify = require('../');
var stringify = require('../dist/index.cjs.js');
var obj = { c: 6, b: [4,5], a: 3 };
console.log(stringify(obj));
2 changes: 1 addition & 1 deletion example/value_cmp.js
@@ -1,4 +1,4 @@
var stringify = require('../');
var stringify = require('../dist/index.cjs.js');

var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
Expand Down
6 changes: 2 additions & 4 deletions index.js
@@ -1,6 +1,4 @@
'use strict';

module.exports = function (data, opts) {
export default function (data, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
Expand Down Expand Up @@ -56,4 +54,4 @@ module.exports = function (data, opts) {
seen.splice(seenIndex, 1);
return '{' + out + '}';
})(data);
};
}

0 comments on commit 09005d2

Please sign in to comment.