object-query-string
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -21,3 +21,3 @@ "use strict"; | ||
}, | ||
"filter[brands][]=Audi&filter[models][]=A4&filter[models][]=A6&filter[models][]=A8&filter[accidentFree]=true&sort=milage" | ||
"filter[brands][]=Audi&filter[models][]=A4&filter[models][]=A6&filter[models][]=A8&filter[accidentFree]=true&sort=mileage" | ||
], | ||
@@ -71,5 +71,5 @@ [ | ||
const [object, shouldEqual] = item; | ||
const value = index_1.default(object); | ||
const value = index_1.queryString(object); | ||
console.log(shouldEqual === value, '\t', value); | ||
} | ||
//# sourceMappingURL=example.js.map |
@@ -33,5 +33,6 @@ "use strict"; | ||
}; | ||
exports.default = (object, options) => { | ||
exports.queryString = (object, options) => { | ||
if (["object", "string", "number", "bigint"].indexOf(typeof object) < 0) | ||
return undefined; | ||
// @ts-ignore | ||
let opts = Object.assign({ | ||
@@ -38,0 +39,0 @@ separator: '&', |
{ | ||
"name": "object-query-string", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Stringify objects as URL Query Strings, a lightweight mock of jQuery.param without any dependencies!", | ||
@@ -5,0 +5,0 @@ "author": "ΔO - David Obdržálek <david@deltazero.cz>", |
@@ -7,10 +7,10 @@ # Object Query String | ||
## Example | ||
### Example | ||
````javascript | ||
// TypeScript | ||
import queryString from "object-query-string"; | ||
import { queryString } from './index'; | ||
// Node.js | ||
const queryString = require("object-query-string"); | ||
const { queryString } = require("./index"); | ||
@@ -30,3 +30,5 @@ const query = queryString({ | ||
``filter[brands][]=Audi&filter[models][]=A4&filter[models][]=A6&filter[models][]=A8&filter[accidentFree]=true&sort=milage`` | ||
```` | ||
filter[brands][]=Audi&filter[models][]=A4&filter[models][]=A6&filter[models][]=A8&filter[accidentFree]=true&sort=milage | ||
```` | ||
@@ -33,0 +35,0 @@ ----- |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es6", | ||
"target": "es2017", | ||
"lib": ["es2017", "dom"], | ||
"sourceMap": true | ||
@@ -6,0 +7,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7356
130
35