Nik Atlas 6 роки тому
батько
коміт
2670ec4023

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 node_modules/
+
 database/mydb/

+ 2 - 1
database/db.js

@@ -54,7 +54,8 @@ const database = {
 	},
 	createSearchStream: function(keys, options){
 		return this.index.createSearchStream(keys, options);	
-	}
+	},
+	search: this.createSearchStream
 };
 
 module.exports = database;

+ 4 - 16
database/db.test.js

@@ -1,26 +1,14 @@
 var database = require("./db.js");
 database.init();
-// database.put('namezzzzzz', {asd: "gdfhdfh"}, function (err) {
-//   if (err) return console.log('Ooops!', err) // some kind of I/O error
 
-//   // 3) Fetch by key
-//   database.get('namezzzzzz', function (err, value) {
-//     if (err) return console.log('Ooops!', err) // likely the key was not found
-
-//     // Ta da!
-//     console.log('name is=' + JSON.stringify(value))
-//   })
-// })
-
-database.put('asdad', {username: "nik"}).
+database.put('naaa', {username: "nik"}).
 then(() => database.put('asdad2', {username: "nik2"})).
 then(() => database.put('asdad3', {username: "nik3"})).
 then(() => database.put('asdad4', {username: "nik4"})).
 then(() => database.put('asdad5', {username: "nik5"})).then(function(value){
-	return database.get('naaa');
-}).//then(console.log).
+	return database.get('dasnaaa').catch((e)=>console.log(e.name === "NotFoundError"));
+}).then(console.log).
 then(() => {
-	database.index.search(['username', 'dimos'])//.on('data', (a) => console.log(a))
-	.then(console.log);
+	let a = database.index.createSearchStream(['username', 'nik']).on('data', (a) => console.log(a));
 })
 .catch(console.log);

BIN
database/mydb/000005.ldb


BIN
database/mydb/000008.ldb


BIN
database/mydb/000023.ldb


BIN
database/mydb/000028.ldb


+ 1 - 1
database/mydb/CURRENT

@@ -1 +1 @@
-MANIFEST-000145
+MANIFEST-000046

+ 5 - 9
database/mydb/LOG

@@ -1,9 +1,5 @@
-2018/01/20-20:45:03.080 334 Recovering log #144
-2018/01/20-20:45:03.080 334 Level-0 table #146: started
-2018/01/20-20:45:03.178 334 Level-0 table #146: 394 bytes OK
-2018/01/20-20:45:03.246 334 Delete type=0 #144
-2018/01/20-20:45:03.247 334 Delete type=2 #145
-2018/01/20-20:45:03.247 334 Delete type=3 #142
-2018/01/20-20:45:03.249 164 Compacting 8@0 + 1@1 files
-2018/01/20-20:45:03.299 164 Generated table #148@0: 18 keys, 603 bytes
-2018/01/20-20:45:03.299 164 Compacted 8@0 + 1@1 files => 603 bytes
+2018/01/28-14:38:37.296 1188 Recovering log #45
+2018/01/28-14:38:37.297 1188 Level-0 table #47: started
+2018/01/28-14:38:37.302 1188 Level-0 table #47: 405 bytes OK
+2018/01/28-14:38:37.308 1188 Delete type=0 #45
+2018/01/28-14:38:37.309 1188 Delete type=3 #43

+ 5 - 7
database/mydb/LOG.old

@@ -1,7 +1,5 @@
-2018/01/20-20:44:34.468 3f8 Recovering log #141
-2018/01/20-20:44:34.469 3f8 Level-0 table #143: started
-2018/01/20-20:44:34.541 3f8 Level-0 table #143: 394 bytes OK
-2018/01/20-20:44:34.632 3f8 Delete type=0 #141
-2018/01/20-20:44:34.632 3f8 Delete type=2 #142
-2018/01/20-20:44:34.633 3f8 Delete type=3 #139
-2018/01/20-20:44:34.634 ab4 Compacting 7@0 + 1@1 files
+2018/01/28-14:37:34.470 2ae4 Recovering log #41
+2018/01/28-14:37:34.470 2ae4 Level-0 table #44: started
+2018/01/28-14:37:34.481 2ae4 Level-0 table #44: 406 bytes OK
+2018/01/28-14:37:34.488 2ae4 Delete type=0 #41
+2018/01/28-14:37:34.488 2ae4 Delete type=3 #39

BIN
database/repositories/mydb/000026.ldb


BIN
database/repositories/mydb/000028.ldb


BIN
database/repositories/mydb/000031.ldb


BIN
database/repositories/mydb/000034.ldb


BIN
database/repositories/mydb/000035.log


+ 1 - 0
database/repositories/mydb/CURRENT

@@ -0,0 +1 @@
+MANIFEST-000033

+ 0 - 0
database/repositories/mydb/LOCK


+ 5 - 0
database/repositories/mydb/LOG

@@ -0,0 +1,5 @@
+2018/01/28-15:00:48.261 1464 Recovering log #32
+2018/01/28-15:00:48.261 1464 Level-0 table #34: started
+2018/01/28-15:00:48.266 1464 Level-0 table #34: 898 bytes OK
+2018/01/28-15:00:48.272 1464 Delete type=0 #32
+2018/01/28-15:00:48.273 1464 Delete type=3 #30

+ 5 - 0
database/repositories/mydb/LOG.old

@@ -0,0 +1,5 @@
+2018/01/28-15:00:02.843 2970 Recovering log #29
+2018/01/28-15:00:02.843 2970 Level-0 table #31: started
+2018/01/28-15:00:02.848 2970 Level-0 table #31: 909 bytes OK
+2018/01/28-15:00:02.853 2970 Delete type=0 #29
+2018/01/28-15:00:02.854 2970 Delete type=3 #27

BIN
database/repositories/mydb/MANIFEST-000033


+ 49 - 4
database/repositories/users.js

@@ -1,12 +1,57 @@
 const db = require("../db.js");
+var CryptoJS = require('crypto-js');
 
 const userRepository = {
-	login: function(){
-
+	login: function(params){
+		const {
+			username,
+			password
+		} = params;
+		return db.get('user:' + username).
+		then((data) => {
+			if (data.password === CryptoJS.SHA256(data.salt + password).toString()) {
+				// match 
+				// generate token
+  				let Token = CryptoJS.SHA256(Math.random().toString() + data.salt).toString();
+  				data.token = Token;
+  				return db.put('user:' + username, data).then(() => data);
+			}
+			let error = new Error("Bad Credentials");
+			error.name = "BadCredentials";
+			throw error;
+		});
 	},
-	register: function(obj){
-		
+	register: function(params) {
+		const {
+			username,
+			password,
+			email
+		} = params;
 
+    	const hashFn = CryptoJS.SHA256;
+    	const salt = CryptoJS.lib.WordArray.random(128 / 8).toString();
+    	const hash = hashFn(salt + password).toString();
+    	const newuser = { 
+			email,
+			password: hash,
+			salt: salt,
+			username
+		};
+    	//check if username exists 
+    	return db.get('user:' + username).
+    	then((data) => {
+    		let error = new Error("Username exists: " + username);
+    		error.name = "UsernameExists";
+    		throw error;
+    	}).
+    	catch((err) => {
+    		if( err.name === "NotFoundError" ) {
+    			//register 
+    			return db.put('user:' + username, newuser);
+    		}
+    		throw err;
+    	}).
+    	then(() => newuser);
 	},
 	getByID: function(id){
 		return db.get("user:" + id);

+ 22 - 0
database/repositories/users.test.js

@@ -0,0 +1,22 @@
+var db = require('../db.js');
+var users = require('./users.js');
+
+db.init();
+
+let u = {
+	username: "test",
+	password: "test",
+	email: "[email protected]"
+}
+
+users.register(u).then(console.log).
+catch((e) => {
+	if(e.name === "UsernameExists"){
+		console.log("Username exists register is bypassed!");
+	}
+});
+
+users.login(u).then(console.log).
+catch((e) => {
+	console.log(e);
+});

+ 338 - 0
package-lock.json

@@ -85,6 +85,11 @@
       "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
       "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
     },
+    "base64-js": {
+      "version": "0.0.2",
+      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz",
+      "integrity": "sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q="
+    },
     "basic-auth": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz",
@@ -123,11 +128,36 @@
         "type-is": "1.6.15"
       }
     },
+    "bops": {
+      "version": "0.0.7",
+      "resolved": "https://registry.npmjs.org/bops/-/bops-0.0.7.tgz",
+      "integrity": "sha1-tKClqDmkBkVK8P4FqLkaenZqVOI=",
+      "requires": {
+        "base64-js": "0.0.2",
+        "to-utf8": "0.0.1"
+      }
+    },
     "bytes": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
       "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
     },
+    "bytewise": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-0.5.0.tgz",
+      "integrity": "sha1-pI+dR+Za4/QFqv6SqwZcjDauvK0=",
+      "requires": {
+        "es6-shim": "0.35.3"
+      }
+    },
+    "bytewise-core": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz",
+      "integrity": "sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI=",
+      "requires": {
+        "typewise-core": "1.2.0"
+      }
+    },
     "camelcase": {
       "version": "1.2.1",
       "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
@@ -322,6 +352,11 @@
         "prr": "1.0.1"
       }
     },
+    "es6-shim": {
+      "version": "0.35.3",
+      "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.3.tgz",
+      "integrity": "sha1-m/tzY/7//4emzbbNk+QF7DxLbyY="
+    },
     "escape-html": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -609,6 +644,164 @@
         "levelup": "2.0.1"
       }
     },
+    "level-post": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/level-post/-/level-post-1.0.5.tgz",
+      "integrity": "sha1-KmY5BAm/ahYhpES6tvAWREzJgCw=",
+      "requires": {
+        "ltgt": "2.2.0"
+      }
+    },
+    "level-search": {
+      "version": "1.8.0",
+      "resolved": "https://registry.npmjs.org/level-search/-/level-search-1.8.0.tgz",
+      "integrity": "sha1-F5QhjmvXBDZdAzUjvkTWHkCEjq8=",
+      "requires": {
+        "bytewise": "0.5.0",
+        "pull-level": "1.5.2",
+        "pull-stream": "2.22.2",
+        "pull-stream-to-stream": "1.2.6",
+        "safe-regex": "0.0.1",
+        "typewiselite": "0.7.1"
+      }
+    },
+    "level-sublevel": {
+      "version": "6.6.1",
+      "resolved": "https://registry.npmjs.org/level-sublevel/-/level-sublevel-6.6.1.tgz",
+      "integrity": "sha1-+ad/dSGrcKj46S7VbyGjx4hqRIU=",
+      "requires": {
+        "bytewise": "1.1.0",
+        "levelup": "0.19.1",
+        "ltgt": "2.1.3",
+        "pull-level": "2.0.3",
+        "pull-stream": "3.6.1",
+        "typewiselite": "1.0.0",
+        "xtend": "4.0.1"
+      },
+      "dependencies": {
+        "abstract-leveldown": {
+          "version": "0.12.4",
+          "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-0.12.4.tgz",
+          "integrity": "sha1-KeGOYy5g5OIh1YECR4UqY9ey5BA=",
+          "requires": {
+            "xtend": "3.0.0"
+          },
+          "dependencies": {
+            "xtend": {
+              "version": "3.0.0",
+              "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz",
+              "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo="
+            }
+          }
+        },
+        "bl": {
+          "version": "0.8.2",
+          "resolved": "https://registry.npmjs.org/bl/-/bl-0.8.2.tgz",
+          "integrity": "sha1-yba8oI0bwuoA/Ir7Txpf0eHGbk4=",
+          "requires": {
+            "readable-stream": "1.0.34"
+          }
+        },
+        "bytewise": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz",
+          "integrity": "sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4=",
+          "requires": {
+            "bytewise-core": "1.2.3",
+            "typewise": "1.0.3"
+          }
+        },
+        "deferred-leveldown": {
+          "version": "0.2.0",
+          "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-0.2.0.tgz",
+          "integrity": "sha1-LO8fER4cV4cNi7uK8mUOWHzS9bQ=",
+          "requires": {
+            "abstract-leveldown": "0.12.4"
+          }
+        },
+        "isarray": {
+          "version": "0.0.1",
+          "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+          "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
+        },
+        "levelup": {
+          "version": "0.19.1",
+          "resolved": "https://registry.npmjs.org/levelup/-/levelup-0.19.1.tgz",
+          "integrity": "sha1-86anIFJyxLXzXkEv8ASgOgrt9Qs=",
+          "requires": {
+            "bl": "0.8.2",
+            "deferred-leveldown": "0.2.0",
+            "errno": "0.1.6",
+            "prr": "0.0.0",
+            "readable-stream": "1.0.34",
+            "semver": "5.1.1",
+            "xtend": "3.0.0"
+          },
+          "dependencies": {
+            "xtend": {
+              "version": "3.0.0",
+              "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz",
+              "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo="
+            }
+          }
+        },
+        "ltgt": {
+          "version": "2.1.3",
+          "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.3.tgz",
+          "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ="
+        },
+        "prr": {
+          "version": "0.0.0",
+          "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz",
+          "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo="
+        },
+        "pull-level": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npmjs.org/pull-level/-/pull-level-2.0.3.tgz",
+          "integrity": "sha1-lQBjXiV5Rdb+7eGF9deiR3NFWxc=",
+          "requires": {
+            "level-post": "1.0.5",
+            "pull-cat": "1.1.11",
+            "pull-live": "1.0.1",
+            "pull-pushable": "2.1.2",
+            "pull-stream": "3.6.1",
+            "pull-window": "2.1.4",
+            "stream-to-pull-stream": "1.7.2"
+          }
+        },
+        "pull-stream": {
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.1.tgz",
+          "integrity": "sha1-xcKuSlEkbv7rzGXAQSo9clqSzgA="
+        },
+        "readable-stream": {
+          "version": "1.0.34",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
+          "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
+          "requires": {
+            "core-util-is": "1.0.2",
+            "inherits": "2.0.3",
+            "isarray": "0.0.1",
+            "string_decoder": "0.10.31"
+          }
+        },
+        "semver": {
+          "version": "5.1.1",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-5.1.1.tgz",
+          "integrity": "sha1-oykqNz5vPgeY2gsgZBuanFvEfhk="
+        },
+        "string_decoder": {
+          "version": "0.10.31",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+          "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
+        },
+        "typewiselite": {
+          "version": "1.0.0",
+          "resolved": "https://registry.npmjs.org/typewiselite/-/typewiselite-1.0.0.tgz",
+          "integrity": "sha1-yIgvobsQksBgBal/NO9chQjjZk4="
+        }
+      }
+    },
     "leveldown": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-2.1.1.tgz",
@@ -637,6 +830,16 @@
       "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
       "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc="
     },
+    "looper": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/looper/-/looper-2.0.0.tgz",
+      "integrity": "sha1-Zs0Md0rz1P7axTeU90LbVtqPCew="
+    },
+    "ltgt": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.0.tgz",
+      "integrity": "sha1-tlul/LNJopkkyOMz98alVi8uSEI="
+    },
     "media-typer": {
       "version": "0.3.0",
       "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -970,6 +1173,81 @@
       "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.5.tgz",
       "integrity": "sha512-rJlH1lXerCIAtImXBze3dtKq/ykZMA4rpO9FnPcIgsWcxZLOvd8zltaoeOVFyBSSqCkhhJWbEbTMga8UxWUUSA=="
     },
+    "pull-cat": {
+      "version": "1.1.11",
+      "resolved": "https://registry.npmjs.org/pull-cat/-/pull-cat-1.1.11.tgz",
+      "integrity": "sha1-tkLdElXaN2pwa220+pYvX9t0wxs="
+    },
+    "pull-core": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/pull-core/-/pull-core-1.0.0.tgz",
+      "integrity": "sha1-4OuTkY36cJY+0J429j2qFbdrOKQ="
+    },
+    "pull-level": {
+      "version": "1.5.2",
+      "resolved": "https://registry.npmjs.org/pull-level/-/pull-level-1.5.2.tgz",
+      "integrity": "sha1-K0vcjquNTy43CLSVEjULFLsDW1Y=",
+      "requires": {
+        "level-post": "1.0.5",
+        "pull-cat": "1.1.11",
+        "pull-pushable": "2.1.2",
+        "pull-stream": "3.6.1",
+        "pull-window": "2.1.4",
+        "stream-to-pull-stream": "1.7.2"
+      },
+      "dependencies": {
+        "pull-stream": {
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.1.tgz",
+          "integrity": "sha1-xcKuSlEkbv7rzGXAQSo9clqSzgA="
+        }
+      }
+    },
+    "pull-live": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/pull-live/-/pull-live-1.0.1.tgz",
+      "integrity": "sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU=",
+      "requires": {
+        "pull-cat": "1.1.11",
+        "pull-stream": "3.6.1"
+      },
+      "dependencies": {
+        "pull-stream": {
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.1.tgz",
+          "integrity": "sha1-xcKuSlEkbv7rzGXAQSo9clqSzgA="
+        }
+      }
+    },
+    "pull-pushable": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/pull-pushable/-/pull-pushable-2.1.2.tgz",
+      "integrity": "sha1-P+Fbj37sifOXLSOLwEiQyUBabbs="
+    },
+    "pull-stream": {
+      "version": "2.22.2",
+      "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-2.22.2.tgz",
+      "integrity": "sha1-fK/ZLDLyjjQhcpt0SByaiBugeVg=",
+      "requires": {
+        "pull-core": "1.0.0"
+      }
+    },
+    "pull-stream-to-stream": {
+      "version": "1.2.6",
+      "resolved": "https://registry.npmjs.org/pull-stream-to-stream/-/pull-stream-to-stream-1.2.6.tgz",
+      "integrity": "sha1-3Z+jcy7bPRbmfNHyJLyjim1XSMc=",
+      "requires": {
+        "pull-core": "1.0.0"
+      }
+    },
+    "pull-window": {
+      "version": "2.1.4",
+      "resolved": "https://registry.npmjs.org/pull-window/-/pull-window-2.1.4.tgz",
+      "integrity": "sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA=",
+      "requires": {
+        "looper": "2.0.0"
+      }
+    },
     "pump": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz",
@@ -1038,6 +1316,11 @@
         "path-parse": "1.0.5"
       }
     },
+    "ret": {
+      "version": "0.1.15",
+      "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
+      "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
+    },
     "right-align": {
       "version": "0.1.3",
       "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
@@ -1051,6 +1334,14 @@
       "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
       "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
     },
+    "safe-regex": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-0.0.1.tgz",
+      "integrity": "sha1-NQrjK0m33HXRysOhjLizdalO8Vw=",
+      "requires": {
+        "ret": "0.1.15"
+      }
+    },
     "semver": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
@@ -1144,6 +1435,27 @@
       "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
       "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
     },
+    "stream-to-pull-stream": {
+      "version": "1.7.2",
+      "resolved": "https://registry.npmjs.org/stream-to-pull-stream/-/stream-to-pull-stream-1.7.2.tgz",
+      "integrity": "sha1-dXYJrhzr0zx0MtSvvjH/eGULnd4=",
+      "requires": {
+        "looper": "3.0.0",
+        "pull-stream": "3.6.1"
+      },
+      "dependencies": {
+        "looper": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/looper/-/looper-3.0.0.tgz",
+          "integrity": "sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k="
+        },
+        "pull-stream": {
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.1.tgz",
+          "integrity": "sha1-xcKuSlEkbv7rzGXAQSo9clqSzgA="
+        }
+      }
+    },
     "string-width": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@@ -1197,6 +1509,11 @@
         "xtend": "4.0.1"
       }
     },
+    "to-utf8": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz",
+      "integrity": "sha1-0Xrqcv8vujm55DYBvns/9y4ImFI="
+    },
     "token-stream": {
       "version": "0.0.1",
       "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz",
@@ -1219,6 +1536,27 @@
         "mime-types": "2.1.17"
       }
     },
+    "typewise": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz",
+      "integrity": "sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE=",
+      "requires": {
+        "typewise-core": "1.2.0"
+      }
+    },
+    "typewise-core": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz",
+      "integrity": "sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU="
+    },
+    "typewiselite": {
+      "version": "0.7.1",
+      "resolved": "https://registry.npmjs.org/typewiselite/-/typewiselite-0.7.1.tgz",
+      "integrity": "sha1-GpWBmwzVSgeNGc3qwKmiZij3PK4=",
+      "requires": {
+        "bops": "0.0.7"
+      }
+    },
     "uglify-js": {
       "version": "2.8.29",
       "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",