Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui Quelhas committed Mar 28, 2015
1 parent 811c554 commit 463dc6c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nvpqs [![Build Status](https://travis-ci.org/ruiquelhas/nvpqs.png)](https://travis-ci.org/ruiquelhas/nvpqs) [![Dependencies](https://david-dm.org/ruiquelhas/nvpqs.svg)](https://david-dm.org/ruiquelhas/nvpqs)
# nvpqs [![Build Status](https://travis-ci.org/ruiquelhas/nvpqs.svg)](https://travis-ci.org/ruiquelhas/nvpqs) [![Dependencies](https://david-dm.org/ruiquelhas/nvpqs.svg)](https://david-dm.org/ruiquelhas/nvpqs)

Utilities for name-value pair encoded querystrings.

Expand Down
15 changes: 9 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

var qs = require('querystring');

var _ = require('lodash');
var isObject = require('lodash.isobject');
var keys = require('lodash.keys');
var cloneDeep = require('lodash.clonedeep');

var string = require('string');

var Parser = require('dot-object');
Expand Down Expand Up @@ -42,14 +45,14 @@ internals.isArray = function (obj) {

internals.transform = function (kva) {

var values = _.cloneDeep(kva);
var values = cloneDeep(kva);
var nested;

kva = [];

for (var key in values) {
nested = values[key];
if (_.isObject(nested)) {
if (isObject(nested)) {
kva.push(internals.parse(nested));
} else {
kva.push(nested);
Expand All @@ -61,13 +64,13 @@ internals.transform = function (kva) {

internals.parse = function (obj) {

var keyset = _.keys(obj);
var keyset = keys(obj);

return (function _parse(index) {

var key = keyset[index];

if (_.isObject(obj[key])) {
if (isObject(obj[key])) {
if (internals.isArray(obj[key])) {
obj[key] = internals.transform(obj[key]);
} else {
Expand Down Expand Up @@ -107,7 +110,7 @@ exports.stringify = function (input, del, sep, eq) {
value = obj[key];
dotNotationKey = (current ? [current, key].join(custom.del) : key);

if (_.isObject(value)) {
if (isObject(value)) {
_stringify(value, dotNotationKey);
} else {
output[dotNotationKey] = value;
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
},
"dependencies": {
"dot-object": "^0.6.0",
"lodash": "^2.4.1",
"lodash.clonedeep": "^3.0.0",
"lodash.isobject": "^3.0.1",
"lodash.keys": "^3.0.5",
"string": "^3.0.0"
},
"devDependencies": {
"code": "^1.3.0",
"lab": "^5.2.1"
"code": "^1.4.0",
"lab": "^5.5.1"
},
"scripts": {
"test": "./node_modules/.bin/lab -c"
Expand Down

0 comments on commit 463dc6c

Please sign in to comment.