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

View File

@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

View File

@@ -0,0 +1,75 @@
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
# Users Environment Variables
.lock-wscript
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@@ -0,0 +1,20 @@
module.exports = function chain(){
var len = arguments.length
var args = [];
for (var i = 0; i < len; i++)
args[i] = arguments[i]
args = args.filter(function(fn){ return fn != null })
if (args.length === 0) return undefined
if (args.length === 1) return args[0]
return args.reduce(function(current, next){
return function chainedFunction() {
current.apply(this, arguments);
next.apply(this, arguments);
};
})
}

View File

@@ -0,0 +1,54 @@
{
"_args": [
[
"chain-function@1.0.0",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "chain-function@1.0.0",
"_id": "chain-function@1.0.0",
"_inBundle": false,
"_integrity": "sha1-DUqzfn4Y6tC9xHuSB2QRjOWHM9w=",
"_location": "/material-ui/chain-function",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "chain-function@1.0.0",
"name": "chain-function",
"escapedName": "chain-function",
"rawSpec": "1.0.0",
"saveSpec": null,
"fetchSpec": "1.0.0"
},
"_requiredBy": [
"/material-ui/react-transition-group"
],
"_resolved": "https://registry.npmjs.org/chain-function/-/chain-function-1.0.0.tgz",
"_spec": "1.0.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "jquense"
},
"bugs": {
"url": "https://github.com/jquense/chain-function/issues"
},
"description": "chain a bunch of functions together into a single call",
"homepage": "https://github.com/jquense/chain-function#readme",
"keywords": [
"chain",
"compose",
"function"
],
"license": "MIT",
"main": "index.js",
"name": "chain-function",
"repository": {
"type": "git",
"url": "git+https://github.com/jquense/chain-function.git"
},
"scripts": {
"test": "node ./test.js"
},
"version": "1.0.0"
}

View File

@@ -0,0 +1,29 @@
var assert = require('assert')
var chain = require('./index')
console.log('testing...')
var count = 0;
chain(
function(step){ count += step },
function(step){ count += step },
function(step){ count += step }
)(1)
assert.equal(count, 3, 'should chain calls')
count = 0;
chain(
function(step){ count += step },
null, undefined,
function(step){ count += step }
)(1)
assert.equal(count, 2, 'should filter out null and undefined arguments')
var fn = function(){}
assert.equal(chain(fn, null), fn, 'should return the only function argument')
console.log('done. tests pass!')