add sort-keys as a clone call

This commit is contained in:
Erik Krogh Kristensen
2021-07-15 12:59:20 +02:00
parent 8ccdd4fb9f
commit aaa8969537
3 changed files with 20 additions and 1 deletions

View File

@@ -72,6 +72,19 @@ app.get('/baz', function(req, res) {
obj.p = p;
var other = jc.retrocycle(jc.decycle(obj));
res.send(p); // NOT OK
res.send(other.p); // NOT OK
});
const sortKeys = require('sort-keys');
app.get('/baz', function(req, res) {
let { p } = req.params;
var obj = {};
obj.p = p;
var other = sortKeys(obj);
res.send(p); // NOT OK
res.send(other.p); // NOT OK
});