Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

4
goTorrentWebUI/node_modules/attr-accept/.babelrc generated vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"stage": 0,
"loose": "all"
}

View File

@@ -0,0 +1,48 @@
# This is a sample .codeclimate.yml configured for Engine analysis on Code
# Climate Platform. For an overview of the Code Climate Platform, see here:
# http://docs.codeclimate.com/article/300-the-codeclimate-platform
# Under the engines key, you can configure which engines will analyze your repo.
# Each key is an engine name. For each value, you need to specify enabled: true
# to enable the engine as well as any other engines-specific configuration.
# For more details, see here:
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
# For a list of all available engines, see here:
# http://docs.codeclimate.com/article/296-engines-available-engines
engines:
# to turn on an engine, add it here and set enabled to `true`
# to turn off an engine, set enabled to `false` or remove it
rubocop:
enabled: false
golint:
enabled: false
gofmt:
enabled: false
eslint:
enabled: true
csslint:
enabled: true
# Engines can analyze files and report issues on them, but you can separately
# decide which files will receive ratings based on those issues. This is
# specified by path patterns under the ratings key.
# For more details see here:
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
# ratings:
# paths:
# - app/**
# - lib/**
# - "**.rb"
# - "**.go"
# You can globally exclude files from being analyzed by any engine using the
# exclude_paths key.
#exclude_paths:
#- spec/**/*
#- vendor/**/*

13
goTorrentWebUI/node_modules/attr-accept/.editorconfig generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

12
goTorrentWebUI/node_modules/attr-accept/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"extends": "airbnb",
"env": {
"browser": true,
"mocha": true,
"node": true
},
"rules": {
"indent": [2, 4],
"comma-dangle": [2, "never"]
}
}

5
goTorrentWebUI/node_modules/attr-accept/.hound.yml generated vendored Normal file
View File

@@ -0,0 +1,5 @@
javascript:
enabled: false
eslint:
enabled: true
config_file: .eslintrc

28
goTorrentWebUI/node_modules/attr-accept/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,28 @@
sudo: false
language: node_js
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- 'stable'
- '6'
- '4'
- iojs-v3
- iojs-v2
- iojs-v1
- '0.12'
before_install:
- npm i -g npm@^2.0.0
before_script:
- npm prune
after_success:
- bash <(curl -s https://codecov.io/bash)
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
- python travis_after_all.py
- export $(cat .to_export_back) &> /dev/null
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/

22
goTorrentWebUI/node_modules/attr-accept/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Andrey Okonetchnikov
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.

45
goTorrentWebUI/node_modules/attr-accept/README.md generated vendored Normal file
View File

@@ -0,0 +1,45 @@
# attr-accept
JavaScript implementation of the "accept" attribute for HTML5 `<input type="file">`
[![Build Status](https://travis-ci.org/okonet/attr-accept.svg?branch=master)](https://travis-ci.org/okonet/attr-accept)
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#Attributes for more information.
Installation
=====
```sh
npm install --save attr-accept
```
Usage
=====
```javascript
var accept = require('attr-accept');
accept({
name: 'my file.png',
type: 'image/png'
}, 'image/*') // => true
accept({
name: 'my file.json',
type: 'application/json'
}, 'image/*') // => false
accept({
name: 'my file.srt',
type: ''
}, '.srt') // => true
```
You can also pass multiple mime types as a comma delimited string or array.
```javascript
accept({
name: 'my file.json',
type: 'application/json'
}, 'application/json,video/*') // => true
accept({
name: 'my file.json',
type: 'application/json'
}, ['application/json', 'video/*']) // => true
```

View File

@@ -0,0 +1 @@
module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";n.__esModule=!0,r(8),r(9),n["default"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(","),e=t.name||"",o=t.type||"",i=o.replace(/\/.*$/,"");return{v:r.some(function(t){var n=t.trim();return"."===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):o===n})}}();if("object"==typeof r)return r.v}return!0},t.exports=n["default"]},function(t,n){var r=t.exports={version:"1.2.2"};"number"==typeof __e&&(__e=r)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c="prototype",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&"function"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(20)("wks"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))("Symbol."+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r(7)("match")]=!1,!"/./"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)("src"),u="toString",c=Function[u],f=(""+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){"function"==typeof r&&(o(r,i,t[n]?""+t[n]:f.join(String(n))),"name"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return"function"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(3),o=r(24),i=r(21),u="endsWith",c=""[u];e(e.P+e.F*r(14)(u),"String",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(","),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",u)}]);

87
goTorrentWebUI/node_modules/attr-accept/package.json generated vendored Normal file
View File

@@ -0,0 +1,87 @@
{
"_args": [
[
"attr-accept@1.1.0",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "attr-accept@1.1.0",
"_id": "attr-accept@1.1.0",
"_inBundle": false,
"_integrity": "sha1-tc01In8WOTWo8d4Q7T66FpQfa+Y=",
"_location": "/attr-accept",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "attr-accept@1.1.0",
"name": "attr-accept",
"escapedName": "attr-accept",
"rawSpec": "1.1.0",
"saveSpec": null,
"fetchSpec": "1.1.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-1.1.0.tgz",
"_spec": "1.1.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Andrey Okonetchnikov @okonetchnikov"
},
"bugs": {
"url": "https://github.com/okonet/attr-accept/issues"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"description": "JavaScript implementation of the \"accept\" attribute for HTML5 <input type=\"file\">",
"devDependencies": {
"babel": "^5.8.23",
"babel-core": "5.8.25",
"babel-eslint": "^4.1.1",
"babel-loader": "5.3.2",
"core-js": "1.2.2",
"cz-conventional-changelog": "^1.2.0",
"eslint": "^1.3.1",
"eslint-config-airbnb": "0.0.8",
"eslint-plugin-react": "^3.3.1",
"expect": "^1.9.0",
"mocha": "^2.3.2",
"semantic-release": "^4.3.5",
"webpack": "1.12.2"
},
"engines": {
"node": ">=0.10"
},
"homepage": "https://github.com/okonet/attr-accept#readme",
"keywords": [
"html5",
"input",
"tag",
"attribute",
"attr",
"accpet",
"file"
],
"license": "MIT",
"main": "dist/index.js",
"name": "attr-accept",
"repository": {
"type": "git",
"url": "git+https://github.com/okonet/attr-accept.git"
},
"scripts": {
"build": "webpack -p",
"check": "npm run lint && npm test",
"lint": "eslint ./src",
"prepublish": "npm run check && npm run build",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test": "mocha --compilers js:babel/register --recursive",
"test:watch": "npm test -- --watch"
},
"version": "1.1.0"
}

36
goTorrentWebUI/node_modules/attr-accept/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/**
* Check if the provided file type should be accepted by the input with accept attribute.
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#attr-accept
*
* Inspired by https://github.com/enyo/dropzone
*
* @param file {File} https://developer.mozilla.org/en-US/docs/Web/API/File
* @param acceptedFiles {string}
* @returns {boolean}
*/
import 'core-js/fn/array/some';
import 'core-js/fn/string/ends-with';
export default function(file, acceptedFiles) {
if (file && acceptedFiles) {
const acceptedFilesArray = (Array.isArray(acceptedFiles) ?
acceptedFiles :
acceptedFiles.split(','));
const fileName = file.name || '';
const mimeType = file.type || '';
const baseMimeType = mimeType.replace(/\/.*$/, '');
return acceptedFilesArray.some(type => {
const validType = type.trim();
if (validType.charAt(0) === '.') {
return fileName.toLowerCase().endsWith(validType.toLowerCase());
} else if (/\/\*$/.test(validType)) {
// This is something like a image/* mime type
return baseMimeType === validType.replace(/\/.*$/, '');
}
return mimeType === validType;
});
}
return true;
}

154
goTorrentWebUI/node_modules/attr-accept/test/index.js generated vendored Normal file
View File

@@ -0,0 +1,154 @@
/* eslint no-unused-expressions: 0 */
import expect from 'expect';
import accept from '../src/index';
describe('accept', () => {
it('should return true if called without acceptedFiles', () => {
expect(accept({
name: 'testfile.png',
type: 'some/type'
}, undefined)).toBe(true);
});
it('should not throw and return true if file is empty or null', () => {
expect(() => {
accept({});
accept({}, 'text/html');
accept({}, '*.png');
accept({}, 'image/*');
accept(null);
accept(null, 'text/html');
accept(null, '*.png');
accept(null, 'image/*');
}).toNotThrow();
});
it('should properly validate if called with concrete mime types', () => {
const acceptedMimeTypes = 'text/html,image/jpeg,application/json';
expect(accept({
name: 'testfile.png',
type: 'text/html'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/jpeg'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'application/json'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/bmp'
}, acceptedMimeTypes)).toBe(false);
expect(accept({
type: 'image/bmp'
}, acceptedMimeTypes)).toBe(false);
});
it('should properly validate if called with base mime types', () => {
const acceptedMimeTypes = 'text/*,image/*,application/*';
expect(accept({
name: 'testfile.png',
type: 'text/html'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/jpeg'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'application/json'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/bmp'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'some/type'
}, acceptedMimeTypes)).toBe(false);
});
it('should properly validate if called with mixed mime types', () => {
const acceptedMimeTypes = 'text/*,image/jpeg,application/*';
expect(accept({
name: 'testfile.png',
type: 'text/html'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/jpeg'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/bmp'
}, acceptedMimeTypes)).toBe(false);
expect(accept({
name: 'testfile.png',
type: 'application/json'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'some/type'
}, acceptedMimeTypes)).toBe(false);
});
it('should properly validate even with spaces in between', () => {
const acceptedMimeTypes = 'text/html , image/jpeg, application/json';
expect(accept({
name: 'testfile.png',
type: 'text/html'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.png',
type: 'image/jpeg'
}, acceptedMimeTypes)).toBe(true);
});
it('should properly validate extensions', () => {
const acceptedMimeTypes = 'text/html , image/jpeg, .pdf ,.png';
expect(accept({
name: 'somxsfsd',
type: 'text/html'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'somesdfsdf',
type: 'image/jpeg'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'somesdfadfadf',
type: 'application/json'
}, acceptedMimeTypes)).toBe(false);
expect(accept({
name: 'some-file file.pdf',
type: 'random/type'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'some-file.pdf file.gif',
type: 'random/type'
}, acceptedMimeTypes)).toBe(false);
expect(accept({
name: 'some-FILEi File.PNG',
type: 'random/type'
}, acceptedMimeTypes)).toBe(true);
});
it('should allow accepted files passed to be an array', () => {
const acceptedMimeTypes = ['img/jpeg', '.pdf'];
expect(accept({
name: 'testfile.pdf',
type: 'random/type'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile.jpg',
type: 'img/jpeg'
}, acceptedMimeTypes)).toBe(true);
expect(accept({
name: 'testfile',
type: 'application/json'
}, acceptedMimeTypes)).toBe(false);
});
});

View File

@@ -0,0 +1,20 @@
{
module.exports = {
entry: "./src/index.js",
output: {
path: __dirname,
filename: "./dist/index.js",
libraryTarget: "commonjs2",
library: "react-attr"
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
}
]
}
}
};