aboutsummaryrefslogtreecommitdiff
path: root/node_modules/koa-is-json
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/koa-is-json
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
Diffstat (limited to 'node_modules/koa-is-json')
-rw-r--r--node_modules/koa-is-json/.npmignore58
-rw-r--r--node_modules/koa-is-json/LICENSE22
-rw-r--r--node_modules/koa-is-json/README.md3
-rw-r--r--node_modules/koa-is-json/index.js14
-rw-r--r--node_modules/koa-is-json/package.json13
5 files changed, 110 insertions, 0 deletions
diff --git a/node_modules/koa-is-json/.npmignore b/node_modules/koa-is-json/.npmignore
new file mode 100644
index 00000000..7cb60ed8
--- /dev/null
+++ b/node_modules/koa-is-json/.npmignore
@@ -0,0 +1,58 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store*
+ehthumbs.db
+Icon?
+Thumbs.db
+
+# Node.js #
+###########
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log
+
+# Components #
+##############
+
+/build
+/components
diff --git a/node_modules/koa-is-json/LICENSE b/node_modules/koa-is-json/LICENSE
new file mode 100644
index 00000000..a7ae8ee9
--- /dev/null
+++ b/node_modules/koa-is-json/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/koa-is-json/README.md b/node_modules/koa-is-json/README.md
new file mode 100644
index 00000000..540f0540
--- /dev/null
+++ b/node_modules/koa-is-json/README.md
@@ -0,0 +1,3 @@
+# Koa Is JSON
+
+Check if a body is JSON
diff --git a/node_modules/koa-is-json/index.js b/node_modules/koa-is-json/index.js
new file mode 100644
index 00000000..40ca7694
--- /dev/null
+++ b/node_modules/koa-is-json/index.js
@@ -0,0 +1,14 @@
+
+module.exports = isJSON;
+
+/**
+ * Check if `body` should be interpreted as json.
+ */
+
+function isJSON(body) {
+ if (!body) return false;
+ if ('string' == typeof body) return false;
+ if ('function' == typeof body.pipe) return false;
+ if (Buffer.isBuffer(body)) return false;
+ return true;
+}
diff --git a/node_modules/koa-is-json/package.json b/node_modules/koa-is-json/package.json
new file mode 100644
index 00000000..2791e687
--- /dev/null
+++ b/node_modules/koa-is-json/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "koa-is-json",
+ "description": "check if a koa body should be interpreted as JSON",
+ "version": "1.0.0",
+ "author": {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com",
+ "twitter": "https://twitter.com/jongleberry"
+ },
+ "license": "MIT",
+ "repository": "koajs/is-json"
+}