Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,1 @@ | ||
!function(n,e){function o(n){function e(n){var e=n.length;if(e){var t=n.indexOf("=");0>t&&(t=e);var i=decodeURIComponent(n.substr(0,t)),r=decodeURIComponent(n.substr(t+1));o[i]=r}}var o={};return n&&n.replace(/\+/g," ").split(/[&;]/).forEach(e),o}function t(n){function e(e){var t=n[e];if("undefined"!=typeof t&&null!==t&&!(t instanceof Function)){var i=encodeURIComponent(e)+"="+encodeURIComponent(t);o.push(i)}}var o=[];return"object"==typeof n&&null!==n&&Object.keys(n).map(e),o.join("&")}n||(n=e.qs={}),n.parse=o,n.stringify=t}("undefined"!=typeof exports&&exports,"undefined"!=typeof window?window:{}); | ||
!function(n,e){n||(n=e.qs={}),n.parse=function(n){var e={};n&&n.replace(/\+/g," ").split(/[&;]/).forEach((function(n){var o=n.length;if(!o)return;var t=n.indexOf("=");t<0&&(t=o);var r=decodeURIComponent(n.substr(0,t)),i=decodeURIComponent(n.substr(t+1));e[r]=i}));return e},n.stringify=function(n){var e=[];"object"==typeof n&&null!==n&&Object.keys(n).map((function(o){var t=n[o];if(null==t)return;if(t instanceof Function)return;var r=encodeURIComponent(o)+"="+encodeURIComponent(t);e.push(r)}));return e.join("&")}}("undefined"!=typeof exports&&exports,"undefined"!=typeof window?window:{}); |
{ | ||
"name": "qs-lite", | ||
"version": "0.0.1", | ||
"description": "Lightweight querystring parse() & stringify() at less than 1KB minified", | ||
"main": "qs-lite.js", | ||
"scripts": { | ||
"test": "make test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/kawanet/qs-lite.git" | ||
}, | ||
"version": "0.0.2", | ||
"author": "@kawanet", | ||
"license": "BSD", | ||
"bugs": { | ||
"url": "https://github.com/kawanet/qs-lite/issues" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"jsdoc": "^3.6.6", | ||
"jshint": "^2.12.0", | ||
"mocha": "^8.4.0", | ||
"terser": "^5.7.0" | ||
}, | ||
"files": [ | ||
"LICENSE", | ||
"README.md", | ||
"dist/qs-lite.min.js", | ||
"qs-lite.d.ts", | ||
"qs-lite.js" | ||
], | ||
"homepage": "https://github.com/kawanet/qs-lite", | ||
"jshintConfig": { | ||
"globals": { | ||
"exports": true, | ||
"window": true | ||
}, | ||
"mocha": true, | ||
"undef": true | ||
}, | ||
"keywords": [ | ||
"query", | ||
"ajax", | ||
"form", | ||
"qs", | ||
"ajax", | ||
"form" | ||
"query" | ||
], | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"jsdoc": "^3.3.2", | ||
"jshint": "^2.8.0", | ||
"mocha": "^2.2.5", | ||
"uglify-js": "^2.4.23" | ||
} | ||
"license": "BSD", | ||
"main": "qs-lite.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/kawanet/qs-lite.git" | ||
}, | ||
"scripts": { | ||
"build": "make", | ||
"fixpack": "fixpack", | ||
"prepack": "make clean all && npm test", | ||
"test": "make test" | ||
}, | ||
"types": "qs-lite.d.ts" | ||
} |
@@ -67,4 +67,3 @@ /** | ||
var val = obj[key]; | ||
if ("undefined" === typeof val) return; | ||
if (val === null) return; | ||
if (val == null) return; | ||
// if (val === "") return; | ||
@@ -71,0 +70,0 @@ if (val instanceof Function) return; |
# qs-lite | ||
[![Node.js CI](https://github.com/kawanet/qs-lite/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/kawanet/qs-lite/actions/) | ||
[![npm version](https://badge.fury.io/js/qs-lite.svg)](http://badge.fury.io/js/qs-lite) | ||
Lightweight querystring parse() & stringify() at less than 1KB minified | ||
### Usage | ||
### Node.js | ||
```js | ||
var qs = require("qs-lite"); | ||
const qs = require("qs-lite"); | ||
var string = qs.stringify({foo: "bar", hoge: "pomu"}); // => "foo=bar&hoge=pomu" | ||
const string = qs.stringify({foo: "bar", hoge: "pomu"}); // => "foo=bar&hoge=pomu" | ||
var obj = qs.parse("foo=bar&hoge=pomu"); // => { "foo": "bar", "hoge": "pomu" } | ||
const object = qs.parse("foo=bar&hoge=pomu"); // => { "foo": "bar", "hoge": "pomu" } | ||
``` | ||
### Node.js | ||
```sh | ||
npm install --save qs-lite | ||
``` | ||
### Browser | ||
```html | ||
<script src="https://raw.githubusercontent.com/kawanet/qs-lite/master/dist/qs-lite.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/qs-lite/dist/qs-lite.min.js"></script> | ||
<script> | ||
const string = qs.stringify({foo: "bar", hoge: "pomu"}); // => "foo=bar&hoge=pomu" | ||
const object = qs.parse("foo=bar&hoge=pomu"); // => { "foo": "bar", "hoge": "pomu" } | ||
</script> | ||
``` | ||
### TypeScript | ||
- https://github.com/kawanet/qs-lite/blob/master/qs-lite.d.ts | ||
### Repository | ||
@@ -41,4 +46,3 @@ | ||
Copyright (c) 2015, Yusuke Kawasaki | ||
Copyright (c) 2015-2021, Yusuke Kawasaki | ||
All rights reserved. |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48
6632
6
74
1