diff options
| author | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
| commit | f9159ea2d994e14180fb02ab562f0119513e67cf (patch) | |
| tree | 09d14cdf05456567156738b681379d4bccd64e5c /node_modules/snekfetch | |
| parent | 2020/04/03, 02:42, V1.2.1 (diff) | |
| download | s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.tar.xz s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.zip | |
2020/04/03, 02:47, V1.2.2
Diffstat (limited to 'node_modules/snekfetch')
41 files changed, 0 insertions, 3269 deletions
diff --git a/node_modules/snekfetch/.eslintrc.json b/node_modules/snekfetch/.eslintrc.json deleted file mode 100644 index 3dee806..0000000 --- a/node_modules/snekfetch/.eslintrc.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 2017 - }, - "env": { - "es6": true, - "node": true, - "browser": true - }, - "overrides": [ - { "files": ["*.mjs"], "parserOptions": { "sourceType": "module" } }, - { - "files": ["*.jsx"], - "parserOptions": { - "sourceType": "module", - "ecmaFeatures": { "jsx": true } - } - } - ], - "rules": { - "no-await-in-loop": "warn", - "no-compare-neg-zero": "error", - "no-extra-parens": ["warn", "all", { - "nestedBinaryExpressions": false - }], - "no-template-curly-in-string": "error", - "no-unsafe-negation": "error", - "valid-jsdoc": ["error", { - "requireReturn": false, - "requireReturnDescription": false, - "prefer": { - "return": "returns", - "arg": "param" - }, - "preferType": { - "String": "string", - "Number": "number", - "Boolean": "boolean", - "Symbol": "symbol", - "object": "Object", - "function": "Function", - "array": "Array", - "date": "Date", - "error": "Error", - "null": "void" - } - }], - - "accessor-pairs": "warn", - "array-callback-return": "error", - "complexity": "warn", - "consistent-return": "off", - "curly": ["error", "multi-or-nest", "consistent"], - "dot-location": ["error", "property"], - "dot-notation": "error", - "eqeqeq": "error", - "no-empty-function": "error", - "no-floating-decimal": "error", - "no-implied-eval": "error", - "no-invalid-this": "error", - "no-lone-blocks": "error", - "no-multi-spaces": "error", - "no-new-func": "error", - "no-new-wrappers": "error", - "no-new": "error", - "no-octal-escape": "error", - "no-return-assign": "error", - "no-return-await": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-throw-literal": "error", - "no-unmodified-loop-condition": "error", - "no-unused-expressions": "error", - "no-useless-call": "error", - "no-useless-concat": "error", - "no-useless-escape": "error", - "no-useless-return": "error", - "no-void": "error", - "no-warning-comments": "warn", - "prefer-promise-reject-errors": "error", - "require-await": "warn", - "wrap-iife": "error", - "yoda": "error", - - "no-label-var": "error", - "no-shadow": "error", - "no-undef-init": "error", - - "callback-return": "error", - "handle-callback-err": "error", - "no-mixed-requires": "error", - "no-new-require": "error", - "no-path-concat": "error", - - "array-bracket-spacing": "error", - "block-spacing": "error", - "brace-style": ["error", "1tbs", { "allowSingleLine": true }], - "capitalized-comments": ["off", "always", { "ignoreConsecutiveComments": true }], - "comma-dangle": ["error", "always-multiline"], - "comma-spacing": "error", - "comma-style": "error", - "computed-property-spacing": "error", - "consistent-this": ["error", "$this"], - "eol-last": "error", - "func-names": "error", - "func-name-matching": "error", - "func-style": ["error", "declaration", { "allowArrowFunctions": true }], - "indent": ["error", 2, { "SwitchCase": 1 }], - "key-spacing": "error", - "keyword-spacing": "error", - "max-depth": "error", - "max-len": ["error", 120, 2], - "max-nested-callbacks": ["error", { "max": 4 }], - "max-statements-per-line": ["error", { "max": 2 }], - "new-cap": "off", - "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }], - "no-array-constructor": "error", - "no-inline-comments": "off", - "no-lonely-if": "error", - "no-mixed-operators": "error", - "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], - "no-new-object": "error", - "no-spaced-func": "error", - "no-trailing-spaces": "error", - "no-unneeded-ternary": "error", - "no-whitespace-before-property": "error", - "nonblock-statement-body-position": ["error", "below"], - "object-curly-spacing": ["error", "always"], - "operator-assignment": "error", - "operator-linebreak": ["error", "after"], - "padded-blocks": ["error", "never"], - "quote-props": ["error", "as-needed"], - "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }], - "semi-spacing": "error", - "semi": "error", - "space-before-blocks": "error", - "space-before-function-paren": ["error", "never"], - "space-in-parens": "error", - "space-infix-ops": "error", - "space-unary-ops": "error", - "spaced-comment": "error", - "template-tag-spacing": "error", - "unicode-bom": "error", - - "arrow-body-style": "error", - "arrow-parens": ["error", "always"], - "arrow-spacing": "error", - "no-duplicate-imports": "error", - "no-useless-computed-key": "error", - "no-useless-constructor": "error", - "prefer-arrow-callback": "error", - "prefer-numeric-literals": "error", - "prefer-rest-params": "error", - "prefer-spread": "error", - "prefer-template": "error", - "rest-spread-spacing": "error", - "template-curly-spacing": "error", - "yield-star-spacing": "error" - } -} diff --git a/node_modules/snekfetch/.github/ISSUE_TEMPLATE.md b/node_modules/snekfetch/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 2033e79..0000000 --- a/node_modules/snekfetch/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,14 +0,0 @@ -Snekfetch version or commit hash: - - -Explaination of issue: - - -Example code to reproduce: -```js -// code here -``` - - -- [ ] Issue occurs in browser -- [ ] Issue occurs in node diff --git a/node_modules/snekfetch/.github/PULL_REQUEST_TEMPLATE.md b/node_modules/snekfetch/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index ce0c3f6..0000000 --- a/node_modules/snekfetch/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1 +0,0 @@ -if your pr is about typescript go away diff --git a/node_modules/snekfetch/.travis.yml b/node_modules/snekfetch/.travis.yml deleted file mode 100644 index 31e9136..0000000 --- a/node_modules/snekfetch/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: node_js -node_js: - - "8" -install: npm install -jobs: - include: - - stage: test - script: bash ./scripts/travis-test.sh - - stage: deploy - script: bash ./scripts/travis-deploy.sh -cache: - directories: - - node_modules -notifications: - email: false diff --git a/node_modules/snekfetch/CODE_OF_CONDUCT.md b/node_modules/snekfetch/CODE_OF_CONDUCT.md deleted file mode 100644 index 6ee186f..0000000 --- a/node_modules/snekfetch/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/node_modules/snekfetch/CONTRIBUTING.md b/node_modules/snekfetch/CONTRIBUTING.md deleted file mode 100644 index 36b463f..0000000 --- a/node_modules/snekfetch/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -don't break stuff when you pr diff --git a/node_modules/snekfetch/LICENSE b/node_modules/snekfetch/LICENSE deleted file mode 100644 index eac1233..0000000 --- a/node_modules/snekfetch/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Gus Caplan - -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/snekfetch/README.md b/node_modules/snekfetch/README.md deleted file mode 100644 index def5ede..0000000 --- a/node_modules/snekfetch/README.md +++ /dev/null @@ -1,49 +0,0 @@ -[![npm][download-badge]][npm] -[![David][dep-badge]][dep-link] -[![Coverage Status][coverage-badge]][coverage-link] -[![Build Status][build-badge]][build-link] - -[![NPM][large-badge]][stats-link] - -# snekfetch <sup>[![Version Badge][version-badge]][npm]</sup> - -Snekfetch is a fast, efficient, and user-friendly library for making HTTP requests. - -The API was inspired by superagent, however it is much smaller and faster. -In fact, in browser, it is a mere 4.4kb. - -Documentation is available at https://snekfetch.js.org/ - -## Some examples - -```javascript -const request = require('snekfetch'); - -request.post('https://httpbin.org/post') - .send({ usingGoodRequestLibrary: true }) - .then(r => console.log(r.body)); // r.body is object from json response - -request.get('https://s.gc.gy/o-SNAKES.jpg') - .then(r => fs.writeFile('download.jpg', r.body)); // r.body is buffer - -request.get('https://s.gc.gy/o-SNAKES.jpg') - .pipe(fs.createWriteStream('download.jpg')); // pipes -``` - -Available for browser as UMD from [unpkg][unpkg-link] -```html -<script src=https://unpkg.com/snekfetch></script> -``` - -[npm]: https://npmjs.org/package/snekfetch -[large-badge]: https://nodei.co/npm/snekfetch.png?downloads=true&downloadRank=true&stars=true -[stats-link]: https://nodei.co/npm/snekfetch/ -[version-badge]: https://versionbadge.now.sh/snekfetch.svg -[download-badge]: https://img.shields.io/npm/dt/snekfetch.svg?maxAge=3600 -[build-badge]: https://api.travis-ci.org/devsnek/snekfetch.svg?branch=master -[build-link]: https://travis-ci.org/devsnek/snekfetch -[dep-badge]: https://david-dm.org/devsnek/snekfetch.svg -[dep-link]: https://david-dm.org/devsnek/snekfetch -[coverage-badge]: https://coveralls.io/repos/github/devsnek/snekfetch/badge.svg?branch=master -[coverage-link]: https://coveralls.io/github/devsnek/snekfetch?branch=master -[unpkg-link]: https://unpkg.com/ diff --git a/node_modules/snekfetch/browser.js b/node_modules/snekfetch/browser.js deleted file mode 100644 index 0db0aa6..0000000 --- a/node_modules/snekfetch/browser.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Snekfetch=e():t.Snekfetch=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function s(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,s),r.l=!0,r.exports}return s.m=t,s.c=e,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){t.exports=s(1)},function(t,e,s){const n="undefined"!=typeof window,r=s(2),o=s(n?3:4);class i extends o.Extension{constructor(t,e,s={}){super(),this.options=Object.assign({version:1,qs:r,followRedirects:!0},s),this.request=o.buildRequest.call(this,t,e,s),s.headers&&this.set(s.headers),s.query&&this.query(s.query),s.data&&this.send(s.data)}query(t,e){if(this.request.query||(this.request.query={}),null!==t&&"object"==typeof t)for(const[e,s]of Object.entries(t))this.query(e,s);else this.request.query[t]=e;return this}set(t,e){if(null!==t&&"object"==typeof t)for(const e of Object.keys(t))this.set(e,t[e]);else this.request.setHeader(t,e);return this}attach(...t){const e=this.data instanceof o.FormData?this.data:this.data=new o.FormData;if("object"==typeof t[0])for(const[e,s]of Object.entries(t[0]))this.attach(e,s);else e.append(...t);return this}send(t){if(t instanceof o.FormData||o.shouldSendRaw(t))this.data=t;else if(null!==t&&"object"==typeof t){const e=this.request.getHeader("content-type");let s;e?e.includes("json")?s=JSON.stringify:e.includes("urlencoded")&&(s=this.options.qs.stringify):(this.set("Content-Type","application/json"),s=JSON.stringify),this.data=s(t)}else this.data=t;return this}then(t,e){return this._response?this._response.then(t,e):this._response=o.finalizeRequest.call(this).then(({response:t,raw:e,redirect:s,headers:n})=>{if(s){let e=this.request.method;[301,302].includes(t.statusCode)?("HEAD"!==e&&(e="GET"),this.data=null):303===t.statusCode&&(e="GET");const n=this.request.getHeaders();return delete n.host,new i(e,s,{data:this.data,headers:n,version:this.options.version})}const r=t.statusCode||t.status,a=this,u={request:this.request,get body(){delete u.body;const t=this.headers["content-type"];if(t&&t.includes("application/json"))try{u.body=JSON.parse(u.text)}catch(t){u.body=u.text}else t&&t.includes("application/x-www-form-urlencoded")?u.body=a.options.qs.parse(u.text):u.body=e;return u.body},text:e.toString(),ok:r>=200&&r<400,headers:n||t.headers,status:r,statusText:t.statusText||o.STATUS_CODES[t.statusCode]};if(u.ok)return u;{const t=new Error(`${u.status} ${u.statusText}`.trim());return Object.assign(t,u),Promise.reject(t)}}).then(t,e)}catch(t){return this.then(null,t)}end(t){return this.then(e=>t?t(null,e):e,e=>t?t(e,e.status?e:null):Promise.reject(e))}_finalizeRequest(){if(this.request&&("HEAD"!==this.request.method&&this.set("Accept-Encoding","gzip, deflate"),this.data&&this.data.getBoundary&&this.set("Content-Type",`multipart/form-data; boundary=${this.data.getBoundary()}`),this.request.query)){const[t,e]=this.request.path.split("?");this.request.path=`${t}?${this.options.qs.stringify(this.request.query)}${e?`&${e}`:""}`}}}i.METHODS=o.METHODS.concat("BREW").filter(t=>"M-SEARCH"!==t);for(const t of i.METHODS)i[t.toLowerCase()]=function(e,s){return new(this.prototype instanceof i?this:i)(t,e,s)};t.exports=i},function(t,e){({parse:t=>{const e={};for(const[s,n]of new Window.URLSearchParams(t).entries())e[s]=n;return e},stringify:t=>new window.URLSearchParams(t).toString()})},function(t,e){t.exports={buildRequest:function(t,e){return{method:t,path:e,redirect:this.options.followRedirects?"follow":"manual",headers:{},setHeader(t,e){this.headers[t.toLowerCase()]=e},getHeader(t){return this.headers[t.toLowerCase()]}}},finalizeRequest:function(){return this._finalizeRequest(),this.data&&(this.request.body=this.data),window.fetch(this.request.path,this.request).then(t=>t.text().then(e=>{const s={};for(const[e,n]of t.headers.entries())s[e.toLowerCase()]=n;return{response:t,raw:e,headers:s}}))},shouldSendRaw:()=>!1,METHODS:["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","PATCH"],STATUS_CODES:{},Extension:Object,FormData:window.FormData}},function(t,e){}])});
\ No newline at end of file diff --git a/node_modules/snekfetch/docs.js b/node_modules/snekfetch/docs.js deleted file mode 100644 index 06b2876..0000000 --- a/node_modules/snekfetch/docs.js +++ /dev/null @@ -1,55 +0,0 @@ -const Docma = require('docma'); -const Package = require('./package'); - -Docma.create() - .build({ - app: { - title: Package.name, - base: '/', - entrance: 'content:readme', - routing: 'query', - server: Docma.ServerType.GITHUB, - }, - markdown: { - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - smartLists: false, - smartypants: false, - tasks: false, - emoji: true, - }, - src: [ - { readme: './README.md' }, - { snekfetch: './src/index.js' }, - ], - dest: './docs', - jsdoc: { - plugins: ['jsdoc-dynamic'], - }, - template: { - options: { - title: Package.name, - navItems: [ - { - label: 'Readme', - href: '?content=readme', - }, - { - label: 'Documentation', - href: '?api=snekfetch', - iconClass: 'ico-book', - }, - { - label: 'GitHub', - href: Package.homepage, - target: '_blank', - iconClass: 'ico-md ico-github', - }, - ], - }, - }, - }) - .catch(console.error); // eslint-disable-line no-console diff --git a/node_modules/snekfetch/esm.mjs b/node_modules/snekfetch/esm.mjs deleted file mode 100644 index 8ec07a6..0000000 --- a/node_modules/snekfetch/esm.mjs +++ /dev/null @@ -1,41 +0,0 @@ -import Snekfetch from './index.js'; - -export default Snekfetch; - -export const version = Snekfetch.version; -export const METHODS = Snekfetch.METHODS; - -export const acl = Snekfetch.acl; -export const bind = Snekfetch.bind; -export const checkout = Snekfetch.checkout; -export const connect = Snekfetch.connect; -export const copy = Snekfetch.copy; -const _delete = Snekfetch.delete; -export { _delete as delete }; -export const get = Snekfetch.get; -export const head = Snekfetch.head; -export const link = Snekfetch.link; -export const lock = Snekfetch.lock; -export const merge = Snekfetch.merge; -export const mkactivity = Snekfetch.mkactivity; -export const mkcalendar = Snekfetch.mkcalendar; -export const mkcol = Snekfetch.mkcol; -export const move = Snekfetch.move; -export const notify = Snekfetch.notify; -export const options = Snekfetch.options; -export const patch = Snekfetch.patch; -export const post = Snekfetch.post; -export const propfind = Snekfetch.propfind; -export const proppatch = Snekfetch.proppatch; -export const purge = Snekfetch.purge; -export const put = Snekfetch.put; -export const rebind = Snekfetch.rebind; -export const report = Snekfetch.report; -export const search = Snekfetch.search; -export const subscribe = Snekfetch.subscribe; -export const trace = Snekfetch.trace; -export const unbind = Snekfetch.unbind; -export const unlink = Snekfetch.unlink; -export const unlock = Snekfetch.unlock; -export const unsubscribe = Snekfetch.unsubscribe; -export const brew = Snekfetch.brew; diff --git a/node_modules/snekfetch/index.js b/node_modules/snekfetch/index.js deleted file mode 100644 index 3fc7798..0000000 --- a/node_modules/snekfetch/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./src'); diff --git a/node_modules/snekfetch/package.json b/node_modules/snekfetch/package.json deleted file mode 100644 index b509147..0000000 --- a/node_modules/snekfetch/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "snekfetch@^3.6.4", - "_id": "[email protected]", - "_inBundle": false, - "_integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw==", - "_location": "/snekfetch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "snekfetch@^3.6.4", - "name": "snekfetch", - "escapedName": "snekfetch", - "rawSpec": "^3.6.4", - "saveSpec": null, - "fetchSpec": "^3.6.4" - }, - "_requiredBy": [ - "/discord.js" - ], - "_resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz", - "_shasum": "d13e80a616d892f3d38daae4289f4d258a645120", - "_spec": "snekfetch@^3.6.4", - "_where": "E:\\Documents\\GitHub\\s5nical\\node_modules\\discord.js", - "author": { - "name": "Gus Caplan", - "email": "[email protected]" - }, - "browser": { - "./src/node/index.js": false, - "./src/meta.js": false - }, - "bugs": { - "url": "https://github.com/devsnek/snekfetch/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": "use node-fetch instead", - "description": "Just do http requests without all that weird nastiness from other libs", - "devDependencies": { - "@snek/syncify": "0.0.6", - "coveralls": "^3.0.0", - "docma": "^1.5.1", - "eslint": "^4.8.0", - "jest": "^21.2.1", - "jsdoc-dynamic": "^1.0.4", - "json-filter-loader": "^1.0.0", - "node-fetch": "github:bitinn/node-fetch", - "uglifyjs-webpack-plugin": "^1.0.0-beta.2", - "webpack": "^3.8.1" - }, - "homepage": "https://snekfetch.js.org/", - "jest": { - "collectCoverage": true, - "collectCoverageFrom": [ - "src/**/*.js", - "!src/qs_mock.js", - "!src/node/mimeOfBuffer.js", - "!src/node/transports/http2.js" - ], - "verbose": true - }, - "jsdelivr": "browser.js", - "license": "MIT", - "main": "index.js", - "module": "esm.mjs", - "name": "snekfetch", - "repository": { - "type": "git", - "url": "git+https://github.com/devsnek/snekfetch.git" - }, - "scripts": { - "build:browser": "webpack", - "docs": "node docs.js", - "lint": "eslint **/*.js", - "prepublishOnly": "npm run build:browser", - "test": "node ./node_modules/.bin/jest", - "test:coveralls": "cat ./coverage/lcov.info | coveralls" - }, - "unpkg": "browser.js", - "version": "3.6.4" -} diff --git a/node_modules/snekfetch/scripts/travis-deploy.sh b/node_modules/snekfetch/scripts/travis-deploy.sh deleted file mode 100644 index 5af87dc..0000000 --- a/node_modules/snekfetch/scripts/travis-deploy.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Based on https://github.com/hydrabolt/discord.js-site/blob/master/deploy/deploy.sh - -set -e - -if [ "$TRAVIS_BRANCH" != "master" -o -n "$TRAVIS_TAG" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo -e "Not building for a non master branch push - building without deploying." - npm run docs - exit 0 -fi - -echo -e "Building for a master branch push - building and deploying." - -REPO=$(git config remote.origin.url) -SHA=$(git rev-parse --verify HEAD) - -TARGET_BRANCH="gh-pages" -git clone $REPO dist -b $TARGET_BRANCH - -npm run docs - -rsync -vau docs/ dist/ - -cd dist -git add --all . -git config user.name "Travis CI" -git config user.email "${COMMIT_EMAIL}" -git commit -m "Docs build: ${SHA}" || true -git push "https://${GH_TOKEN}@${GH_REF}" $TARGET_BRANCH diff --git a/node_modules/snekfetch/scripts/travis-test.sh b/node_modules/snekfetch/scripts/travis-test.sh deleted file mode 100644 index aa4e37d..0000000 --- a/node_modules/snekfetch/scripts/travis-test.sh +++ /dev/null @@ -1,14 +0,0 @@ -set -e - -npm run lint - -npm run test - -if [ "$TRAVIS_BRANCH" != "master" -o -n "$TRAVIS_TAG" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo -e "Not sending coverage for a non master branch push - covering without sending." - exit 0 -fi - -echo -e "Generating Coverage for a master branch push - covering and sending." - -npm run test:coveralls diff --git a/node_modules/snekfetch/src/browser.js b/node_modules/snekfetch/src/browser.js deleted file mode 100644 index 8820892..0000000 --- a/node_modules/snekfetch/src/browser.js +++ /dev/null @@ -1,36 +0,0 @@ -function buildRequest(method, url) { - return { - method, - path: url, - redirect: this.options.followRedirects ? 'follow' : 'manual', - headers: {}, - setHeader(name, value) { - this.headers[name.toLowerCase()] = value; - }, - getHeader(name) { - return this.headers[name.toLowerCase()]; - }, - }; -} - -function finalizeRequest() { - this._finalizeRequest(); - if (this.data) - this.request.body = this.data; - return window.fetch(this.request.path, this.request) - .then((r) => r.text().then((t) => { - const headers = {}; - for (const [k, v] of r.headers.entries()) - headers[k.toLowerCase()] = v; - return { response: r, raw: t, headers }; - })); -} - -module.exports = { - buildRequest, finalizeRequest, - shouldSendRaw: () => false, - METHODS: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH'], - STATUS_CODES: {}, - Extension: Object, - FormData: window.FormData, -}; diff --git a/node_modules/snekfetch/src/index.js b/node_modules/snekfetch/src/index.js deleted file mode 100644 index 5ffd6df..0000000 --- a/node_modules/snekfetch/src/index.js +++ /dev/null @@ -1,256 +0,0 @@ -const browser = typeof window !== 'undefined'; -const querystring = require('querystring'); -const transport = browser ? require('./browser') : require('./node'); - -/** - * Snekfetch - * @extends Stream.Readable - * @extends Promise - */ -class Snekfetch extends transport.Extension { - /** - * Options to pass to the Snekfetch constructor - * @typedef {object} SnekfetchOptions - * @memberof Snekfetch - * @property {object} [headers] Headers to initialize the request with - * @property {object|string|Buffer} [data] Data to initialize the request with - * @property {string|Object} [query] Query to intialize the request with - * @property {boolean} [followRedirects=true] If the request should follow redirects - * @property {object} [qs=querystring] Querystring module to use, any object providing - * `stringify` and `parse` for querystrings - * @property {number} [version = 1] The http version to use [1 or 2] - * @property {external:Agent} [agent] Whether to use an http agent - */ - - /** - * Create a request. - * Usually you'll want to do `Snekfetch#method(url [, options])` instead of - * `new Snekfetch(method, url [, options])` - * @param {string} method HTTP method - * @param {string} url URL - * @param {SnekfetchOptions} [opts] Options - */ - constructor(method, url, opts = {}) { - super(); - this.options = Object.assign({ version: 1, qs: querystring, followRedirects: true }, opts); - this.request = transport.buildRequest.call(this, method, url, opts); - if (opts.headers) - this.set(opts.headers); - if (opts.query) - this.query(opts.query); - if (opts.data) - this.send(opts.data); - } - - /** - * Add a query param to the request - * @param {string|Object} name Name of query param or object to add to query - * @param {string} [value] If name is a string value, this will be the value of the query param - * @returns {Snekfetch} This request - */ - query(name, value) { - if (!this.request.query) - this.request.query = {}; - if (name !== null && typeof name === 'object') { - for (const [k, v] of Object.entries(name)) - this.query(k, v); - } else { - this.request.query[name] = value; - } - - return this; - } - - /** - * Add a header to the request - * @param {string|Object} name Name of query param or object to add to headers - * @param {string} [value] If name is a string value, this will be the value of the header - * @returns {Snekfetch} This request - */ - set(name, value) { - if (name !== null && typeof name === 'object') { - for (const key of Object.keys(name)) - this.set(key, name[key]); - } else { - this.request.setHeader(name, value); - } - - return this; - } - - /** - * Attach a form data object - * @param {string} name Name of the form attachment - * @param {string|Object|Buffer} data Data for the attachment - * @param {string} [filename] Optional filename if form attachment name needs to be overridden - * @returns {Snekfetch} This request - */ - attach(...args) { - const form = this.data instanceof transport.FormData ? this.data : this.data = new transport.FormData(); - if (typeof args[0] === 'object') { - for (const [k, v] of Object.entries(args[0])) - this.attach(k, v); - } else { - form.append(...args); - } - - return this; - } - - /** - * Send data with the request - * @param {string|Buffer|Object} data Data to send - * @returns {Snekfetch} This request - */ - send(data) { - if (data instanceof transport.FormData || transport.shouldSendRaw(data)) { - this.data = data; - } else if (data !== null && typeof data === 'object') { - const header = this.request.getHeader('content-type'); - let serialize; - if (header) { - if (header.includes('json')) - serialize = JSON.stringify; - else if (header.includes('urlencoded')) - serialize = this.options.qs.stringify; - } else { - this.set('Content-Type', 'application/json'); - serialize = JSON.stringify; - } - this.data = serialize(data); - } else { - this.data = data; - } - return this; - } - - then(resolver, rejector) { - if (this._response) - return this._response.then(resolver, rejector); - // eslint-disable-next-line no-return-assign - return this._response = transport.finalizeRequest.call(this) - .then(({ response, raw, redirect, headers }) => { - if (redirect) { - let method = this.request.method; - if ([301, 302].includes(response.statusCode)) { - if (method !== 'HEAD') - method = 'GET'; - this.data = null; - } else if (response.statusCode === 303) { - method = 'GET'; - } - - const redirectHeaders = this.request.getHeaders(); - delete redirectHeaders.host; - return new Snekfetch(method, redirect, { - data: this.data, - headers: redirectHeaders, - version: this.options.version, - }); - } - - const statusCode = response.statusCode || response.status; - // forgive me :( - const self = this; // eslint-disable-line consistent-this - /** - * Response from Snekfetch - * @typedef {Object} SnekfetchResponse - * @memberof Snekfetch - * @prop {HTTP.Request} request - * @prop {?string|object|Buffer} body Processed response body - * @prop {string} text Raw response body - * @prop {boolean} ok If the response code is >= 200 and < 300 - * @prop {number} status HTTP status code - * @prop {string} statusText Human readable HTTP status - */ - const res = { - request: this.request, - get body() { - delete res.body; - const type = this.headers['content-type']; - if (type && type.includes('application/json')) { - try { - res.body = JSON.parse(res.text); - } catch (err) { - res.body = res.text; - } - } else if (type && type.includes('application/x-www-form-urlencoded')) { - res.body = self.options.qs.parse(res.text); - } else { - res.body = raw; - } - - return res.body; - }, - text: raw.toString(), - ok: statusCode >= 200 && statusCode < 400, - headers: headers || response.headers, - status: statusCode, - statusText: response.statusText || transport.STATUS_CODES[response.statusCode], - }; - - if (res.ok) { - return res; - } else { - const err = new Error(`${res.status} ${res.statusText}`.trim()); - Object.assign(err, res); - return Promise.reject(err); - } - }) - .then(resolver, rejector); - } - - catch(rejector) { - return this.then(null, rejector); - } - - /** - * End the request - * @param {Function} [cb] Optional callback to handle the response - * @returns {Promise} This request - */ - end(cb) { - return this.then( - (res) => cb ? cb(null, res) : res, - (err) => cb ? cb(err, err.status ? err : null) : Promise.reject(err) - ); - } - - _finalizeRequest() { - if (!this.request) - return; - - if (this.request.method !== 'HEAD') - this.set('Accept-Encoding', 'gzip, deflate'); - if (this.data && this.data.getBoundary) - this.set('Content-Type', `multipart/form-data; boundary=${this.data.getBoundary()}`); - - if (this.request.query) { - const [path, query] = this.request.path.split('?'); - this.request.path = `${path}?${this.options.qs.stringify(this.request.query)}${query ? `&${query}` : ''}`; - } - } -} - -/** - * Create a ((THIS)) request - * @dynamic this.METHODS - * @method Snekfetch.((THIS)lowerCase) - * @param {string} url The url to request - * @param {Snekfetch.snekfetchOptions} [opts] Options - * @returns {Snekfetch} - */ -Snekfetch.METHODS = transport.METHODS.concat('BREW').filter((m) => m !== 'M-SEARCH'); -for (const method of Snekfetch.METHODS) { - Snekfetch[method.toLowerCase()] = function runMethod(url, opts) { - const Constructor = this.prototype instanceof Snekfetch ? this : Snekfetch; - return new Constructor(method, url, opts); - }; -} - -module.exports = Snekfetch; - -/** - * @external Agent - * @see {@link https://nodejs.org/api/http.html#http_class_http_agent} - */ diff --git a/node_modules/snekfetch/src/node/FormData.js b/node_modules/snekfetch/src/node/FormData.js deleted file mode 100644 index f8270e2..0000000 --- a/node_modules/snekfetch/src/node/FormData.js +++ /dev/null @@ -1,51 +0,0 @@ -const path = require('path'); -const mime = require('./mime'); - -class FormData { - constructor() { - this.boundary = `--snekfetch--${Math.random().toString().slice(2, 7)}`; - this.buffers = []; - } - - append(name, data, filename) { - if (typeof data === 'undefined') - return; - let str = `\r\n--${this.boundary}\r\nContent-Disposition: form-data; name="${name}"`; - let mimetype = null; - if (filename) { - str += `; filename="${filename}"`; - mimetype = 'application/octet-stream'; - const extname = path.extname(filename).slice(1); - if (extname) - mimetype = mime.lookup(extname); - } - - if (data instanceof Buffer) { - mimetype = mime.buffer(data); - } else if (typeof data === 'object') { - mimetype = 'application/json'; - data = Buffer.from(JSON.stringify(data)); - } else { - data = Buffer.from(String(data)); - } - - if (mimetype) - str += `\r\nContent-Type: ${mimetype}`; - this.buffers.push(Buffer.from(`${str}\r\n\r\n`)); - this.buffers.push(data); - } - - getBoundary() { - return this.boundary; - } - - end() { - return Buffer.concat([...this.buffers, Buffer.from(`\r\n--${this.boundary}--`)]); - } - - get length() { - return this.buffers.reduce((sum, b) => sum + Buffer.byteLength(b), 0); - } -} - -module.exports = FormData; diff --git a/node_modules/snekfetch/src/node/index.js b/node_modules/snekfetch/src/node/index.js deleted file mode 100644 index ae9cbc0..0000000 --- a/node_modules/snekfetch/src/node/index.js +++ /dev/null @@ -1,151 +0,0 @@ -const zlib = require('zlib'); -const http = require('http'); -const https = require('https'); -const URL = require('url'); -const Stream = require('stream'); -const FormData = require('./FormData'); - -const Package = require('../../package.json'); - -const transports = { - 'http:': http, - 'https:': https, - 'file:': require('./transports/file'), -}; - -function buildRequest(method, url) { - /* istanbul ignore next */ - this._read = () => { - this.resume(); - if (this._response) - return; - this.catch((err) => this.emit('error', err)); - }; - - this.options.lastBuiltUrl = url; - - const options = URL.parse(url); - options.encoding = 'utf8'; - - if (!options.protocol) - throw new Error('URL must have a valid protocol'); - - const transport = transports[options.protocol]; - options.method = method.toUpperCase(); - - if (this.options.headers) - options.headers = this.options.headers; - - if (this.options.agent) - options.agent = this.options.agent; - else if (transport.Agent && this.options.followRedirects !== false) - options.agent = new transport.Agent({ keepAlive: true }); - - if (options.port) - options.port = parseInt(options.port); - - this.options._req = options; - const request = transport.request(options); - if (request.setNoDelay) - request.setNoDelay(true); - return request; -} - -function finalizeRequest() { - return new Promise((resolve, reject) => { - const request = this.request; - - let socket; - - const handleError = (err) => { - if (!err) - err = new Error('Unknown error occured'); - err.request = request; - reject(err); - if (socket) - socket.removeListener('error', handleError); - }; - - request.once('abort', handleError); - request.once('error', handleError); - request.once('socket', (s) => { - socket = s; - s.once('error', handleError); - }); - - request.once('response', (response) => { - if (socket) - socket.removeListener('error', handleError); - let stream = response; - if (shouldUnzip(response)) { - stream = response.pipe(zlib.createUnzip({ - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH, - })); - } - - if (this.options.followRedirects !== false && [301, 302, 303, 307, 308].includes(response.statusCode)) { - resolve({ - response, - redirect: URL.resolve(this.options.lastBuiltUrl, response.headers.location), - }); - response.destroy(); - } else { - const body = []; - - stream.on('data', (chunk) => { - if (!this.push(chunk)) - this.pause(); - body.push(chunk); - }); - - stream.once('end', () => { - this.push(null); - const raw = Buffer.concat(body); - resolve({ response, raw, redirect: false }); - }); - } - }); - - if (!this.request.getHeader('user-agent')) - this.set('User-Agent', `snekfetch/${Package.version} (${Package.homepage})`); - - this._finalizeRequest(); - let data = this.data; - if (data && data.end) - data = data.end(); - if (Array.isArray(data)) { - for (const chunk of data) - request.write(chunk); - request.end(); - } else if (data instanceof Stream) { - data.pipe(request); - } else if (data instanceof Buffer) { - request.end(data); - } else if (data) { - request.end(data); - } else { - request.end(); - } - }); -} - -function shouldSendRaw(data) { - return data instanceof Buffer || data instanceof Stream; -} - -function shouldUnzip(res) { - if (res.statusCode === 204 || res.statusCode === 304) - return false; - if (res.headers['content-length'] === '0') - return false; - return /^\s*(?:deflate|gzip)\s*$/.test(res.headers['content-encoding']); -} - -module.exports = { - buildRequest, finalizeRequest, shouldSendRaw, - METHODS: http.METHODS, - STATUS_CODES: http.STATUS_CODES, - FormData, - Extension: Stream.Readable, -}; diff --git a/node_modules/snekfetch/src/node/mime.js b/node_modules/snekfetch/src/node/mime.js deleted file mode 100644 index 8fb7983..0000000 --- a/node_modules/snekfetch/src/node/mime.js +++ /dev/null @@ -1,16 +0,0 @@ -const mimes = require('./mimes.json'); -const mimeOfBuffer = require('./mimeOfBuffer.js'); - -function lookupMime(ext) { - return mimes[ext.replace(/^\./, '')] || mimes.bin; -} - -function lookupBuffer(buffer) { - const ret = mimeOfBuffer(buffer); - return ret ? ret.mime : mimes.bin; -} - -module.exports = { - buffer: lookupBuffer, - lookup: lookupMime, -}; diff --git a/node_modules/snekfetch/src/node/mimeOfBuffer.js b/node_modules/snekfetch/src/node/mimeOfBuffer.js deleted file mode 100644 index e92ccb8..0000000 --- a/node_modules/snekfetch/src/node/mimeOfBuffer.js +++ /dev/null @@ -1,546 +0,0 @@ -/* eslint complexity: 0 */ - -// from file-type by @sindresorhus under the MIT license -// https://github.com/sindresorhus/file-type - -function mimeOfBuffer(input) { - const buf = new Uint8Array(input); - - if (!(buf && buf.length > 1)) - return null; - - - if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) { - return { - ext: 'jpg', - mime: 'image/jpeg', - }; - } - - if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) { - return { - ext: 'png', - mime: 'image/png', - }; - } - - if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) { - return { - ext: 'gif', - mime: 'image/gif', - }; - } - - if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) { - return { - ext: 'webp', - mime: 'image/webp', - }; - } - - if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x49 && buf[3] === 0x46) { - return { - ext: 'flif', - mime: 'image/flif', - }; - } - - // needs to be before `tif` check - if ( - ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || - (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52 - ) { - return { - ext: 'cr2', - mime: 'image/x-canon-cr2', - }; - } - - if ( - (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || - (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A) - ) { - return { - ext: 'tif', - mime: 'image/tiff', - }; - } - - if (buf[0] === 0x42 && buf[1] === 0x4D) { - return { - ext: 'bmp', - mime: 'image/bmp', - }; - } - - if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) { - return { - ext: 'jxr', - mime: 'image/vnd.ms-photo', - }; - } - - if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) { - return { - ext: 'psd', - mime: 'image/vnd.adobe.photoshop', - }; - } - - // needs to be before `zip` check - if ( - buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && - buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && - buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && - buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && - buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && - buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && - buf[57] === 0x70 - ) { - return { - ext: 'epub', - mime: 'application/epub+zip', - }; - } - - // needs to be before `zip` check - // assumes signed .xpi from addons.mozilla.org - if ( - buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x4D && buf[31] === 0x45 && - buf[32] === 0x54 && buf[33] === 0x41 && buf[34] === 0x2D && buf[35] === 0x49 && buf[36] === 0x4E && - buf[37] === 0x46 && buf[38] === 0x2F && buf[39] === 0x6D && buf[40] === 0x6F && buf[41] === 0x7A && - buf[42] === 0x69 && buf[43] === 0x6C && buf[44] === 0x6C && buf[45] === 0x61 && buf[46] === 0x2E && - buf[47] === 0x72 && buf[48] === 0x73 && buf[49] === 0x61 - ) { - return { - ext: 'xpi', - mime: 'application/x-xpinstall', - }; - } - - if ( - buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && - (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8) - ) { - return { - ext: 'zip', - mime: 'application/zip', - }; - } - - if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) { - return { - ext: 'tar', - mime: 'application/x-tar', - }; - } - - if ( - buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && - (buf[6] === 0x0 || buf[6] === 0x1) - ) { - return { - ext: 'rar', - mime: 'application/x-rar-compressed', - }; - } - - if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) { - return { - ext: 'gz', - mime: 'application/gzip', - }; - } - - if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) { - return { - ext: 'bz2', - mime: 'application/x-bzip2', - }; - } - - if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) { - return { - ext: '7z', - mime: 'application/x-7z-compressed', - }; - } - - if (buf[0] === 0x78 && buf[1] === 0x01) { - return { - ext: 'dmg', - mime: 'application/x-apple-diskimage', - }; - } - - if ( - (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && - buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) || - (buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) || - (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && - buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && - buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && - buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && - buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D) || - (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && - buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x69 && buf[9] === 0x73 && buf[10] === 0x6F && - buf[11] === 0x6D) || - (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1c && buf[4] === 0x66 && buf[5] === 0x74 && - buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && - buf[11] === 0x32 && buf[12] === 0x0 && buf[13] === 0x0 && buf[14] === 0x0 && buf[15] === 0x0) - ) { - return { - ext: 'mp4', - mime: 'video/mp4', - }; - } - - if ( - buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && - buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56 - ) { - return { - ext: 'm4v', - mime: 'video/x-m4v', - }; - } - - if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) { - return { - ext: 'mid', - mime: 'audio/midi', - }; - } - - // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska - if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) { - const sliced = buf.subarray(4, 4 + 4096); - const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82); - - if (idPos >= 0) { - const docTypePos = idPos + 3; - const findDocType = (type) => Array.from(type).every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); - - if (findDocType('matroska')) { - return { - ext: 'mkv', - mime: 'video/x-matroska', - }; - } - if (findDocType('webm')) { - return { - ext: 'webm', - mime: 'video/webm', - }; - } - } - } - - if ( - buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && - buf[6] === 0x79 && buf[7] === 0x70 - ) { - return { - ext: 'mov', - mime: 'video/quicktime', - }; - } - - if ( - buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && - buf[10] === 0x49 - ) { - return { - ext: 'avi', - mime: 'video/x-msvideo', - }; - } - - if ( - buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && - buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9 - ) { - return { - ext: 'wmv', - mime: 'video/x-ms-wmv', - }; - } - - if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') { - return { - ext: 'mpg', - mime: 'video/mpeg', - }; - } - - if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) { - return { - ext: 'mp3', - mime: 'audio/mpeg', - }; - } - - if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && - buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20) - ) { - return { - ext: 'm4a', - mime: 'audio/m4a', - }; - } - - // needs to be before `ogg` check - if ( - buf[28] === 0x4F && buf[29] === 0x70 && buf[30] === 0x75 && buf[31] === 0x73 && buf[32] === 0x48 && - buf[33] === 0x65 && buf[34] === 0x61 && buf[35] === 0x64 - ) { - return { - ext: 'opus', - mime: 'audio/opus', - }; - } - - if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) { - return { - ext: 'ogg', - mime: 'audio/ogg', - }; - } - - if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) { - return { - ext: 'flac', - mime: 'audio/x-flac', - }; - } - - if ( - buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && - buf[10] === 0x56 && buf[11] === 0x45 - ) { - return { - ext: 'wav', - mime: 'audio/x-wav', - }; - } - - if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) { - return { - ext: 'amr', - mime: 'audio/amr', - }; - } - - if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) { - return { - ext: 'pdf', - mime: 'application/pdf', - }; - } - - if (buf[0] === 0x4D && buf[1] === 0x5A) { - return { - ext: 'exe', - mime: 'application/x-msdownload', - }; - } - - if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) { - return { - ext: 'swf', - mime: 'application/x-shockwave-flash', - }; - } - - if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) { - return { - ext: 'rtf', - mime: 'application/rtf', - }; - } - - if ( - (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46) && - ( - (buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) || - (buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F) - ) - ) { - return { - ext: 'woff', - mime: 'application/font-woff', - }; - } - - if ( - (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32) && - ( - (buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) || - (buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F) - ) - ) { - return { - ext: 'woff2', - mime: 'application/font-woff', - }; - } - - if ( - (buf[34] === 0x4C && buf[35] === 0x50) && - ( - (buf[8] === 0x00 && buf[9] === 0x00 && buf[10] === 0x01) || - (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x02) || - (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02) - ) - ) { - return { - ext: 'eot', - mime: 'application/octet-stream', - }; - } - - if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) { - return { - ext: 'ttf', - mime: 'application/font-sfnt', - }; - } - - if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) { - return { - ext: 'otf', - mime: 'application/font-sfnt', - }; - } - - if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) { - return { - ext: 'ico', - mime: 'image/x-icon', - }; - } - - if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) { - return { - ext: 'flv', - mime: 'video/x-flv', - }; - } - - if (buf[0] === 0x25 && buf[1] === 0x21) { - return { - ext: 'ps', - mime: 'application/postscript', - }; - } - - if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) { - return { - ext: 'xz', - mime: 'application/x-xz', - }; - } - - if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) { - return { - ext: 'sqlite', - mime: 'application/x-sqlite3', - }; - } - - if (buf[0] === 0x4E && buf[1] === 0x45 && buf[2] === 0x53 && buf[3] === 0x1A) { - return { - ext: 'nes', - mime: 'application/x-nintendo-nes-rom', - }; - } - - if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] === 0x34) { - return { - ext: 'crx', - mime: 'application/x-google-chrome-extension', - }; - } - - if ( - (buf[0] === 0x4D && buf[1] === 0x53 && buf[2] === 0x43 && buf[3] === 0x46) || - (buf[0] === 0x49 && buf[1] === 0x53 && buf[2] === 0x63 && buf[3] === 0x28) - ) { - return { - ext: 'cab', - mime: 'application/vnd.ms-cab-compressed', - }; - } - - // needs to be before `ar` check - if ( - buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && - buf[6] === 0x3E && buf[7] === 0x0A && buf[8] === 0x64 && buf[9] === 0x65 && buf[10] === 0x62 && buf[11] === 0x69 && - buf[12] === 0x61 && buf[13] === 0x6E && buf[14] === 0x2D && buf[15] === 0x62 && buf[16] === 0x69 && - buf[17] === 0x6E && buf[18] === 0x61 && buf[19] === 0x72 && buf[20] === 0x79 - ) { - return { - ext: 'deb', - mime: 'application/x-deb', - }; - } - - if ( - buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && - buf[6] === 0x3E - ) { - return { - ext: 'ar', - mime: 'application/x-unix-archive', - }; - } - - if (buf[0] === 0xED && buf[1] === 0xAB && buf[2] === 0xEE && buf[3] === 0xDB) { - return { - ext: 'rpm', - mime: 'application/x-rpm', - }; - } - - if ( - (buf[0] === 0x1F && buf[1] === 0xA0) || - (buf[0] === 0x1F && buf[1] === 0x9D) - ) { - return { - ext: 'Z', - mime: 'application/x-compress', - }; - } - - if (buf[0] === 0x4C && buf[1] === 0x5A && buf[2] === 0x49 && buf[3] === 0x50) { - return { - ext: 'lz', - mime: 'application/x-lzip', - }; - } - - if ( - buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && - buf[6] === 0x1A && buf[7] === 0xE1 - ) { - return { - ext: 'msi', - mime: 'application/x-msi', - }; - } - - if ( - buf[0] === 0x06 && buf[1] === 0x0E && buf[2] === 0x2B && buf[3] === 0x34 && buf[4] === 0x02 && buf[5] === 0x05 && - buf[6] === 0x01 && buf[7] === 0x01 && buf[8] === 0x0D && buf[9] === 0x01 && buf[10] === 0x02 && buf[11] === 0x01 && - buf[12] === 0x01 && buf[13] === 0x02 - ) { - return { - ext: 'mxf', - mime: 'application/mxf', - }; - } - - return null; -} - -module.exports = mimeOfBuffer; diff --git a/node_modules/snekfetch/src/node/mimes.json b/node_modules/snekfetch/src/node/mimes.json deleted file mode 100644 index 928e6c5..0000000 --- a/node_modules/snekfetch/src/node/mimes.json +++ /dev/null @@ -1,1049 +0,0 @@ -{ - "123": "application/vnd.lotus-1-2-3", - "ez": "application/andrew-inset", - "aw": "application/applixware", - "atom": "application/atom+xml", - "atomcat": "application/atomcat+xml", - "atomsvc": "application/atomsvc+xml", - "bdoc": "application/x-bdoc", - "ccxml": "application/ccxml+xml", - "cdmia": "application/cdmi-capability", - "cdmic": "application/cdmi-container", - "cdmid": "application/cdmi-domain", - "cdmio": "application/cdmi-object", - "cdmiq": "application/cdmi-queue", - "cu": "application/cu-seeme", - "mpd": "application/dash+xml", - "davmount": "application/davmount+xml", - "dbk": "application/docbook+xml", - "dssc": "application/dssc+der", - "xdssc": "application/dssc+xml", - "ecma": "application/ecmascript", - "emma": "application/emma+xml", - "epub": "application/epub+zip", - "exi": "application/exi", - "pfr": "application/font-tdpfr", - "woff": "application/font-woff", - "woff2": "application/font-woff2", - "geojson": "application/geo+json", - "gml": "application/gml+xml", - "gpx": "application/gpx+xml", - "gxf": "application/gxf", - "stk": "application/hyperstudio", - "ink": "application/inkml+xml", - "inkml": "application/inkml+xml", - "ipfix": "application/ipfix", - "jar": "application/java-archive", - "war": "application/java-archive", - "ear": "application/java-archive", - "ser": "application/java-serialized-object", - "class": "application/java-vm", - "js": "application/javascript", - "json": "application/json", - "map": "application/json", - "json5": "application/json5", - "jsonml": "application/jsonml+json", - "jsonld": "application/ld+json", - "lostxml": "application/lost+xml", - "hqx": "application/mac-binhex40", - "cpt": "application/mac-compactpro", - "mads": "application/mads+xml", - "webmanifest": "application/manifest+json", - "mrc": "application/marc", - "mrcx": "application/marcxml+xml", - "ma": "application/mathematica", - "nb": "application/mathematica", - "mb": "application/mathematica", - "mathml": "application/mathml+xml", - "mbox": "application/mbox", - "mscml": "application/mediaservercontrol+xml", - "metalink": "application/metalink+xml", - "meta4": "application/metalink4+xml", - "mets": "application/mets+xml", - "mods": "application/mods+xml", - "m21": "application/mp21", - "mp21": "application/mp21", - "mp4s": "application/mp4", - "m4p": "application/mp4", - "doc": "application/msword", - "dot": "application/msword", - "mxf": "application/mxf", - "bin": "application/octet-stream", - "dms": "application/octet-stream", - "lrf": "application/octet-stream", - "mar": "application/octet-stream", - "so": "application/octet-stream", - "dist": "application/octet-stream", - "distz": "application/octet-stream", - "pkg": "application/octet-stream", - "bpk": "application/octet-stream", - "dump": "application/octet-stream", - "elc": "application/octet-stream", - "deploy": "application/octet-stream", - "exe": "application/x-msdownload", - "dll": "application/x-msdownload", - "deb": "application/x-debian-package", - "dmg": "application/x-apple-diskimage", - "iso": "application/x-iso9660-image", - "img": "application/octet-stream", - "msi": "application/x-msdownload", - "msp": "application/octet-stream", - "msm": "application/octet-stream", - "buffer": "application/octet-stream", - "oda": "application/oda", - "opf": "application/oebps-package+xml", - "ogx": "application/ogg", - "omdoc": "application/omdoc+xml", - "onetoc": "application/onenote", - "onetoc2": "application/onenote", - "onetmp": "application/onenote", - "onepkg": "application/onenote", - "oxps": "application/oxps", - "xer": "application/patch-ops-error+xml", - "pdf": "application/pdf", - "pgp": "application/pgp-encrypted", - "asc": "application/pgp-signature", - "sig": "application/pgp-signature", - "prf": "application/pics-rules", - "p10": "application/pkcs10", - "p7m": "application/pkcs7-mime", - "p7c": "application/pkcs7-mime", - "p7s": "application/pkcs7-signature", - "p8": "application/pkcs8", - "ac": "application/pkix-attr-cert", - "cer": "application/pkix-cert", - "crl": "application/pkix-crl", - "pkipath": "application/pkix-pkipath", - "pki": "application/pkixcmp", - "pls": "application/pls+xml", - "ai": "application/postscript", - "eps": "application/postscript", - "ps": "application/postscript", - "cww": "application/prs.cww", - "pskcxml": "application/pskc+xml", - "rdf": "application/rdf+xml", - "rif": "application/reginfo+xml", - "rnc": "application/relax-ng-compact-syntax", - "rl": "application/resource-lists+xml", - "rld": "application/resource-lists-diff+xml", - "rs": "application/rls-services+xml", - "gbr": "application/rpki-ghostbusters", - "mft": "application/rpki-manifest", - "roa": "application/rpki-roa", - "rsd": "application/rsd+xml", - "rss": "application/rss+xml", - "rtf": "text/rtf", - "sbml": "application/sbml+xml", - "scq": "application/scvp-cv-request", - "scs": "application/scvp-cv-response", - "spq": "application/scvp-vp-request", - "spp": "application/scvp-vp-response", - "sdp": "application/sdp", - "setpay": "application/set-payment-initiation", - "setreg": "application/set-registration-initiation", - "shf": "application/shf+xml", - "smi": "application/smil+xml", - "smil": "application/smil+xml", - "rq": "application/sparql-query", - "srx": "application/sparql-results+xml", - "gram": "application/srgs", - "grxml": "application/srgs+xml", - "sru": "application/sru+xml", - "ssdl": "application/ssdl+xml", - "ssml": "application/ssml+xml", - "tei": "application/tei+xml", - "teicorpus": "application/tei+xml", - "tfi": "application/thraud+xml", - "tsd": "application/timestamped-data", - "plb": "application/vnd.3gpp.pic-bw-large", - "psb": "application/vnd.3gpp.pic-bw-small", - "pvb": "application/vnd.3gpp.pic-bw-var", - "tcap": "application/vnd.3gpp2.tcap", - "pwn": "application/vnd.3m.post-it-notes", - "aso": "application/vnd.accpac.simply.aso", - "imp": "application/vnd.accpac.simply.imp", - "acu": "application/vnd.acucobol", - "atc": "application/vnd.acucorp", - "acutc": "application/vnd.acucorp", - "air": "application/vnd.adobe.air-application-installer-package+zip", - "fcdt": "application/vnd.adobe.formscentral.fcdt", - "fxp": "application/vnd.adobe.fxp", - "fxpl": "application/vnd.adobe.fxp", - "xdp": "application/vnd.adobe.xdp+xml", - "xfdf": "application/vnd.adobe.xfdf", - "ahead": "application/vnd.ahead.space", - "azf": "application/vnd.airzip.filesecure.azf", - "azs": "application/vnd.airzip.filesecure.azs", - "azw": "application/vnd.amazon.ebook", - "acc": "application/vnd.americandynamics.acc", - "ami": "application/vnd.amiga.ami", - "apk": "application/vnd.android.package-archive", - "cii": "application/vnd.anser-web-certificate-issue-initiation", - "fti": "application/vnd.anser-web-funds-transfer-initiation", - "atx": "application/vnd.antix.game-component", - "mpkg": "application/vnd.apple.installer+xml", - "m3u8": "application/vnd.apple.mpegurl", - "pkpass": "application/vnd.apple.pkpass", - "swi": "application/vnd.aristanetworks.swi", - "iota": "application/vnd.astraea-software.iota", - "aep": "application/vnd.audiograph", - "mpm": "application/vnd.blueice.multipass", - "bmi": "application/vnd.bmi", - "rep": "application/vnd.businessobjects", - "cdxml": "application/vnd.chemdraw+xml", - "mmd": "application/vnd.chipnuts.karaoke-mmd", - "cdy": "application/vnd.cinderella", - "cla": "application/vnd.claymore", - "rp9": "application/vnd.cloanto.rp9", - "c4g": "application/vnd.clonk.c4group", - "c4d": "application/vnd.clonk.c4group", - "c4f": "application/vnd.clonk.c4group", - "c4p": "application/vnd.clonk.c4group", - "c4u": "application/vnd.clonk.c4group", - "c11amc": "application/vnd.cluetrust.cartomobile-config", - "c11amz": "application/vnd.cluetrust.cartomobile-config-pkg", - "csp": "application/vnd.commonspace", - "cdbcmsg": "application/vnd.contact.cmsg", - "cmc": "application/vnd.cosmocaller", - "clkx": "application/vnd.crick.clicker", - "clkk": "application/vnd.crick.clicker.keyboard", - "clkp": "application/vnd.crick.clicker.palette", - "clkt": "application/vnd.crick.clicker.template", - "clkw": "application/vnd.crick.clicker.wordbank", - "wbs": "application/vnd.criticaltools.wbs+xml", - "pml": "application/vnd.ctc-posml", - "ppd": "application/vnd.cups-ppd", - "car": "application/vnd.curl.car", - "pcurl": "application/vnd.curl.pcurl", - "dart": "application/vnd.dart", - "rdz": "application/vnd.data-vision.rdz", - "uvf": "application/vnd.dece.data", - "uvvf": "application/vnd.dece.data", - "uvd": "application/vnd.dece.data", - "uvvd": "application/vnd.dece.data", - "uvt": "application/vnd.dece.ttml+xml", - "uvvt": "application/vnd.dece.ttml+xml", - "uvx": "application/vnd.dece.unspecified", - "uvvx": "application/vnd.dece.unspecified", - "uvz": "application/vnd.dece.zip", - "uvvz": "application/vnd.dece.zip", - "fe_launch": "application/vnd.denovo.fcselayout-link", - "dna": "application/vnd.dna", - "mlp": "application/vnd.dolby.mlp", - "dpg": "application/vnd.dpgraph", - "dfac": "application/vnd.dreamfactory", - "kpxx": "application/vnd.ds-keypoint", - "ait": "application/vnd.dvb.ait", - "svc": "application/vnd.dvb.service", - "geo": "application/vnd.dynageo", - "mag": "application/vnd.ecowin.chart", - "nml": "application/vnd.enliven", - "esf": "application/vnd.epson.esf", - "msf": "application/vnd.epson.msf", - "qam": "application/vnd.epson.quickanime", - "slt": "application/vnd.epson.salt", - "ssf": "application/vnd.epson.ssf", - "es3": "application/vnd.eszigno3+xml", - "et3": "application/vnd.eszigno3+xml", - "ez2": "application/vnd.ezpix-album", - "ez3": "application/vnd.ezpix-package", - "fdf": "application/vnd.fdf", - "mseed": "application/vnd.fdsn.mseed", - "seed": "application/vnd.fdsn.seed", - "dataless": "application/vnd.fdsn.seed", - "gph": "application/vnd.flographit", - "ftc": "application/vnd.fluxtime.clip", - "fm": "application/vnd.framemaker", - "frame": "application/vnd.framemaker", - "maker": "application/vnd.framemaker", - "book": "application/vnd.framemaker", - "fnc": "application/vnd.frogans.fnc", - "ltf": "application/vnd.frogans.ltf", - "fsc": "application/vnd.fsc.weblaunch", - "oas": "application/vnd.fujitsu.oasys", - "oa2": "application/vnd.fujitsu.oasys2", - "oa3": "application/vnd.fujitsu.oasys3", - "fg5": "application/vnd.fujitsu.oasysgp", - "bh2": "application/vnd.fujitsu.oasysprs", - "ddd": "application/vnd.fujixerox.ddd", - "xdw": "application/vnd.fujixerox.docuworks", - "xbd": "application/vnd.fujixerox.docuworks.binder", - "fzs": "application/vnd.fuzzysheet", - "txd": "application/vnd.genomatix.tuxedo", - "ggb": "application/vnd.geogebra.file", - "ggt": "application/vnd.geogebra.tool", - "gex": "application/vnd.geometry-explorer", - "gre": "application/vnd.geometry-explorer", - "gxt": "application/vnd.geonext", - "g2w": "application/vnd.geoplan", - "g3w": "application/vnd.geospace", - "gmx": "application/vnd.gmx", - "gdoc": "application/vnd.google-apps.document", - "gslides": "application/vnd.google-apps.presentation", - "gsheet": "application/vnd.google-apps.spreadsheet", - "kml": "application/vnd.google-earth.kml+xml", - "kmz": "application/vnd.google-earth.kmz", - "gqf": "application/vnd.grafeq", - "gqs": "application/vnd.grafeq", - "gac": "application/vnd.groove-account", - "ghf": "application/vnd.groove-help", - "gim": "application/vnd.groove-identity-message", - "grv": "application/vnd.groove-injector", - "gtm": "application/vnd.groove-tool-message", - "tpl": "application/vnd.groove-tool-template", - "vcg": "application/vnd.groove-vcard", - "hal": "application/vnd.hal+xml", - "zmm": "application/vnd.handheld-entertainment+xml", - "hbci": "application/vnd.hbci", - "les": "application/vnd.hhe.lesson-player", - "hpgl": "application/vnd.hp-hpgl", - "hpid": "application/vnd.hp-hpid", - "hps": "application/vnd.hp-hps", - "jlt": "application/vnd.hp-jlyt", - "pcl": "application/vnd.hp-pcl", - "pclxl": "application/vnd.hp-pclxl", - "sfd-hdstx": "application/vnd.hydrostatix.sof-data", - "mpy": "application/vnd.ibm.minipay", - "afp": "application/vnd.ibm.modcap", - "listafp": "application/vnd.ibm.modcap", - "list3820": "application/vnd.ibm.modcap", - "irm": "application/vnd.ibm.rights-management", - "sc": "application/vnd.ibm.secure-container", - "icc": "application/vnd.iccprofile", - "icm": "application/vnd.iccprofile", - "igl": "application/vnd.igloader", - "ivp": "application/vnd.immervision-ivp", - "ivu": "application/vnd.immervision-ivu", - "igm": "application/vnd.insors.igm", - "xpw": "application/vnd.intercon.formnet", - "xpx": "application/vnd.intercon.formnet", - "i2g": "application/vnd.intergeo", - "qbo": "application/vnd.intu.qbo", - "qfx": "application/vnd.intu.qfx", - "rcprofile": "application/vnd.ipunplugged.rcprofile", - "irp": "application/vnd.irepository.package+xml", - "xpr": "application/vnd.is-xpr", - "fcs": "application/vnd.isac.fcs", - "jam": "application/vnd.jam", - "rms": "application/vnd.jcp.javame.midlet-rms", - "jisp": "application/vnd.jisp", - "joda": "application/vnd.joost.joda-archive", - "ktz": "application/vnd.kahootz", - "ktr": "application/vnd.kahootz", - "karbon": "application/vnd.kde.karbon", - "chrt": "application/vnd.kde.kchart", - "kfo": "application/vnd.kde.kformula", - "flw": "application/vnd.kde.kivio", - "kon": "application/vnd.kde.kontour", - "kpr": "application/vnd.kde.kpresenter", - "kpt": "application/vnd.kde.kpresenter", - "ksp": "application/vnd.kde.kspread", - "kwd": "application/vnd.kde.kword", - "kwt": "application/vnd.kde.kword", - "htke": "application/vnd.kenameaapp", - "kia": "application/vnd.kidspiration", - "kne": "application/vnd.kinar", - "knp": "application/vnd.kinar", - "skp": "application/vnd.koan", - "skd": "application/vnd.koan", - "skt": "application/vnd.koan", - "skm": "application/vnd.koan", - "sse": "application/vnd.kodak-descriptor", - "lasxml": "application/vnd.las.las+xml", - "lbd": "application/vnd.llamagraphics.life-balance.desktop", - "lbe": "application/vnd.llamagraphics.life-balance.exchange+xml", - "apr": "application/vnd.lotus-approach", - "pre": "application/vnd.lotus-freelance", - "nsf": "application/vnd.lotus-notes", - "org": "application/vnd.lotus-organizer", - "scm": "application/vnd.lotus-screencam", - "lwp": "application/vnd.lotus-wordpro", - "portpkg": "application/vnd.macports.portpkg", - "mcd": "application/vnd.mcd", - "mc1": "application/vnd.medcalcdata", - "cdkey": "application/vnd.mediastation.cdkey", - "mwf": "application/vnd.mfer", - "mfm": "application/vnd.mfmp", - "flo": "application/vnd.micrografx.flo", - "igx": "application/vnd.micrografx.igx", - "mif": "application/vnd.mif", - "daf": "application/vnd.mobius.daf", - "dis": "application/vnd.mobius.dis", - "mbk": "application/vnd.mobius.mbk", - "mqy": "application/vnd.mobius.mqy", - "msl": "application/vnd.mobius.msl", - "plc": "application/vnd.mobius.plc", - "txf": "application/vnd.mobius.txf", - "mpn": "application/vnd.mophun.application", - "mpc": "application/vnd.mophun.certificate", - "xul": "application/vnd.mozilla.xul+xml", - "cil": "application/vnd.ms-artgalry", - "cab": "application/vnd.ms-cab-compressed", - "xls": "application/vnd.ms-excel", - "xlm": "application/vnd.ms-excel", - "xla": "application/vnd.ms-excel", - "xlc": "application/vnd.ms-excel", - "xlt": "application/vnd.ms-excel", - "xlw": "application/vnd.ms-excel", - "xlam": "application/vnd.ms-excel.addin.macroenabled.12", - "xlsb": "application/vnd.ms-excel.sheet.binary.macroenabled.12", - "xlsm": "application/vnd.ms-excel.sheet.macroenabled.12", - "xltm": "application/vnd.ms-excel.template.macroenabled.12", - "eot": "application/vnd.ms-fontobject", - "chm": "application/vnd.ms-htmlhelp", - "ims": "application/vnd.ms-ims", - "lrm": "application/vnd.ms-lrm", - "thmx": "application/vnd.ms-officetheme", - "cat": "application/vnd.ms-pki.seccat", - "stl": "application/vnd.ms-pki.stl", - "ppt": "application/vnd.ms-powerpoint", - "pps": "application/vnd.ms-powerpoint", - "pot": "application/vnd.ms-powerpoint", - "ppam": "application/vnd.ms-powerpoint.addin.macroenabled.12", - "pptm": "application/vnd.ms-powerpoint.presentation.macroenabled.12", - "sldm": "application/vnd.ms-powerpoint.slide.macroenabled.12", - "ppsm": "application/vnd.ms-powerpoint.slideshow.macroenabled.12", - "potm": "application/vnd.ms-powerpoint.template.macroenabled.12", - "mpp": "application/vnd.ms-project", - "mpt": "application/vnd.ms-project", - "docm": "application/vnd.ms-word.document.macroenabled.12", - "dotm": "application/vnd.ms-word.template.macroenabled.12", - "wps": "application/vnd.ms-works", - "wks": "application/vnd.ms-works", - "wcm": "application/vnd.ms-works", - "wdb": "application/vnd.ms-works", - "wpl": "application/vnd.ms-wpl", - "xps": "application/vnd.ms-xpsdocument", - "mseq": "application/vnd.mseq", - "mus": "application/vnd.musician", - "msty": "application/vnd.muvee.style", - "taglet": "application/vnd.mynfc", - "nlu": "application/vnd.neurolanguage.nlu", - "ntf": "application/vnd.nitf", - "nitf": "application/vnd.nitf", - "nnd": "application/vnd.noblenet-directory", - "nns": "application/vnd.noblenet-sealer", - "nnw": "application/vnd.noblenet-web", - "ngdat": "application/vnd.nokia.n-gage.data", - "n-gage": "application/vnd.nokia.n-gage.symbian.install", - "rpst": "application/vnd.nokia.radio-preset", - "rpss": "application/vnd.nokia.radio-presets", - "edm": "application/vnd.novadigm.edm", - "edx": "application/vnd.novadigm.edx", - "ext": "application/vnd.novadigm.ext", - "odc": "application/vnd.oasis.opendocument.chart", - "otc": "application/vnd.oasis.opendocument.chart-template", - "odb": "application/vnd.oasis.opendocument.database", - "odf": "application/vnd.oasis.opendocument.formula", - "odft": "application/vnd.oasis.opendocument.formula-template", - "odg": "application/vnd.oasis.opendocument.graphics", - "otg": "application/vnd.oasis.opendocument.graphics-template", - "odi": "application/vnd.oasis.opendocument.image", - "oti": "application/vnd.oasis.opendocument.image-template", - "odp": "application/vnd.oasis.opendocument.presentation", - "otp": "application/vnd.oasis.opendocument.presentation-template", - "ods": "application/vnd.oasis.opendocument.spreadsheet", - "ots": "application/vnd.oasis.opendocument.spreadsheet-template", - "odt": "application/vnd.oasis.opendocument.text", - "odm": "application/vnd.oasis.opendocument.text-master", - "ott": "application/vnd.oasis.opendocument.text-template", - "oth": "application/vnd.oasis.opendocument.text-web", - "xo": "application/vnd.olpc-sugar", - "dd2": "application/vnd.oma.dd2+xml", - "oxt": "application/vnd.openofficeorg.extension", - "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", - "sldx": "application/vnd.openxmlformats-officedocument.presentationml.slide", - "ppsx": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", - "potx": "application/vnd.openxmlformats-officedocument.presentationml.template", - "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "xltx": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", - "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - "dotx": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", - "mgp": "application/vnd.osgeo.mapguide.package", - "dp": "application/vnd.osgi.dp", - "esa": "application/vnd.osgi.subsystem", - "pdb": "application/x-pilot", - "pqa": "application/vnd.palm", - "oprc": "application/vnd.palm", - "paw": "application/vnd.pawaafile", - "str": "application/vnd.pg.format", - "ei6": "application/vnd.pg.osasli", - "efif": "application/vnd.picsel", - "wg": "application/vnd.pmi.widget", - "plf": "application/vnd.pocketlearn", - "pbd": "application/vnd.powerbuilder6", - "box": "application/vnd.previewsystems.box", - "mgz": "application/vnd.proteus.magazine", - "qps": "application/vnd.publishare-delta-tree", - "ptid": "application/vnd.pvi.ptid1", - "qxd": "application/vnd.quark.quarkxpress", - "qxt": "application/vnd.quark.quarkxpress", - "qwd": "application/vnd.quark.quarkxpress", - "qwt": "application/vnd.quark.quarkxpress", - "qxl": "application/vnd.quark.quarkxpress", - "qxb": "application/vnd.quark.quarkxpress", - "bed": "application/vnd.realvnc.bed", - "mxl": "application/vnd.recordare.musicxml", - "musicxml": "application/vnd.recordare.musicxml+xml", - "cryptonote": "application/vnd.rig.cryptonote", - "cod": "application/vnd.rim.cod", - "rm": "application/vnd.rn-realmedia", - "rmvb": "application/vnd.rn-realmedia-vbr", - "link66": "application/vnd.route66.link66+xml", - "st": "application/vnd.sailingtracker.track", - "see": "application/vnd.seemail", - "sema": "application/vnd.sema", - "semd": "application/vnd.semd", - "semf": "application/vnd.semf", - "ifm": "application/vnd.shana.informed.formdata", - "itp": "application/vnd.shana.informed.formtemplate", - "iif": "application/vnd.shana.informed.interchange", - "ipk": "application/vnd.shana.informed.package", - "twd": "application/vnd.simtech-mindmapper", - "twds": "application/vnd.simtech-mindmapper", - "mmf": "application/vnd.smaf", - "teacher": "application/vnd.smart.teacher", - "sdkm": "application/vnd.solent.sdkm+xml", - "sdkd": "application/vnd.solent.sdkm+xml", - "dxp": "application/vnd.spotfire.dxp", - "sfs": "application/vnd.spotfire.sfs", - "sdc": "application/vnd.stardivision.calc", - "sda": "application/vnd.stardivision.draw", - "sdd": "application/vnd.stardivision.impress", - "smf": "application/vnd.stardivision.math", - "sdw": "application/vnd.stardivision.writer", - "vor": "application/vnd.stardivision.writer", - "sgl": "application/vnd.stardivision.writer-global", - "smzip": "application/vnd.stepmania.package", - "sm": "application/vnd.stepmania.stepchart", - "sxc": "application/vnd.sun.xml.calc", - "stc": "application/vnd.sun.xml.calc.template", - "sxd": "application/vnd.sun.xml.draw", - "std": "application/vnd.sun.xml.draw.template", - "sxi": "application/vnd.sun.xml.impress", - "sti": "application/vnd.sun.xml.impress.template", - "sxm": "application/vnd.sun.xml.math", - "sxw": "application/vnd.sun.xml.writer", - "sxg": "application/vnd.sun.xml.writer.global", - "stw": "application/vnd.sun.xml.writer.template", - "sus": "application/vnd.sus-calendar", - "susp": "application/vnd.sus-calendar", - "svd": "application/vnd.svd", - "sis": "application/vnd.symbian.install", - "sisx": "application/vnd.symbian.install", - "xsm": "application/vnd.syncml+xml", - "bdm": "application/vnd.syncml.dm+wbxml", - "xdm": "application/vnd.syncml.dm+xml", - "tao": "application/vnd.tao.intent-module-archive", - "pcap": "application/vnd.tcpdump.pcap", - "cap": "application/vnd.tcpdump.pcap", - "dmp": "application/vnd.tcpdump.pcap", - "tmo": "application/vnd.tmobile-livetv", - "tpt": "application/vnd.trid.tpt", - "mxs": "application/vnd.triscape.mxs", - "tra": "application/vnd.trueapp", - "ufd": "application/vnd.ufdl", - "ufdl": "application/vnd.ufdl", - "utz": "application/vnd.uiq.theme", - "umj": "application/vnd.umajin", - "unityweb": "application/vnd.unity", - "uoml": "application/vnd.uoml+xml", - "vcx": "application/vnd.vcx", - "vsd": "application/vnd.visio", - "vst": "application/vnd.visio", - "vss": "application/vnd.visio", - "vsw": "application/vnd.visio", - "vis": "application/vnd.visionary", - "vsf": "application/vnd.vsf", - "wbxml": "application/vnd.wap.wbxml", - "wmlc": "application/vnd.wap.wmlc", - "wmlsc": "application/vnd.wap.wmlscriptc", - "wtb": "application/vnd.webturbo", - "nbp": "application/vnd.wolfram.player", - "wpd": "application/vnd.wordperfect", - "wqd": "application/vnd.wqd", - "stf": "application/vnd.wt.stf", - "xar": "application/vnd.xara", - "xfdl": "application/vnd.xfdl", - "hvd": "application/vnd.yamaha.hv-dic", - "hvs": "application/vnd.yamaha.hv-script", - "hvp": "application/vnd.yamaha.hv-voice", - "osf": "application/vnd.yamaha.openscoreformat", - "osfpvg": "application/vnd.yamaha.openscoreformat.osfpvg+xml", - "saf": "application/vnd.yamaha.smaf-audio", - "spf": "application/vnd.yamaha.smaf-phrase", - "cmp": "application/vnd.yellowriver-custom-menu", - "zir": "application/vnd.zul", - "zirz": "application/vnd.zul", - "zaz": "application/vnd.zzazz.deck+xml", - "vxml": "application/voicexml+xml", - "wgt": "application/widget", - "hlp": "application/winhlp", - "wsdl": "application/wsdl+xml", - "wspolicy": "application/wspolicy+xml", - "7z": "application/x-7z-compressed", - "abw": "application/x-abiword", - "ace": "application/x-ace-compressed", - "aab": "application/x-authorware-bin", - "x32": "application/x-authorware-bin", - "u32": "application/x-authorware-bin", - "vox": "application/x-authorware-bin", - "aam": "application/x-authorware-map", - "aas": "application/x-authorware-seg", - "bcpio": "application/x-bcpio", - "torrent": "application/x-bittorrent", - "blb": "application/x-blorb", - "blorb": "application/x-blorb", - "bz": "application/x-bzip", - "bz2": "application/x-bzip2", - "boz": "application/x-bzip2", - "cbr": "application/x-cbr", - "cba": "application/x-cbr", - "cbt": "application/x-cbr", - "cbz": "application/x-cbr", - "cb7": "application/x-cbr", - "vcd": "application/x-cdlink", - "cfs": "application/x-cfs-compressed", - "chat": "application/x-chat", - "pgn": "application/x-chess-pgn", - "crx": "application/x-chrome-extension", - "cco": "application/x-cocoa", - "nsc": "application/x-conference", - "cpio": "application/x-cpio", - "csh": "application/x-csh", - "udeb": "application/x-debian-package", - "dgc": "application/x-dgc-compressed", - "dir": "application/x-director", - "dcr": "application/x-director", - "dxr": "application/x-director", - "cst": "application/x-director", - "cct": "application/x-director", - "cxt": "application/x-director", - "w3d": "application/x-director", - "fgd": "application/x-director", - "swa": "application/x-director", - "wad": "application/x-doom", - "ncx": "application/x-dtbncx+xml", - "dtb": "application/x-dtbook+xml", - "res": "application/x-dtbresource+xml", - "dvi": "application/x-dvi", - "evy": "application/x-envoy", - "eva": "application/x-eva", - "bdf": "application/x-font-bdf", - "gsf": "application/x-font-ghostscript", - "psf": "application/x-font-linux-psf", - "otf": "font/opentype", - "pcf": "application/x-font-pcf", - "snf": "application/x-font-snf", - "ttf": "application/x-font-ttf", - "ttc": "application/x-font-ttf", - "pfa": "application/x-font-type1", - "pfb": "application/x-font-type1", - "pfm": "application/x-font-type1", - "afm": "application/x-font-type1", - "arc": "application/x-freearc", - "spl": "application/x-futuresplash", - "gca": "application/x-gca-compressed", - "ulx": "application/x-glulx", - "gnumeric": "application/x-gnumeric", - "gramps": "application/x-gramps-xml", - "gtar": "application/x-gtar", - "hdf": "application/x-hdf", - "php": "application/x-httpd-php", - "install": "application/x-install-instructions", - "jardiff": "application/x-java-archive-diff", - "jnlp": "application/x-java-jnlp-file", - "latex": "application/x-latex", - "luac": "application/x-lua-bytecode", - "lzh": "application/x-lzh-compressed", - "lha": "application/x-lzh-compressed", - "run": "application/x-makeself", - "mie": "application/x-mie", - "prc": "application/x-pilot", - "mobi": "application/x-mobipocket-ebook", - "application": "application/x-ms-application", - "lnk": "application/x-ms-shortcut", - "wmd": "application/x-ms-wmd", - "wmz": "application/x-msmetafile", - "xbap": "application/x-ms-xbap", - "mdb": "application/x-msaccess", - "obd": "application/x-msbinder", - "crd": "application/x-mscardfile", - "clp": "application/x-msclip", - "com": "application/x-msdownload", - "bat": "application/x-msdownload", - "mvb": "application/x-msmediaview", - "m13": "application/x-msmediaview", - "m14": "application/x-msmediaview", - "wmf": "application/x-msmetafile", - "emf": "application/x-msmetafile", - "emz": "application/x-msmetafile", - "mny": "application/x-msmoney", - "pub": "application/x-mspublisher", - "scd": "application/x-msschedule", - "trm": "application/x-msterminal", - "wri": "application/x-mswrite", - "nc": "application/x-netcdf", - "cdf": "application/x-netcdf", - "pac": "application/x-ns-proxy-autoconfig", - "nzb": "application/x-nzb", - "pl": "application/x-perl", - "pm": "application/x-perl", - "p12": "application/x-pkcs12", - "pfx": "application/x-pkcs12", - "p7b": "application/x-pkcs7-certificates", - "spc": "application/x-pkcs7-certificates", - "p7r": "application/x-pkcs7-certreqresp", - "rar": "application/x-rar-compressed", - "rpm": "application/x-redhat-package-manager", - "ris": "application/x-research-info-systems", - "sea": "application/x-sea", - "sh": "application/x-sh", - "shar": "application/x-shar", - "swf": "application/x-shockwave-flash", - "xap": "application/x-silverlight-app", - "sql": "application/x-sql", - "sit": "application/x-stuffit", - "sitx": "application/x-stuffitx", - "srt": "application/x-subrip", - "sv4cpio": "application/x-sv4cpio", - "sv4crc": "application/x-sv4crc", - "t3": "application/x-t3vm-image", - "gam": "application/x-tads", - "tar": "application/x-tar", - "tcl": "application/x-tcl", - "tk": "application/x-tcl", - "tex": "application/x-tex", - "tfm": "application/x-tex-tfm", - "texinfo": "application/x-texinfo", - "texi": "application/x-texinfo", - "obj": "application/x-tgif", - "ustar": "application/x-ustar", - "src": "application/x-wais-source", - "webapp": "application/x-web-app-manifest+json", - "der": "application/x-x509-ca-cert", - "crt": "application/x-x509-ca-cert", - "pem": "application/x-x509-ca-cert", - "fig": "application/x-xfig", - "xlf": "application/x-xliff+xml", - "xpi": "application/x-xpinstall", - "xz": "application/x-xz", - "z1": "application/x-zmachine", - "z2": "application/x-zmachine", - "z3": "application/x-zmachine", - "z4": "application/x-zmachine", - "z5": "application/x-zmachine", - "z6": "application/x-zmachine", - "z7": "application/x-zmachine", - "z8": "application/x-zmachine", - "xaml": "application/xaml+xml", - "xdf": "application/xcap-diff+xml", - "xenc": "application/xenc+xml", - "xhtml": "application/xhtml+xml", - "xht": "application/xhtml+xml", - "xml": "text/xml", - "xsl": "application/xml", - "xsd": "application/xml", - "rng": "application/xml", - "dtd": "application/xml-dtd", - "xop": "application/xop+xml", - "xpl": "application/xproc+xml", - "xslt": "application/xslt+xml", - "xspf": "application/xspf+xml", - "mxml": "application/xv+xml", - "xhvml": "application/xv+xml", - "xvml": "application/xv+xml", - "xvm": "application/xv+xml", - "yang": "application/yang", - "yin": "application/yin+xml", - "zip": "application/zip", - "3gpp": "video/3gpp", - "adp": "audio/adpcm", - "au": "audio/basic", - "snd": "audio/basic", - "mid": "audio/midi", - "midi": "audio/midi", - "kar": "audio/midi", - "rmi": "audio/midi", - "mp3": "audio/mpeg", - "m4a": "audio/x-m4a", - "mp4a": "audio/mp4", - "mpga": "audio/mpeg", - "mp2": "audio/mpeg", - "mp2a": "audio/mpeg", - "m2a": "audio/mpeg", - "m3a": "audio/mpeg", - "oga": "audio/ogg", - "ogg": "audio/ogg", - "spx": "audio/ogg", - "s3m": "audio/s3m", - "sil": "audio/silk", - "uva": "audio/vnd.dece.audio", - "uvva": "audio/vnd.dece.audio", - "eol": "audio/vnd.digital-winds", - "dra": "audio/vnd.dra", - "dts": "audio/vnd.dts", - "dtshd": "audio/vnd.dts.hd", - "lvp": "audio/vnd.lucent.voice", - "pya": "audio/vnd.ms-playready.media.pya", - "ecelp4800": "audio/vnd.nuera.ecelp4800", - "ecelp7470": "audio/vnd.nuera.ecelp7470", - "ecelp9600": "audio/vnd.nuera.ecelp9600", - "rip": "audio/vnd.rip", - "wav": "audio/x-wav", - "weba": "audio/webm", - "aac": "audio/x-aac", - "aif": "audio/x-aiff", - "aiff": "audio/x-aiff", - "aifc": "audio/x-aiff", - "caf": "audio/x-caf", - "flac": "audio/x-flac", - "mka": "audio/x-matroska", - "m3u": "audio/x-mpegurl", - "wax": "audio/x-ms-wax", - "wma": "audio/x-ms-wma", - "ram": "audio/x-pn-realaudio", - "ra": "audio/x-realaudio", - "rmp": "audio/x-pn-realaudio-plugin", - "xm": "audio/xm", - "cdx": "chemical/x-cdx", - "cif": "chemical/x-cif", - "cmdf": "chemical/x-cmdf", - "cml": "chemical/x-cml", - "csml": "chemical/x-csml", - "xyz": "chemical/x-xyz", - "bmp": "image/x-ms-bmp", - "cgm": "image/cgm", - "g3": "image/g3fax", - "gif": "image/gif", - "ief": "image/ief", - "jpeg": "image/jpeg", - "jpg": "image/jpeg", - "jpe": "image/jpeg", - "ktx": "image/ktx", - "png": "image/png", - "btif": "image/prs.btif", - "sgi": "image/sgi", - "svg": "image/svg+xml", - "svgz": "image/svg+xml", - "tiff": "image/tiff", - "tif": "image/tiff", - "psd": "image/vnd.adobe.photoshop", - "uvi": "image/vnd.dece.graphic", - "uvvi": "image/vnd.dece.graphic", - "uvg": "image/vnd.dece.graphic", - "uvvg": "image/vnd.dece.graphic", - "djvu": "image/vnd.djvu", - "djv": "image/vnd.djvu", - "sub": "text/vnd.dvb.subtitle", - "dwg": "image/vnd.dwg", - "dxf": "image/vnd.dxf", - "fbs": "image/vnd.fastbidsheet", - "fpx": "image/vnd.fpx", - "fst": "image/vnd.fst", - "mmr": "image/vnd.fujixerox.edmics-mmr", - "rlc": "image/vnd.fujixerox.edmics-rlc", - "mdi": "image/vnd.ms-modi", - "wdp": "image/vnd.ms-photo", - "npx": "image/vnd.net-fpx", - "wbmp": "image/vnd.wap.wbmp", - "xif": "image/vnd.xiff", - "webp": "image/webp", - "3ds": "image/x-3ds", - "ras": "image/x-cmu-raster", - "cmx": "image/x-cmx", - "fh": "image/x-freehand", - "fhc": "image/x-freehand", - "fh4": "image/x-freehand", - "fh5": "image/x-freehand", - "fh7": "image/x-freehand", - "ico": "image/x-icon", - "jng": "image/x-jng", - "sid": "image/x-mrsid-image", - "pcx": "image/x-pcx", - "pic": "image/x-pict", - "pct": "image/x-pict", - "pnm": "image/x-portable-anymap", - "pbm": "image/x-portable-bitmap", - "pgm": "image/x-portable-graymap", - "ppm": "image/x-portable-pixmap", - "rgb": "image/x-rgb", - "tga": "image/x-tga", - "xbm": "image/x-xbitmap", - "xpm": "image/x-xpixmap", - "xwd": "image/x-xwindowdump", - "eml": "message/rfc822", - "mime": "message/rfc822", - "igs": "model/iges", - "iges": "model/iges", - "msh": "model/mesh", - "mesh": "model/mesh", - "silo": "model/mesh", - "dae": "model/vnd.collada+xml", - "dwf": "model/vnd.dwf", - "gdl": "model/vnd.gdl", - "gtw": "model/vnd.gtw", - "mts": "model/vnd.mts", - "vtu": "model/vnd.vtu", - "wrl": "model/vrml", - "vrml": "model/vrml", - "x3db": "model/x3d+binary", - "x3dbz": "model/x3d+binary", - "x3dv": "model/x3d+vrml", - "x3dvz": "model/x3d+vrml", - "x3d": "model/x3d+xml", - "x3dz": "model/x3d+xml", - "appcache": "text/cache-manifest", - "manifest": "text/cache-manifest", - "ics": "text/calendar", - "ifb": "text/calendar", - "coffee": "text/coffeescript", - "litcoffee": "text/coffeescript", - "css": "text/css", - "csv": "text/csv", - "hjson": "text/hjson", - "html": "text/html", - "htm": "text/html", - "shtml": "text/html", - "jade": "text/jade", - "jsx": "text/jsx", - "less": "text/less", - "mml": "text/mathml", - "n3": "text/n3", - "txt": "text/plain", - "text": "text/plain", - "conf": "text/plain", - "def": "text/plain", - "list": "text/plain", - "log": "text/plain", - "in": "text/plain", - "ini": "text/plain", - "dsc": "text/prs.lines.tag", - "rtx": "text/richtext", - "sgml": "text/sgml", - "sgm": "text/sgml", - "slim": "text/slim", - "slm": "text/slim", - "stylus": "text/stylus", - "styl": "text/stylus", - "tsv": "text/tab-separated-values", - "t": "text/troff", - "tr": "text/troff", - "roff": "text/troff", - "man": "text/troff", - "me": "text/troff", - "ms": "text/troff", - "ttl": "text/turtle", - "uri": "text/uri-list", - "uris": "text/uri-list", - "urls": "text/uri-list", - "vcard": "text/vcard", - "curl": "text/vnd.curl", - "dcurl": "text/vnd.curl.dcurl", - "mcurl": "text/vnd.curl.mcurl", - "scurl": "text/vnd.curl.scurl", - "fly": "text/vnd.fly", - "flx": "text/vnd.fmi.flexstor", - "gv": "text/vnd.graphviz", - "3dml": "text/vnd.in3d.3dml", - "spot": "text/vnd.in3d.spot", - "jad": "text/vnd.sun.j2me.app-descriptor", - "wml": "text/vnd.wap.wml", - "wmls": "text/vnd.wap.wmlscript", - "vtt": "text/vtt", - "s": "text/x-asm", - "asm": "text/x-asm", - "c": "text/x-c", - "cc": "text/x-c", - "cxx": "text/x-c", - "cpp": "text/x-c", - "h": "text/x-c", - "hh": "text/x-c", - "dic": "text/x-c", - "htc": "text/x-component", - "f": "text/x-fortran", - "for": "text/x-fortran", - "f77": "text/x-fortran", - "f90": "text/x-fortran", - "hbs": "text/x-handlebars-template", - "java": "text/x-java-source", - "lua": "text/x-lua", - "markdown": "text/x-markdown", - "md": "text/x-markdown", - "mkd": "text/x-markdown", - "nfo": "text/x-nfo", - "opml": "text/x-opml", - "p": "text/x-pascal", - "pas": "text/x-pascal", - "pde": "text/x-processing", - "sass": "text/x-sass", - "scss": "text/x-scss", - "etx": "text/x-setext", - "sfv": "text/x-sfv", - "ymp": "text/x-suse-ymp", - "uu": "text/x-uuencode", - "vcs": "text/x-vcalendar", - "vcf": "text/x-vcard", - "yaml": "text/yaml", - "yml": "text/yaml", - "3gp": "video/3gpp", - "3g2": "video/3gpp2", - "h261": "video/h261", - "h263": "video/h263", - "h264": "video/h264", - "jpgv": "video/jpeg", - "jpm": "video/jpm", - "jpgm": "video/jpm", - "mj2": "video/mj2", - "mjp2": "video/mj2", - "ts": "video/mp2t", - "mp4": "video/mp4", - "mp4v": "video/mp4", - "mpg4": "video/mp4", - "mpeg": "video/mpeg", - "mpg": "video/mpeg", - "mpe": "video/mpeg", - "m1v": "video/mpeg", - "m2v": "video/mpeg", - "ogv": "video/ogg", - "qt": "video/quicktime", - "mov": "video/quicktime", - "uvh": "video/vnd.dece.hd", - "uvvh": "video/vnd.dece.hd", - "uvm": "video/vnd.dece.mobile", - "uvvm": "video/vnd.dece.mobile", - "uvp": "video/vnd.dece.pd", - "uvvp": "video/vnd.dece.pd", - "uvs": "video/vnd.dece.sd", - "uvvs": "video/vnd.dece.sd", - "uvv": "video/vnd.dece.video", - "uvvv": "video/vnd.dece.video", - "dvb": "video/vnd.dvb.file", - "fvt": "video/vnd.fvt", - "mxu": "video/vnd.mpegurl", - "m4u": "video/vnd.mpegurl", - "pyv": "video/vnd.ms-playready.media.pyv", - "uvu": "video/vnd.uvvu.mp4", - "uvvu": "video/vnd.uvvu.mp4", - "viv": "video/vnd.vivo", - "webm": "video/webm", - "f4v": "video/x-f4v", - "fli": "video/x-fli", - "flv": "video/x-flv", - "m4v": "video/x-m4v", - "mkv": "video/x-matroska", - "mk3d": "video/x-matroska", - "mks": "video/x-matroska", - "mng": "video/x-mng", - "asf": "video/x-ms-asf", - "asx": "video/x-ms-asf", - "vob": "video/x-ms-vob", - "wm": "video/x-ms-wm", - "wmv": "video/x-ms-wmv", - "wmx": "video/x-ms-wmx", - "wvx": "video/x-ms-wvx", - "avi": "video/x-msvideo", - "movie": "video/x-sgi-movie", - "smv": "video/x-smv", - "ice": "x-conference/x-cooltalk" -} diff --git a/node_modules/snekfetch/src/node/transports/ResponseStream.js b/node_modules/snekfetch/src/node/transports/ResponseStream.js deleted file mode 100644 index 1d40101..0000000 --- a/node_modules/snekfetch/src/node/transports/ResponseStream.js +++ /dev/null @@ -1,24 +0,0 @@ -const Stream = require('stream'); - -class ResponseStream extends Stream.Readable { - constructor() { - super(); - this.statusCode = 200; - this.status = 'OK'; - } - - error(code, message) { - this.statusCode = code; - this.status = message; - return this; - } - - on(event, handler) { - if (['end', 'open'].includes(event)) - handler(); - } - - _read() {} // eslint-disable-line no-empty-function -} - -module.exports = ResponseStream; diff --git a/node_modules/snekfetch/src/node/transports/file.js b/node_modules/snekfetch/src/node/transports/file.js deleted file mode 100644 index a30c5fe..0000000 --- a/node_modules/snekfetch/src/node/transports/file.js +++ /dev/null @@ -1,113 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const mime = require('../mime'); -const EventEmitter = require('events'); -const ResponseStream = require('./ResponseStream'); - -const methods = { - GET: (filename, req) => { - req.end = () => { - const stream = should404(filename) ? - new ResponseStream().error(404, `ENOENT: no such file or directory, open '${filename}'`) : - fs.createReadStream(filename); - req.res = stream; - stream.headers = { - 'content-length': 0, - 'content-type': mime.lookup(path.extname(filename)), - }; - stream.on('open', () => { - req.emit('response', stream); - }); - if (stream instanceof ResponseStream) - return; - stream.statusCode = 200; - stream.on('end', () => { - stream.headers['content-length'] = stream.bytesRead; - }); - /* istanbul ignore next */ - stream.on('error', (err) => { - stream.statusCode = 400; - stream.status = err.message; - }); - }; - }, - POST: (filename, req) => { - const chunks = []; - /* istanbul ignore next */ - req.write = (data) => { - chunks.push(data); - }; - req.end = (data) => { - chunks.push(data); - const stream = fs.createWriteStream(filename); - const standin = new ResponseStream(); - req.res = standin; - standin.headers = { - 'content-length': 0, - 'content-type': mime.lookup(path.extname(filename)), - }; - stream.on('finish', () => { - req.emit('response', standin); - }); - stream.on('open', () => { - (function write() { - const chunk = chunks.shift(); - if (!chunk) - return; - /* istanbul ignore next */ - if (!stream.write(chunk)) - stream.once('drain', write); - else - write(); - }()); - stream.end(); - }); - }; - }, - DELETE: (filename, req) => { - req.end = () => { - const stream = new ResponseStream(); - req.res = stream; - stream.headers = { - 'content-length': 0, - 'content-type': mime.lookup(path.extname(filename)), - }; - fs.unlink(filename, (err) => { - req.emit('response', err ? stream.error(400, err.message) : stream); - }); - }; - }, -}; - -class Req extends EventEmitter { - constructor() { - super(); - this._headers = {}; - } - - setHeader() {} // eslint-disable-line no-empty-function - getHeader() {} // eslint-disable-line no-empty-function -} - -function request(options) { - const method = methods[options.method]; - if (!method) - throw new Error(`Invalid request method for file: "${options.method}"`); - const filename = options.href.replace('file://', ''); - - const req = new Req(); - method(filename, req, options); - return req; -} - -function should404(p) { - try { - return fs.lstatSync(p).isDirectory(); - } catch (err) { - return true; - } -} - -module.exports = { - request, -}; diff --git a/node_modules/snekfetch/src/node/transports/http2.js b/node_modules/snekfetch/src/node/transports/http2.js deleted file mode 100644 index 326b32e..0000000 --- a/node_modules/snekfetch/src/node/transports/http2.js +++ /dev/null @@ -1,102 +0,0 @@ -const http = require('http'); -const Stream = require('stream'); -const EventEmitter = require('events'); -const http2 = (() => { - try { - const h2 = require('http2'); - if (!h2.constants) - throw new Error('DAMN_YOU_NPM_HTTP2'); - return h2; - } catch (err) { - return { - constants: {}, - connect: () => { - throw new Error('Please run node with --expose-http2 to use the http2 request transport'); - }, - }; - } -})(); - -const { - HTTP2_HEADER_PATH, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_STATUS, -} = http2.constants; - -class Http2Request extends EventEmitter { - constructor(options) { - super(); - this.options = options; - this._headers = { - [HTTP2_HEADER_PATH]: options.pathname, - [HTTP2_HEADER_METHOD]: options.method.toUpperCase(), - }; - } - - setHeader(name, value) { - this._headers[name.toLowerCase()] = value; - } - - getHeader(name) { - return this._headers[name]; - } - - getHeaders() { - return this._headers; - } - - get path() { - return this._headers[HTTP2_HEADER_PATH]; - } - - set path(path) { - this._headers[HTTP2_HEADER_PATH] = path; - } - - end(data) { - const options = this.options; - const client = http2.connect(`${options.protocol}//${options.hostname}`); - const req = client.request(this._headers); - const stream = new Stream.PassThrough(); - - client.once('error', (e) => this.emit('error', e)); - client.once('frameError', (e) => this.emit('error', e)); - - req.once('error', (e) => this.emit('error', e)); - - req.once('response', (headers) => { - stream.headers = headers; - stream.statusCode = headers[HTTP2_HEADER_STATUS]; - stream.status = http.STATUS_CODES[stream.statusCode]; - - this.emit('response', stream); - this.response = stream; - - req.on('data', (chunk) => { - if (!stream.push(chunk)) - req.pause(); - }); - - req.once('end', () => { - stream.push(null); - client.destroy(); - }); - - stream.once('error', (err) => { - stream.statusCode = 400; - stream.status = err.message; - }); - }); - - req.end(data); - - return req; - } -} - - -function request(options) { - return new Http2Request(options); -} - -module.exports = { request }; diff --git a/node_modules/snekfetch/src/qs_mock.js b/node_modules/snekfetch/src/qs_mock.js deleted file mode 100644 index a8e4807..0000000 --- a/node_modules/snekfetch/src/qs_mock.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = { - parse: (str) => { - const parsed = {}; - for (const [k, v] of new Window.URLSearchParams(str).entries()) - parsed[k] = v; - return parsed; - }, - stringify: (obj) => new window.URLSearchParams(obj).toString(), -}; diff --git a/node_modules/snekfetch/sync.js b/node_modules/snekfetch/sync.js deleted file mode 100644 index 5531136..0000000 --- a/node_modules/snekfetch/sync.js +++ /dev/null @@ -1,15 +0,0 @@ -try { - var syncify = require('@snek/syncify'); -} catch (err) { - throw new Error('Using sync requires @snek/syncify (npm install @snek/syncify)'); -} - -const Snekfetch = require('.'); - -class SnekfetchSync extends Snekfetch { - end() { - return syncify(super.end()); - } -} - -module.exports = SnekfetchSync; diff --git a/node_modules/snekfetch/test/.eslintrc.json b/node_modules/snekfetch/test/.eslintrc.json deleted file mode 100644 index 063ae8c..0000000 --- a/node_modules/snekfetch/test/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["../.eslintrc.json"], - "env": { "jest": true } -} diff --git a/node_modules/snekfetch/test/browser/http1.test.js b/node_modules/snekfetch/test/browser/http1.test.js deleted file mode 100644 index 8ce2b94..0000000 --- a/node_modules/snekfetch/test/browser/http1.test.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @jest-environment jsdom - */ - -global.HTTP_VERSION = 1; - -require('./main'); diff --git a/node_modules/snekfetch/test/browser/http2.test.js b/node_modules/snekfetch/test/browser/http2.test.js deleted file mode 100644 index 19c51cf..0000000 --- a/node_modules/snekfetch/test/browser/http2.test.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @jest-environment jsdom - */ - -global.HTTP_VERSION = 2; - -require('./main'); diff --git a/node_modules/snekfetch/test/browser/main.js b/node_modules/snekfetch/test/browser/main.js deleted file mode 100644 index 7562ace..0000000 --- a/node_modules/snekfetch/test/browser/main.js +++ /dev/null @@ -1,5 +0,0 @@ -window.fetch = require('node-fetch'); -window.URLSearchParams = require('url').URLSearchParams; -window.FormData = require('form-data'); - -require('../main'); diff --git a/node_modules/snekfetch/test/interop.js b/node_modules/snekfetch/test/interop.js deleted file mode 100644 index d63ff10..0000000 --- a/node_modules/snekfetch/test/interop.js +++ /dev/null @@ -1,22 +0,0 @@ -function makeProxy(fetch) { - return new Proxy(fetch, { - get(target, prop) { - const p = target[prop]; - if (typeof p === 'function') { - return (url, options = {}) => - p.call(target, url, Object.assign(options, { version: global.HTTP_VERSION })); - } - return p; - }, - }); -} - -exports.Snekfetch = makeProxy(require('../')); -try { - exports.SnekfetchSync = makeProxy(require('../sync')); -} catch (err) {} // eslint-disable-line no-empty - -exports.TestRoot = global.HTTP_VERSION === 2 ? - 'https://nghttp2.org/httpbin' : - 'https://httpbin.org'; - diff --git a/node_modules/snekfetch/test/main.js b/node_modules/snekfetch/test/main.js deleted file mode 100644 index 87f60fc..0000000 --- a/node_modules/snekfetch/test/main.js +++ /dev/null @@ -1,152 +0,0 @@ -const { Snekfetch, TestRoot } = require('./interop'); - -const server = require('./server'); - -function makeTestObj({ unicode = true, numbers = false } = {}) { - const test = { - Hello: 'world', - Test: numbers ? 1337 : '1337', - }; - if (unicode) - test.Unicode = '( ͡° ͜ʖ ͡°)'; - return { - test, - check: (obj) => { - expect(obj).not.toBeUndefined(); - expect(obj.Hello).toBe(test.Hello); - expect(obj.Test).toBe(test.Test); - if (unicode) - expect(obj.Unicode).toBe(test.Unicode); - }, - }; -} - -test('should return a promise', () => { - expect(Snekfetch.get(`${TestRoot}/get`).end()) - .toBeInstanceOf(Promise); -}); - -test('should reject with error on network failure', () => { - const invalid = 'http://localhost:0/'; - /* https://gc.gy/❥ȗ.png - return expect(Snekfetch.get(invalid).end()) - .rejects.toBeInstanceOf(Error);*/ - return Snekfetch.get(invalid).catch((err) => { - expect(err.name).toMatch(/(Fetch)?Error/); - }); -}); - -test('should resolve on success', () => - Snekfetch.get(`${TestRoot}/get`).then((res) => { - expect(res.status).toBe(200); - expect(res.ok).toBe(true); - expect(res).toHaveProperty('text'); - expect(res).toHaveProperty('body'); - }) -); - -test('end should work', () => - Snekfetch.get(`${TestRoot}/get`).end((err, res) => { - expect(err).toBe(null); - expect(res.body).not.toBeUndefined(); - }) -); - -test('should reject if response is not between 200 and 300', () => - Snekfetch.get(`${TestRoot}/404`).catch((err) => { - expect(err.status).toBe(404); - expect(err.ok).toBe(false); - }) -); - -test('unzipping works', () => - Snekfetch.get(`${TestRoot}/gzip`) - .then((res) => { - expect(res.body).not.toBeUndefined(); - expect(res.body.gzipped).toBe(true); - }) -); - -test('query should work', () => { - const { test, check } = makeTestObj(); - Promise.all([ - Snekfetch.get(`${TestRoot}/get?inline=true`) - .query(test).end(), - Snekfetch.get(`${TestRoot}/get?inline=true`, { query: test }) - .end(), - ]) - .then((ress) => { - for (const res of ress) { - const { args } = res.body; - check(args); - expect(args.inline).toBe('true'); - } - }); -}); - -test('headers should work', () => { - const { test, check } = makeTestObj({ unicode: false }); - return Promise.all([ - Snekfetch.get(`${TestRoot}/get`) - .set(test).end(), - Snekfetch.get(`${TestRoot}/get`, { headers: test }) - .end(), - ]) - .then((ress) => { - for (const res of ress) - check(res.body.headers); - }); -}); - -test('attach should work', () => { - const { test, check } = makeTestObj(); - return Snekfetch.post(`${TestRoot}/post`) - .attach(test) - .then((res) => check(res.body.form)); -}); - -test('send should work with json', () => { - const { test, check } = makeTestObj({ numbers: true }); - return Promise.all([ - Snekfetch.post(`${TestRoot}/post`) - .send(test).end(), - Snekfetch.post(`${TestRoot}/post`, { data: test }) - .end(), - ]) - .then((ress) => { - for (const res of ress) - check(res.body.json); - }); -}); - -test('send should work with urlencoded', () => { - const { test, check } = makeTestObj(); - return Snekfetch.post(`${TestRoot}/post`) - .set('content-type', 'application/x-www-form-urlencoded') - .send(test) - .then((res) => check(res.body.form)); -}); - -test('invalid json is just text', () => - Snekfetch.get(`http://localhost:${server.port}/invalid-json`) - .then((res) => { - expect(res.body).toBe('{ "a": 1'); - }) -); - -test('x-www-form-urlencoded response body', () => - Snekfetch.get(`http://localhost:${server.port}/form-urlencoded`) - .then((res) => { - const { body } = res; - expect(body.test).toBe('1'); - expect(body.hello).toBe('world'); - }) -); - -test('redirects', () => - Snekfetch.get(`${TestRoot}/redirect/1`) - .then((res) => { - expect(res.body).not.toBeUndefined(); - expect(res.body.url).toBe(`${TestRoot}/get`); - }) -); diff --git a/node_modules/snekfetch/test/node/file.test.js b/node_modules/snekfetch/test/node/file.test.js deleted file mode 100644 index 8ec0fd0..0000000 --- a/node_modules/snekfetch/test/node/file.test.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @jest-environment node - */ - -const fs = require('fs'); -const { Snekfetch } = require('../interop'); - -const resolve = (x) => require.resolve(x); - -test('node/file get', () => { - const original = fs.readFileSync(resolve('../../package.json')).toString(); - return Snekfetch.get(`file://${resolve('../../package.json')}`) - .then((res) => { - expect(res.text).toBe(original); - }); -}); - -test('node/file post', () => { - const content = 'wow this is a\n\ntest!!'; - const file = './test_file_post.txt'; - return Snekfetch.post(`file://${file}`) - .send(content) - .then(() => Snekfetch.get(`file://${file}`)) - .then((res) => { - expect(res.text).toBe(content); - }) - .then(() => { - fs.unlinkSync(file); - }); -}); - -test('node/file delete', () => { - const file = './test_file_delete.txt'; - fs.closeSync(fs.openSync(file, 'w')); - expect(fs.existsSync(file)).toBe(true); - return Snekfetch.delete(`file://${file}`) - .then(() => { - expect(fs.existsSync(file)).toBe(false); - }); -}); - - -test('node/file invalid method', () => { - expect(() => { - Snekfetch.options('file:///dev/urandom'); - }).toThrow(/Invalid request method for file:/); -}); diff --git a/node_modules/snekfetch/test/node/http1.test.js b/node_modules/snekfetch/test/node/http1.test.js deleted file mode 100644 index 00f91f4..0000000 --- a/node_modules/snekfetch/test/node/http1.test.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @jest-environment node - */ - -global.HTTP_VERSION = 1; - -require('./main'); diff --git a/node_modules/snekfetch/test/node/http2.test.js.disabled b/node_modules/snekfetch/test/node/http2.test.js.disabled deleted file mode 100644 index daf49d9..0000000 --- a/node_modules/snekfetch/test/node/http2.test.js.disabled +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @jest-environment node - */ - -global.HTTP_VERSION = 2; - -require('./main'); diff --git a/node_modules/snekfetch/test/node/main.js b/node_modules/snekfetch/test/node/main.js deleted file mode 100644 index b811ec9..0000000 --- a/node_modules/snekfetch/test/node/main.js +++ /dev/null @@ -1,26 +0,0 @@ -const fs = require('fs'); - -const { Snekfetch, TestRoot } = require('../interop'); - -require('../main'); - -test('node/pipe get', (done) => { - Snekfetch.get(`${TestRoot}/get`) - .pipe(fs.createWriteStream('/dev/null')) - .on('finish', done); -}); - - -test('node/FormData json works', () => - Snekfetch.post(`${TestRoot}/post`) - .attach('object', { a: 1 }) - .then((res) => { - const { form } = res.body; - expect(form.object).toBe('{"a":1}'); - }) -); - -test('node/rawsend post', () => - Snekfetch.post(`${TestRoot}/post`) - .send(Buffer.from('memes')).end() -); diff --git a/node_modules/snekfetch/test/node/sync.test.js b/node_modules/snekfetch/test/node/sync.test.js deleted file mode 100644 index 0c7187f..0000000 --- a/node_modules/snekfetch/test/node/sync.test.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @jest-environment node - */ - -const { SnekfetchSync, TestRoot } = require('../interop'); - -test('sync get', SnekfetchSync && (() => { - const res = SnekfetchSync.get(`${TestRoot}/get`).end(); - expect(res.body).not.toBeUndefined(); -})); diff --git a/node_modules/snekfetch/test/node/util.test.js b/node_modules/snekfetch/test/node/util.test.js deleted file mode 100644 index 1e71573..0000000 --- a/node_modules/snekfetch/test/node/util.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const FormData = require('../../src/node/FormData'); -const mime = require('../../src/node/mime'); - -test('node/FormData behaves predictably', () => { - const f = new FormData(); - f.append('hello'); - f.append('hello', 'world'); - expect(f.length).toBe(77); - f.append('meme', 'dream', 'name'); - expect(f.length).toBe(210); -}); - -test('node/mimes behaves predictably', () => { - expect(mime.lookup('js')).toBe('application/javascript'); - expect(mime.lookup('nope')).toBe('application/octet-stream'); - expect(mime.buffer([0xFF, 0xD8, 0xFF])).toBe('image/jpeg'); -}); diff --git a/node_modules/snekfetch/test/server.js b/node_modules/snekfetch/test/server.js deleted file mode 100644 index ac75cca..0000000 --- a/node_modules/snekfetch/test/server.js +++ /dev/null @@ -1,41 +0,0 @@ -const http = require('http'); - -const ref = require.main === module; - -const server = http.createServer((req, res) => { - if (!ref) - req.connection.unref(); - switch (req.url) { - case '/invalid-json': - res.setHeader('Content-Type', 'application/json'); - res.end('{ "a": 1'); - break; - case '/form-urlencoded': - res.setHeader('Content-Type', 'application/x-www-form-urlencoded'); - res.end('test=1&hello=world'); - break; - case '/echo': { - let body = ''; - req.on('data', (c) => { body += c; }); - req.on('end', () => { - res.end(body); - }); - break; - } - default: - res.end(); - break; - } -}); - -server.on('connection', (socket) => { - if (!ref) - socket.unref(); -}); - -server.listen(0); - -exports.port = server.address().port; - -if (ref) - console.log(exports.port); // eslint-disable-line no-console diff --git a/node_modules/snekfetch/webpack.config.js b/node_modules/snekfetch/webpack.config.js deleted file mode 100644 index a72be5a..0000000 --- a/node_modules/snekfetch/webpack.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); - -module.exports = { - entry: require.resolve('.'), - output: { - filename: 'browser.js', - library: 'Snekfetch', - libraryTarget: 'umd', - }, - plugins: [ - new UglifyJSPlugin(), - ], - resolve: { - alias: { - querystring: require.resolve('./src/qs_mock'), - }, - }, -}; |