diff --git a/frontend/src/App.js b/frontend/src/App.js
index 949dbc6..6670079 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -13,7 +13,8 @@ import {
import {
Modal,
- Button
+ Button,
+ Form
} from "react-bootstrap";
const REMOTE_ADDR = "http://45.33.13.215:4502";
@@ -957,8 +958,8 @@ function Rankings(){
- {users.map((user)=>
-
+ {users.map((user,i)=>
+
{user.username}
{user.last_played}
@@ -1218,10 +1219,294 @@ function RecentPlays(p) {
)
}
+function LoginInfo(p) {
+ const [username,setUsername] = useState(undefined)
+ const [authToken,setAuthToken] = useState(undefined)
+ const [loggedIn,setLoggedIn] = useState(false)
+ //Load our storage data if exists.
+ useEffect(()=>{
+ try {
+ setUsername(localStorage.getItem("username"))
+ setAuthToken(localStorage.getItem("authToken"))
+ }catch{
+ console.log("Not logged in!");
+ }
+ },[p.update])
+
+ useEffect(()=>{
+ if (username!==undefined&&authToken!==undefined) {
+ axios.post("http://projectdivar.com/authenticate/login",{username:username,authCode:authToken})
+ .then((data)=>{
+ setLoggedIn(true);
+ p.setUsername(username);
+ })
+ .catch((err)=>{
+ setLoggedIn(false);
+ })
+ }
+ },[username,authToken])
+
+ return (
+ <>
+ {loggedIn?<>
+ Welcome, {username} !
+ App Auth Code
+
+ >:<>
+ Login
+ Register
+ >}
+ >
+ )
+}
+
+function Login(p) {
+ const [username,setUsername] = useState("")
+ const [authCode,setAuthCode] = useState("")
+ const [authCodeVisible,setAuthCodeVisible] = useState(false)
+ const [error,setError] = useState(false)
+ const [disabled,setDisabled] = useState(false)
+
+ let history = useHistory();
+
+ if (p.isLoggedIn) {
+ history.push("/")
+ }
+
+ return (
+ <>
+
+ Username
+ {setUsername(e.currentTarget.value)}} placeholder="MikuMiku" value={username} />
+
+ We will send an email to the registered email of this account.
+
+
+ {authCodeVisible&&<>
+
+
+
+ Authentication Code
+ {setAuthCode(e.currentTarget.value)}} placeholder="XXXXX" value={authCode} />
+
+ Please enter the code you received in your email here. Then submit again.
+
+
+
+
>
+ }
+ {e.preventDefault()
+ if (username.length>=1) {
+ setDisabled(true)
+ setError(false)
+ if (authCode.length===5) {
+ axios.post("http://projectdivar.com/authenticate/login",{username:username,authCode:authCode})
+ .then((data)=>{
+ localStorage.setItem("username",username)
+ localStorage.setItem("authToken",authCode)
+ p.setLoginPanelUpdate(true)
+ history.push("/")
+ })
+ .catch((err)=>{
+ if (err) {
+ setError("Invalid Authentication Code!")
+ setDisabled(false)
+ }
+ })
+ } else {
+ axios.post("http://projectdivar.com/sendemail/login",{username:username})
+ .then((data)=>{
+ setAuthCodeVisible(true)
+ setDisabled(false)
+ })
+ .catch((err)=>{
+ if (err) {
+ setError("Invalid credentials provided!")
+ setDisabled(false)
+ }
+ })
+ }
+ }
+ }}>
+ {authCodeVisible?"Submit Code":"Login"}
+
+
+ >
+ )
+}
+
+function Register(p) {
+ const [username,setUsername] = useState("")
+ const [email,setEmail] = useState("")
+ const [authCode,setAuthCode] = useState("")
+ const [authCodeVisible,setAuthCodeVisible] = useState(false)
+ const [error,setError] = useState(false)
+ const [disabled,setDisabled] = useState(false)
+ let history = useHistory();
+
+ if (p.isLoggedIn) {
+ history.push("/")
+ }
+
+ return (
+ <>
+
+ Username
+ {setUsername(e.currentTarget.value)}} placeholder="MikuMiku" value={username} />
+
+
+ Email Address
+ {setEmail(e.currentTarget.value)}} placeholder="MikuMiku@39.net" value={email} />
+
+ Please provide a valid email address! We use your email account as your "password", so it is a requirement for this site.
+
+
+ {authCodeVisible&&<>
+
+
+
+ Authentication Code
+ {setAuthCode(e.currentTarget.value)}} placeholder="XXXXX" value={authCode} />
+
+ Please enter the code you received in your email here. Then submit again.
+
+
+
+
>
+ }
+ {e.preventDefault()
+ if (username.length>=1&&email.length>=1) {
+ setDisabled(true)
+ setError(false)
+ if (authCode.length===5) {
+ axios.post("http://projectdivar.com/authenticate/login",{username:username,authCode:authCode})
+ .then((data)=>{
+ localStorage.setItem("username",username)
+ localStorage.setItem("authToken",authCode)
+ p.setLoginPanelUpdate(true)
+ return axios.patch("http://projectdivar.com/updateRegisteredState",{username:username,authCode:authCode})
+ })
+ .then((data)=>{
+ //console.log(data)
+ history.push("/")
+ })
+ .catch((err)=>{
+ if (err) {
+ setError("Invalid Authentication Code!")
+ setDisabled(false)
+ }
+ })
+ } else {
+ axios.post("http://projectdivar.com/sendemail/register",{username:username,email:email})
+ .then((data)=>{
+ setAuthCodeVisible(true)
+ setDisabled(false)
+ })
+ .catch((err)=>{
+ if (err) {
+ setError("Username or Email already in use!")
+ setDisabled(false)
+ }
+ })
+ }
+ }
+ }}>
+ {authCodeVisible?"Submit Code":"Register"}
+
+
+ >
+ )
+}
+
+function UserAuth(p) {
+ const[showAuthCode,setShowAuthCode] = useState(false)
+ const[authToken,setAuthToken] = useState("")
+ let history = useHistory();
+
+ if (!p.isLoggedIn) {
+ history.push("/")
+ }
+
+ return(<>
+ Your App Authentication Code is used for verifying your identity when using apps such as DivaBot . By clicking the {""} button, you understand that you should not share this code or show it to anyone!
+
+ {showAuthCode?
+
+ :{
+ axios.post("http://projectdivar.com/authenticate/authToken",{username:localStorage.getItem("username"),
+ authCode:localStorage.getItem("authToken")})
+ .then((data)=>{
+ setAuthToken(data.data.authentication_token)
+ setShowAuthCode(true)
+ })
+ .catch((err)=>{
+ setAuthToken(err.message)
+ })
+ }
+ }>
+ {""}
+
+ }
+ >)
+}
+
+function ReleaseList(p) {
+ return(
+ <>
+
+ >
+ )
+}
+
+function DivaBot() {
+ const releases=[
+ ["01B","http://projectdivar.com/files/releases/DivaBot01B.zip","13 Sep 2020"],
+ ["01A","http://projectdivar.com/files/releases/DivaBot01A.zip","13 Sep 2020"],
+ ["01","http://projectdivar.com/files/releases/DivaBot01.zip","13 Sep 2020"]]
+
+ return (
+ <>
+ DivaBot was created by sigonasr2 in order to allow Project Diva streamers to personalize their stream setups with their personal scores and achievements into their game.
+
+
+ The app works by monitoring your game's capture area as you are streaming in order to identify what song you are playing, and what scores you achieve. It is used with this website to make score
+ submitting and tracking easier.
+
+ The app currently supports Megamix . Other games will be supported in the future.
+
+ Setup Instructions
+ {VIDEO }
+
+ Downloads
+
+ >
+ )
+}
+
function Website() {
const [songs,setSongs] = useState([])
const [update,setUpdate] = useState(false)
const [tooltip,setTooltip] = useState("")
+ const [loginPanelUpdate,setLoginPanelUpdate] = useState(false)
+ const [username,setUsername] = useState(undefined)
useEffect(()=>{
axios.get("http://www.projectdivar.com/songs")
@@ -1233,11 +1518,11 @@ function Website() {
return (
-
Sidebar Contents
+ Menu
+
+
Rankings
- Item 2
- Item 3
- Item 4
+ DivaBot
@@ -1252,13 +1537,26 @@ function Website() {
-
-
+
+ DivaBot
+
+
+
+ App Authentication Token
+
Project DivaR
+
+ Login to Project DivaR
+
+
+
+ Register New Account
+
+
Project DivaR
Under construction!
diff --git a/frontend/src/setupProxy.js b/frontend/src/setupProxy.js
index 9dfd225..6c30759 100644
--- a/frontend/src/setupProxy.js
+++ b/frontend/src/setupProxy.js
@@ -1,6 +1,27 @@
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) {
+ app.use(
+ "/authenticate/authToken",
+ createProxyMiddleware({
+ target: 'http://server:4501',
+ changeOrigin: true,
+ })
+ );
+ app.use(
+ "/updateRegisteredState",
+ createProxyMiddleware({
+ target: 'http://server:4501',
+ changeOrigin: true,
+ })
+ );
+ app.use(
+ "/authenticate/login",
+ createProxyMiddleware({
+ target: 'http://server:4501',
+ changeOrigin: true,
+ })
+ );
app.use(
"/authenticateuser",
createProxyMiddleware({
@@ -106,13 +127,6 @@ module.exports = function(app) {
changeOrigin: true,
})
);
- app.use(
- "/register",
- createProxyMiddleware({
- target: 'http://server:4501',
- changeOrigin: true,
- })
- );
app.use(
"/remove",
createProxyMiddleware({
diff --git a/server/app.js b/server/app.js
index 656eea8..73d3c2b 100644
--- a/server/app.js
+++ b/server/app.js
@@ -16,6 +16,7 @@ const nodemailer = require('nodemailer');
const fileUpload = require('express-fileupload');
const unzipper = require('unzipper');
const fs = require('fs');
+const moment = require('moment');
app.use(
fileUpload({createParentPath:true,
limits: { fileSize: 15 * 1024 * 1024, files: 1 },
@@ -81,7 +82,7 @@ app.get('/songs', (req, res) => {
})
})
-app.post('/register', (req, res) => {
+/*app.post('/register', (req, res) => {
if (req.body && req.body.username &&
req.body.username.length>2 && req.body.email) {
var duplicateFound=false;
@@ -98,7 +99,7 @@ req.body.username.length>2 && req.body.email) {
} else {
res.status(400).json("Invalid username!")
}
-})
+})*/
app.delete('/remove',(req,res)=>{
if (req.body &&
@@ -281,6 +282,9 @@ CalculateSongScore=(song)=>{
console.log("Is PFC? "+(song.fine===0&&song.safe===0&&song.sad===0&&song.worst===0))*/
var scoreMult=1;
var percentMult=1;
+ if (song.percent>110) {
+ song.percent=100
+ }
if (song.fine===0&&song.safe===0&&song.sad===0&&song.worst===0){scoreMult=2.4}else if(comboBreaks===0){scoreMult=1.4}else{scoreMult=1}
switch (song.difficulty){
case "E":{if(song.percent<30){percentMult=0;}else{percentMult=1+Math.pow(1.0*((song.percent-30)/70.0),3)}}break;
@@ -704,7 +708,30 @@ app.post('/song/:songname/:difficulty',(req,res)=>{
})
function CheckUserExists(username,email) {
- return db.query("select id,username,email from users where username=$1 or email=$2 limit 1",[username,email])
+ return db.query("select id,username,email,registered from users where username=$1 or email=$2 limit 1",[username,email])
+}
+
+function SendLoginEmail(username,emailTo,authCode) {
+ const transporter = nodemailer.createTransport({
+ service: 'gmail',
+ auth: {
+ user: 'admin@projectdivar.com',
+ pass: process.env.GMAIL // naturally, replace both with your real credentials or an application-specific password
+ }
+ });
+ transporter.sendMail({
+ from: 'admin@projectdivar.com',
+ to: emailTo,
+ subject: 'Project DivaR Login Code',
+ html: `${username} , Thank you for using Project DivaR! Your authentication code is ${authCode} !`
+ }, (err, info) => {
+ if (err) {
+ console.log(err.message)
+ } else {
+ console.log(info.envelope);
+ console.log(info.messageId);
+ }
+ });
}
function SendRegistrationEmail(username,emailTo,authCode) {
@@ -730,24 +757,127 @@ function SendRegistrationEmail(username,emailTo,authCode) {
});
}
+function GetUserInfo(username) {
+ return db.query("select id,username,email,code_time from users where username=$1 limit 1",[username])
+}
+function GetUserLoginAllowed(username,authCode) {
+ return db.query("select id,username,email,code_time from users where username=$1 and code=$2 limit 1",[username,authCode])
+}
+app.post('/authenticate/authToken',(req,res)=>{
+ if (req.body&&req.body.username&&req.body.authCode) {
+ GetUserLoginAllowed(req.body.username.trim(),req.body.authCode.trim())
+ .then((data)=>{
+ if (data.rows.length>0) {
+ return db.query("select authentication_token from users where id=$1",[data.rows[0].id])
+ } else {
+ return new Error("Failed login!")
+ }
+ })
+ .then((data)=>{
+ if (data.rows.length>0) {
+ res.status(200).json(data.rows[0])
+ } else {
+ return new Error("Failed to get authentication token!")
+ }
+ })
+ .catch((err)=>{
+ res.status(500).json(err.message)
+ })
+ } else {
+ res.status(400).json("Invalid Credentials!")
+ }
+})
+
+app.post('/authenticate/login',(req,res)=>{
+ if (req.body&&req.body.username&&req.body.authCode) {
+ GetUserLoginAllowed(req.body.username.trim(),req.body.authCode.trim())
+ .then((data)=>{
+ if (data.rows.length>0) {
+ res.status(200).json("Login allowed!")
+ } else {
+ res.status(400).json("Failed login!")
+ }
+ })
+ } else {
+ res.status(400).json("Invalid Credentials!")
+ }
+})
+
+app.post('/sendemail/login',function(req,res) {
+ if (req.body&&req.body.username) {
+ GetUserInfo(req.body.username.trim())
+ .then((data)=>{
+ if (data.rows.length>0) {
+ res.status(200).json("Email sent.")
+ //console.log(data.rows[0].code_time)
+ if (data.rows[0].code_time) {
+ if (moment(data.rows[0].code_time,"YYYY-MM-DD HH:mm:ss.SSSZ").diff(moment(),'minutes')<=-15) {
+ var authCode=Math.floor(Math.random()*90000)+10000
+ SendLoginEmail(req.body.username,data.rows[0].email,authCode)
+ db.query("update users set code=$1,code_time=$3 where id=$2",[authCode,data.rows[0].id,moment()])
+ }
+ //console.log(moment(data.rows[0].code_time,"YYYY-MM-DD HH:mm:ss.SSSZ").diff(moment(),'minutes'))
+ } else {
+ var authCode=Math.floor(Math.random()*90000)+10000
+ SendLoginEmail(req.body.username,data.rows[0].email,authCode)
+ db.query("update users set code=$1,code_time=$3 where id=$2",[authCode,data.rows[0].id,moment()])
+ }
+ } else {
+ res.status(400).json("User does not exist!")
+ }
+ })
+ } else {
+ res.status(400).json("Invalid credentials!")
+ }
+})
+
+app.patch('/updateRegisteredState',function(req,res) {
+ if (req.body&&req.body.username&&req.body.authCode) {
+ GetUserLoginAllowed(req.body.username,req.body.authCode)
+ .then((data)=>{
+ if (data.rows.length>0) {
+ return db.query("update users set registered=$1 where id=$2",[true,data.rows[0].id])
+ } else {
+ throw new Error("Could not login!")
+ }
+ })
+ .then((data)=>{
+ res.status(200).json("Registered!")
+ })
+ .catch((err)=>{
+ res.status(500).json("Could not finish registration!")
+ })
+ } else {
+ res.status(400).json("Invalid credentials!")
+ }
+})
+
app.post('/sendemail/register',function(req,res) {
if (req.body&&req.body.username&&req.body.email) {
//Generate a token for the user to login with.
- CheckUserExists(req.body.username,req.body.email)
+ CheckUserExists(req.body.username.trim(),req.body.email.trim())
.then((data)=>{
var authCode=Math.floor(Math.random()*90000)+10000
var authenticationToken=String(Math.floor(Math.random()*90000)+10000)+"-"+String(Math.floor(Math.random()*90000)+10000)+"-"+String(Math.floor(Math.random()*90000)+10000);
if (data.rows.length>0) {
- db.query("update users set code=$1 where id=$2",[authCode,data.rows[0].id])
+ //db.query("update users set code=$1 where id=$2",[authCode,data.rows[0].id])
+ if (data.rows[0].registered) {
+ throw new Error("User already exists!")
+ } else {
+ return db.query("update users set code=$1 where id=$2 returning code",[authCode,data.rows[0].id])
+ }
} else {
- db.query("insert into users(username,email,authentication_token,code) values($1,$2,$3,$4)",
+ return db.query("insert into users(username,email,authentication_token,code) values($1,$2,$3,$4) returning code",
[req.body.username,req.body.email,authenticationToken,authCode])
}
- return authCode
})
- .then((authCode)=>{
- res.status(200).json("Email sent.")
- SendRegistrationEmail(req.body.username,req.body.email,authCode)
+ .then((data)=>{
+ if (data.rows.length>0) {
+ res.status(200).json("Email sent.")
+ SendRegistrationEmail(req.body.username,req.body.email,data.rows[0].code)
+ } else {
+ res.status(500).json("Something bad happened!")
+ }
})
.catch((err)=>{
res.status(500).json(err.message)
@@ -763,7 +893,7 @@ function AuthenticateUser(username,auth) {
app.post('/authenticateuser',function(req,res) {
if (req.body&&req.body.username&&req.body.authenticationToken) {
- AuthenticateUser(req.body.username,req.body.authenticationToken)
+ AuthenticateUser(req.body.username.trim(),req.body.authenticationToken.trim())
.then((data)=>{
if (data.rows.length>0) {
res.status(200).json("Authentication Success!")
diff --git a/server/files/releases/DivaBot01.zip b/server/files/releases/DivaBot01.zip
new file mode 100644
index 0000000..52f3064
Binary files /dev/null and b/server/files/releases/DivaBot01.zip differ
diff --git a/server/files/releases/DivaBot01A.zip b/server/files/releases/DivaBot01A.zip
new file mode 100644
index 0000000..7874b01
Binary files /dev/null and b/server/files/releases/DivaBot01A.zip differ
diff --git a/server/files/releases/DivaBot01B.zip b/server/files/releases/DivaBot01B.zip
new file mode 100644
index 0000000..00d82f0
Binary files /dev/null and b/server/files/releases/DivaBot01B.zip differ
diff --git a/server/node_modules/arr-flatten/LICENSE b/server/node_modules/arr-flatten/LICENSE
deleted file mode 100755
index 3f2eca1..0000000
--- a/server/node_modules/arr-flatten/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014-2017, Jon Schlinkert.
-
-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/server/node_modules/arr-flatten/README.md b/server/node_modules/arr-flatten/README.md
deleted file mode 100755
index 7dc7a97..0000000
--- a/server/node_modules/arr-flatten/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-# arr-flatten [![NPM version](https://img.shields.io/npm/v/arr-flatten.svg?style=flat)](https://www.npmjs.com/package/arr-flatten) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-flatten.svg?style=flat)](https://npmjs.org/package/arr-flatten) [![NPM total downloads](https://img.shields.io/npm/dt/arr-flatten.svg?style=flat)](https://npmjs.org/package/arr-flatten) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-flatten.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-flatten) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/arr-flatten.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/arr-flatten)
-
-> Recursively flatten an array or arrays.
-
-## Install
-
-Install with [npm](https://www.npmjs.com/):
-
-```sh
-$ npm install --save arr-flatten
-```
-
-## Install
-
-Install with [bower](https://bower.io/)
-
-```sh
-$ bower install arr-flatten --save
-```
-
-## Usage
-
-```js
-var flatten = require('arr-flatten');
-
-flatten(['a', ['b', ['c']], 'd', ['e']]);
-//=> ['a', 'b', 'c', 'd', 'e']
-```
-
-## Why another flatten utility?
-
-I wanted the fastest implementation I could find, with implementation choices that should work for 95% of use cases, but no cruft to cover the other 5%.
-
-## About
-
-### Related projects
-
-* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter "Faster alternative to javascript's native filter method.")
-* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.")
-* [array-each](https://www.npmjs.com/package/array-each): Loop over each item in an array and call the given function on every element. | [homepage](https://github.com/jonschlinkert/array-each "Loop over each item in an array and call the given function on every element.")
-* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
-
-### Contributing
-
-Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
-
-### Contributors
-
-| **Commits** | **Contributor** |
-| --- | --- |
-| 20 | [jonschlinkert](https://github.com/jonschlinkert) |
-| 1 | [lukeed](https://github.com/lukeed) |
-
-### Building docs
-
-_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
-
-To generate the readme, run the following command:
-
-```sh
-$ npm install -g verbose/verb#dev verb-generate-readme && verb
-```
-
-### Running tests
-
-Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
-
-```sh
-$ npm install && npm test
-```
-
-### Author
-
-**Jon Schlinkert**
-
-* [github/jonschlinkert](https://github.com/jonschlinkert)
-* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
-
-### License
-
-Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
-Released under the [MIT License](LICENSE).
-
-***
-
-_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 05, 2017._
\ No newline at end of file
diff --git a/server/node_modules/arr-flatten/index.js b/server/node_modules/arr-flatten/index.js
deleted file mode 100644
index 0cb4ea4..0000000
--- a/server/node_modules/arr-flatten/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*!
- * arr-flatten
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
-
-'use strict';
-
-module.exports = function (arr) {
- return flat(arr, []);
-};
-
-function flat(arr, res) {
- var i = 0, cur;
- var len = arr.length;
- for (; i < len; i++) {
- cur = arr[i];
- Array.isArray(cur) ? flat(cur, res) : res.push(cur);
- }
- return res;
-}
diff --git a/server/node_modules/arr-flatten/package.json b/server/node_modules/arr-flatten/package.json
deleted file mode 100644
index 6fa18c2..0000000
--- a/server/node_modules/arr-flatten/package.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "_from": "arr-flatten@^1.1.0",
- "_id": "arr-flatten@1.1.0",
- "_inBundle": false,
- "_integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
- "_location": "/arr-flatten",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "arr-flatten@^1.1.0",
- "name": "arr-flatten",
- "escapedName": "arr-flatten",
- "rawSpec": "^1.1.0",
- "saveSpec": null,
- "fetchSpec": "^1.1.0"
- },
- "_requiredBy": [
- "/image-pixels",
- "/pxls",
- "/to-uint8"
- ],
- "_resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
- "_shasum": "36048bbff4e7b47e136644316c99669ea5ae91f1",
- "_spec": "arr-flatten@^1.1.0",
- "_where": "/home/sigonasr2/divar/server/node_modules/image-pixels",
- "author": {
- "name": "Jon Schlinkert",
- "url": "https://github.com/jonschlinkert"
- },
- "bugs": {
- "url": "https://github.com/jonschlinkert/arr-flatten/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Jon Schlinkert",
- "url": "http://twitter.com/jonschlinkert"
- },
- {
- "name": "Luke Edwards",
- "url": "https://lukeed.com"
- }
- ],
- "deprecated": false,
- "description": "Recursively flatten an array or arrays.",
- "devDependencies": {
- "ansi-bold": "^0.1.1",
- "array-flatten": "^2.1.1",
- "array-slice": "^1.0.0",
- "benchmarked": "^1.0.0",
- "compute-flatten": "^1.0.0",
- "flatit": "^1.1.1",
- "flatten": "^1.0.2",
- "flatten-array": "^1.0.0",
- "glob": "^7.1.1",
- "gulp-format-md": "^0.1.12",
- "just-flatten-it": "^1.1.23",
- "lodash.flattendeep": "^4.4.0",
- "m_flattened": "^1.0.1",
- "mocha": "^3.2.0",
- "utils-flatten": "^1.0.0",
- "write": "^0.3.3"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "files": [
- "index.js"
- ],
- "homepage": "https://github.com/jonschlinkert/arr-flatten",
- "keywords": [
- "arr",
- "array",
- "elements",
- "flat",
- "flatten",
- "nested",
- "recurse",
- "recursive",
- "recursively"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "arr-flatten",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/jonschlinkert/arr-flatten.git"
- },
- "scripts": {
- "test": "mocha"
- },
- "verb": {
- "toc": false,
- "layout": "default",
- "tasks": [
- "readme"
- ],
- "plugins": [
- "gulp-format-md"
- ],
- "related": {
- "list": [
- "arr-filter",
- "arr-union",
- "array-each",
- "array-unique"
- ]
- },
- "lint": {
- "reflinks": true
- }
- },
- "version": "1.1.0"
-}
diff --git a/server/node_modules/arraybuffer-to-string/.eslintrc.json b/server/node_modules/arraybuffer-to-string/.eslintrc.json
deleted file mode 100644
index aaddba5..0000000
--- a/server/node_modules/arraybuffer-to-string/.eslintrc.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "env": {
- "browser": true,
- "node": true,
- "commonjs": true,
- "es6": true
- },
- "extends": "eslint:recommended",
- "rules": {
- "strict": 2,
- "indent": 0,
- "linebreak-style": 0,
- "quotes": 0,
- "semi": 0,
- "no-cond-assign": 1,
- "no-constant-condition": 1,
- "no-duplicate-case": 1,
- "no-empty": 1,
- "no-ex-assign": 1,
- "no-extra-boolean-cast": 1,
- "no-extra-semi": 1,
- "no-fallthrough": 1,
- "no-func-assign": 1,
- "no-global-assign": 1,
- "no-implicit-globals": 2,
- "no-inner-declarations": ["error", "functions"],
- "no-irregular-whitespace": 2,
- "no-loop-func": 1,
- "no-magic-numbers": ["warn", { "ignore": [1, 0, -1], "ignoreArrayIndexes": true}],
- "no-multi-str": 1,
- "no-mixed-spaces-and-tabs": 1,
- "no-proto": 1,
- "no-sequences": 1,
- "no-throw-literal": 1,
- "no-unmodified-loop-condition": 1,
- "no-useless-call": 1,
- "no-void": 1,
- "no-with": 2,
- "wrap-iife": 1,
- "no-redeclare": 1,
- "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
- "no-sparse-arrays": 1
- }
-}
diff --git a/server/node_modules/arraybuffer-to-string/.travis.yml b/server/node_modules/arraybuffer-to-string/.travis.yml
deleted file mode 100644
index c8cd2d2..0000000
--- a/server/node_modules/arraybuffer-to-string/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
- - '6'
- - '5'
- - '4'
diff --git a/server/node_modules/arraybuffer-to-string/browser.js b/server/node_modules/arraybuffer-to-string/browser.js
deleted file mode 100644
index 52e2edf..0000000
--- a/server/node_modules/arraybuffer-to-string/browser.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @module arraybuffer-to-string/browser
- */
-
-'use strict'
-
-module.exports = function ArrayBufferToString (buffer, encoding) {
- if (encoding == null) encoding = 'utf8'
-
- var uint8 = new Uint8Array(buffer)
-
- if (encoding === 'hex') {
- var out = ''
- for (var i = 0, l = uint8.byteLength; i < l; ++i) {
- out += toHex(uint8[i])
- }
- return out
- }
-
- if (encoding === 'base64') {
- str = String.fromCharCode.apply(null, uint8)
- return btoa(str)
- }
-
- if (encoding === 'binary' ||
- encoding === 'latin1' ||
- !global.TextDecoder) {
- str = String.fromCharCode.apply(null, uint8)
- return str
- }
-
-
- //TextDecoder way
- if (encoding === 'utf16le') encoding = 'utf-16le'
-
- var decoder = new TextDecoder(encoding)
- var str = decoder.decode(uint8)
- return str
-}
-
-
-function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
-}
diff --git a/server/node_modules/arraybuffer-to-string/index.js b/server/node_modules/arraybuffer-to-string/index.js
deleted file mode 100644
index f4a57ae..0000000
--- a/server/node_modules/arraybuffer-to-string/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @module arraybuffer-to-string
- */
-
-'use strict'
-
-module.exports = function ArrayBufferToString (buffer, encoding) {
- if (encoding == null) encoding = 'utf8'
-
- return Buffer.from(buffer).toString(encoding)
-}
diff --git a/server/node_modules/arraybuffer-to-string/package.json b/server/node_modules/arraybuffer-to-string/package.json
deleted file mode 100644
index 0a526ae..0000000
--- a/server/node_modules/arraybuffer-to-string/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "_from": "arraybuffer-to-string@^1.0.2",
- "_id": "arraybuffer-to-string@1.0.2",
- "_inBundle": false,
- "_integrity": "sha512-WbIYlLVmvIAyUBdQRRuyGOJRriOQy9OAsWcyURmsRQp9+g647hdMSS2VFKXbJLVw0daUu06hqwLXm9etVrXI9A==",
- "_location": "/arraybuffer-to-string",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "arraybuffer-to-string@^1.0.2",
- "name": "arraybuffer-to-string",
- "escapedName": "arraybuffer-to-string",
- "rawSpec": "^1.0.2",
- "saveSpec": null,
- "fetchSpec": "^1.0.2"
- },
- "_requiredBy": [
- "/image-pixels"
- ],
- "_resolved": "https://registry.npmjs.org/arraybuffer-to-string/-/arraybuffer-to-string-1.0.2.tgz",
- "_shasum": "c373aa7bb0e6844d9a2bc9654c8889a9570a26e2",
- "_spec": "arraybuffer-to-string@^1.0.2",
- "_where": "/home/sigonasr2/divar/server/node_modules/image-pixels",
- "author": {
- "name": "Dima Yv",
- "email": "dfcreative@gmail.com"
- },
- "browser": "./browser.js",
- "bugs": {
- "url": "https://github.com/dfcreative/arraybuffer-to-string/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "Convert ArrayBuffer to string",
- "devDependencies": {
- "buffer-to-arraybuffer": "0.0.4",
- "is-browser": "^2.0.1",
- "string-to-arraybuffer": "^1.0.0",
- "tape": "^4.7.0"
- },
- "homepage": "https://github.com/dfcreative/arraybuffer-to-string#readme",
- "keywords": [
- "arraybuffer",
- "array-buffer",
- "array",
- "buffer",
- "string",
- "base64",
- "atob",
- "btoa",
- "datauri"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "arraybuffer-to-string",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/dfcreative/arraybuffer-to-string.git"
- },
- "scripts": {
- "test": "node test.js"
- },
- "version": "1.0.2"
-}
diff --git a/server/node_modules/arraybuffer-to-string/readme.md b/server/node_modules/arraybuffer-to-string/readme.md
deleted file mode 100644
index 4a92943..0000000
--- a/server/node_modules/arraybuffer-to-string/readme.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# arraybuffer-to-string [![unstable](https://img.shields.io/badge/stability-unstable-orange.svg)](http://github.com/badges/stability-badges) [![Build Status](https://img.shields.io/travis/dfcreative/arraybuffer-to-string.svg)](https://travis-ci.org/dfcreative/arraybuffer-to-string)
-
-Convert _ArrayBuffer_ to string with optional encoding.
-
-[![npm install arraybuffer-to-string](https://nodei.co/npm/arraybuffer-to-string.png?mini=true)](https://npmjs.org/package/arraybuffer-to-string/)
-
-```js
-var ab2str = require('arraybuffer-to-string')
-
-var uint8 = new Uint8Array([ 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33 ])
-
-ab2str(uint8) // 'Hello World!'
-ab2str(uint8, 'base64') // 'SGVsbG8gV29ybGQh'
-ab2str(uint8, 'hex') // '48656c6c6f20576f726c6421'
-ab2str(uint8, 'iso-8859-2') // 'Hello World!'
-```
-
-### var str = arrayBufferToString(buffer, encoding='utf8')
-
-Convert ArrayBuffer/ArrayBufferView/Array `buffer` to string with defined encoding. Available encoding: `utf8`, `binary`, `base64`, `hex`, `ascii`, `latin1`, `ucs2`, `utf16` and [many others](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/encoding).
-
-Note: in browser it relies on [TextDecoder API](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode), so if you are dealing with charsets other than `utf8`, `ascii`, `binary` or `base64` in old browsers, please include [encoding polyfill](https://github.com/inexorabletash/text-encoding).
-
-### Related
-
-* [string-to-arraybuffer](https://github.com/dfcreative/string-to-arraybuffer) − convert string to arraybuffer.
-* [create-data-uri](https://www.npmjs.com/package/create-data-uri) − convert binary data to datauri string.
diff --git a/server/node_modules/arraybuffer-to-string/test.js b/server/node_modules/arraybuffer-to-string/test.js
deleted file mode 100644
index 466ddb2..0000000
--- a/server/node_modules/arraybuffer-to-string/test.js
+++ /dev/null
@@ -1,257 +0,0 @@
-'use strict'
-
-
-var toString = require('./');
-var t = require('tape')
-var b2ab = require('buffer-to-arraybuffer')
-var isBrowser = require('is-browser')
-var str2ab = require('string-to-arraybuffer')
-
-t('basics', t => {
- t.equal(
- toString(new Uint8Array([ 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33 ])),
- 'Hello World!'
- )
- t.end()
-})
-
-t('utf8 buffer to base64', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('Ձאab', 'utf8')), 'base64'),
- '1YHXkGFi'
- )
- t.end()
-})
-
-t('utf8 buffer to hex', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('Ձאab', 'utf8')), 'hex'),
- 'd581d7906162'
- )
- t.end()
-})
-
-t('utf8 to utf8', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('öäüõÖÄÜÕ', 'utf8')), 'utf8'),
- 'öäüõÖÄÜÕ'
- )
- t.end()
-})
-
-t('utf16le to utf16', function (t) {
- t.equal(
- toString(b2ab(Buffer.from(toString(b2ab(Buffer.from('abcd', 'utf8')), 'utf16le'), 'utf16le')), 'utf8'),
- 'abcd'
- )
- t.end()
-})
-
-t('utf16le to hex', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('abcd', 'utf16le')), 'hex'),
- '6100620063006400'
- )
- t.end()
-})
-
-t('ascii buffer to base64', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('123456!@#$%^', 'ascii')), 'base64'),
- 'MTIzNDU2IUAjJCVe'
- )
- t.end()
-})
-
-t('ascii buffer to hex', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('123456!@#$%^', 'ascii')), 'hex'),
- '31323334353621402324255e'
- )
- t.end()
-})
-
-t('base64 buffer to utf8', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('1YHXkGFi', 'base64')), 'utf8'),
- 'Ձאab'
- )
- t.end()
-})
-
-t('hex buffer to utf8', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('d581d7906162', 'hex')), 'utf8'),
- 'Ձאab'
- )
- t.end()
-})
-
-t('base64 buffer to ascii', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('MTIzNDU2IUAjJCVe', 'base64')), 'ascii'),
- '123456!@#$%^'
- )
- t.end()
-})
-
-t('hex buffer to ascii', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('31323334353621402324255e', 'hex')), 'ascii'),
- '123456!@#$%^'
- )
- t.end()
-})
-
-t('base64 buffer to binary', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('MTIzNDU2IUAjJCVe', 'base64')), 'binary'),
- '123456!@#$%^'
- )
- t.end()
-})
-
-t('hex buffer to binary', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('31323334353621402324255e', 'hex')), 'binary'),
- '123456!@#$%^'
- )
- t.end()
-})
-
-t('utf8 to binary', function (t) {
- /* jshint -W100 */
- t.equal(
- toString(b2ab(Buffer.from('öäüõÖÄÜÕ', 'utf8')), 'binary'),
- 'öäüõÃÃÃÃ'
- )
- /* jshint +W100 */
- t.end()
-})
-
-t('utf8 replacement chars (1 byte sequence)', function (t) {
- t.equal(
- toString(b2ab(Buffer.from([ 0x80 ])) ),
- '\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0x7F ])) ),
- '\u007F'
- )
- t.end()
-})
-
-t('utf8 replacement chars (2 byte sequences)', function (t) {
- t.equal(
- toString(b2ab(Buffer.from([ 0xC7 ])) ),
- '\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xC7, 0xB1 ])) ),
- '\u01F1'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xC0, 0xB1 ])) ),
- '\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xC1, 0xB1 ])) ),
- '\uFFFD\uFFFD'
- )
- t.end()
-})
-
-//FIXME: browser-only case in some reason
-isBrowser && t('utf8 replacement chars (3 byte sequences)', function (t) {
- t.equal(
- toString(b2ab(Buffer.from([ 0xE0 ])) ),
- '\uFFFD'
- )
- t.equal(
- toString(Buffer.from([ 0xE0, 0xAC ]) ),
- // new Buffer([ 0xE0, 0xAC ]).toString(),
- '\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xE0, 0xAC, 0xB9 ])) ),
- '\u0B39'
- )
- t.end()
-})
-
-isBrowser && t('utf8 replacement chars (4 byte sequences)', function (t) {
- t.equal(
- toString(b2ab(Buffer.from([ 0xF4 ])) ),
- '\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xF4, 0x8F ])) ),
- '\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xF4, 0x8F, 0x80 ])) ),
- '\uFFFD\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xF4, 0x8F, 0x80, 0x84 ])) ),
- '\uDBFC\uDC04'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xFF ])) ),
- '\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xFF, 0x8F, 0x80, 0x84 ])) ),
- '\uFFFD\uFFFD\uFFFD\uFFFD'
- )
- t.end()
-})
-
-t.skip('bad utf part', t => {
- t.equal(
- toString(new Uint8Array([236, 134, 219])),
- '���'
- )
-
- t.end()
-})
-
-t.skip('utf8 replacement chars on 256 random bytes', function (t) {
- t.equal(
- toString(b2ab(Buffer.from([ 152, 130, 206, 23, 243, 238, 197, 44, 27, 86, 208, 36, 163, 184, 164, 21, 94, 242, 178, 46, 25, 26, 253, 178, 72, 147, 207, 112, 236, 68, 179, 190, 29, 83, 239, 147, 125, 55, 143, 19, 157, 68, 157, 58, 212, 224, 150, 39, 128, 24, 94, 225, 120, 121, 75, 192, 112, 19, 184, 142, 203, 36, 43, 85, 26, 147, 227, 139, 242, 186, 57, 78, 11, 102, 136, 117, 180, 210, 241, 92, 3, 215, 54, 167, 249, 1, 44, 225, 146, 86, 2, 42, 68, 21, 47, 238, 204, 153, 216, 252, 183, 66, 222, 255, 15, 202, 16, 51, 134, 1, 17, 19, 209, 76, 238, 38, 76, 19, 7, 103, 249, 5, 107, 137, 64, 62, 170, 57, 16, 85, 179, 193, 97, 86, 166, 196, 36, 148, 138, 193, 210, 69, 187, 38, 242, 97, 195, 219, 252, 244, 38, 1, 197, 18, 31, 246, 53, 47, 134, 52, 105, 72, 43, 239, 128, 203, 73, 93, 199, 75, 222, 220, 166, 34, 63, 236, 11, 212, 76, 243, 171, 110, 78, 39, 205, 204, 6, 177, 233, 212, 243, 0, 33, 41, 122, 118, 92, 252, 0, 157, 108, 120, 70, 137, 100, 223, 243, 171, 232, 66, 126, 111, 142, 33, 3, 39, 117, 27, 107, 54, 1, 217, 227, 132, 13, 166, 3, 73, 53, 127, 225, 236, 134, 219, 98, 214, 125, 148, 24, 64, 142, 111, 231, 194, 42, 150, 185, 10, 182, 163, 244, 19, 4, 59, 135, 16 ])) ),
- '\uFFFD\uFFFD\uFFFD\u0017\uFFFD\uFFFD\uFFFD\u002C\u001B\u0056\uFFFD\u0024\uFFFD\uFFFD\uFFFD\u0015\u005E\uFFFD\uFFFD\u002E\u0019\u001A\uFFFD\uFFFD\u0048\uFFFD\uFFFD\u0070\uFFFD\u0044\uFFFD\uFFFD\u001D\u0053\uFFFD\uFFFD\u007D\u0037\uFFFD\u0013\uFFFD\u0044\uFFFD\u003A\uFFFD\uFFFD\uFFFD\u0027\uFFFD\u0018\u005E\uFFFD\u0078\u0079\u004B\uFFFD\u0070\u0013\uFFFD\uFFFD\uFFFD\u0024\u002B\u0055\u001A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0039\u004E\u000B\u0066\uFFFD\u0075\uFFFD\uFFFD\uFFFD\u005C\u0003\uFFFD\u0036\uFFFD\uFFFD\u0001\u002C\uFFFD\uFFFD\u0056\u0002\u002A\u0044\u0015\u002F\uFFFD\u0319\uFFFD\uFFFD\uFFFD\u0042\uFFFD\uFFFD\u000F\uFFFD\u0010\u0033\uFFFD\u0001\u0011\u0013\uFFFD\u004C\uFFFD\u0026\u004C\u0013\u0007\u0067\uFFFD\u0005\u006B\uFFFD\u0040\u003E\uFFFD\u0039\u0010\u0055\uFFFD\uFFFD\u0061\u0056\uFFFD\uFFFD\u0024\uFFFD\uFFFD\uFFFD\uFFFD\u0045\uFFFD\u0026\uFFFD\u0061\uFFFD\uFFFD\uFFFD\uFFFD\u0026\u0001\uFFFD\u0012\u001F\uFFFD\u0035\u002F\uFFFD\u0034\u0069\u0048\u002B\uFFFD\uFFFD\uFFFD\u0049\u005D\uFFFD\u004B\uFFFD\u0726\u0022\u003F\uFFFD\u000B\uFFFD\u004C\uFFFD\uFFFD\u006E\u004E\u0027\uFFFD\uFFFD\u0006\uFFFD\uFFFD\uFFFD\uFFFD\u0000\u0021\u0029\u007A\u0076\u005C\uFFFD\u0000\uFFFD\u006C\u0078\u0046\uFFFD\u0064\uFFFD\uFFFD\uFFFD\uFFFD\u0042\u007E\u006F\uFFFD\u0021\u0003\u0027\u0075\u001B\u006B\u0036\u0001\uFFFD\uFFFD\uFFFD\u000D\uFFFD\u0003\u0049\u0035\u007F\uFFFD\uFFFD\uFFFD\uFFFD\u0062\uFFFD\u007D\uFFFD\u0018\u0040\uFFFD\u006F\uFFFD\uFFFD\u002A\uFFFD\uFFFD\u000A\uFFFD\uFFFD\uFFFD\u0013\u0004\u003B\uFFFD\u0010'
- )
- t.end()
-})
-
-isBrowser && t('utf8 replacement chars for anything in the surrogate pair range', function (t) {
- t.equal(
- toString(b2ab(Buffer.from([ 0xED, 0x9F, 0xBF ])) ),
- '\uD7FF'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xED, 0xA0, 0x80 ])) ),
- '\uFFFD\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xED, 0xBE, 0x8B ])) ),
- '\uFFFD\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xED, 0xBF, 0xBF ])) ),
- '\uFFFD\uFFFD\uFFFD'
- )
- t.equal(
- toString(b2ab(Buffer.from([ 0xEE, 0x80, 0x80 ])) ),
- '\uE000'
- )
- t.end()
-})
-
-t('utf8 don\'t replace the replacement char', function (t) {
- t.equal(
- toString(b2ab(Buffer.from('\uFFFD')) ),
- '\uFFFD'
- )
- t.end()
-})
diff --git a/server/node_modules/atob-lite/.npmignore b/server/node_modules/atob-lite/.npmignore
deleted file mode 100644
index 50c7458..0000000
--- a/server/node_modules/atob-lite/.npmignore
+++ /dev/null
@@ -1,6 +0,0 @@
-node_modules
-*.log
-.DS_Store
-bundle.js
-test
-test.js
diff --git a/server/node_modules/atob-lite/LICENSE.md b/server/node_modules/atob-lite/LICENSE.md
deleted file mode 100644
index ee27ba4..0000000
--- a/server/node_modules/atob-lite/LICENSE.md
+++ /dev/null
@@ -1,18 +0,0 @@
-This software is released under the MIT license:
-
-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/server/node_modules/atob-lite/README.md b/server/node_modules/atob-lite/README.md
deleted file mode 100644
index 99ea05d..0000000
--- a/server/node_modules/atob-lite/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# atob-lite
-![](http://img.shields.io/badge/stability-stable-orange.svg?style=flat)
-![](http://img.shields.io/npm/v/atob-lite.svg?style=flat)
-![](http://img.shields.io/npm/dm/atob-lite.svg?style=flat)
-![](http://img.shields.io/npm/l/atob-lite.svg?style=flat)
-
-Smallest/simplest possible means of using atob with both Node and browserify.
-
-In the browser, decoding base64 strings is done using:
-
-``` javascript
-var decoded = atob(encoded)
-```
-
-However in Node, it's done like so:
-
-``` javascript
-var decoded = new Buffer(encoded, 'base64').toString('utf8')
-```
-
-You can easily check if `Buffer` exists and switch between the approaches
-accordingly, but using `Buffer` anywhere in your browser source will pull
-in browserify's `Buffer` shim which is pretty hefty. This package uses
-the `main` and `browser` fields in its `package.json` to perform this
-check at build time and avoid pulling `Buffer` in unnecessarily.
-
-## Usage
-
-[![NPM](https://nodei.co/npm/atob-lite.png)](https://nodei.co/npm/atob-lite/)
-
-### `decoded = atob(encoded)`
-
-Returns the decoded value of a base64-encoded string.
-
-## License
-
-MIT. See [LICENSE.md](http://github.com/hughsk/atob-lite/blob/master/LICENSE.md) for details.
diff --git a/server/node_modules/atob-lite/atob-browser.js b/server/node_modules/atob-lite/atob-browser.js
deleted file mode 100644
index cee1a38..0000000
--- a/server/node_modules/atob-lite/atob-browser.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = function _atob(str) {
- return atob(str)
-}
diff --git a/server/node_modules/atob-lite/atob-node.js b/server/node_modules/atob-lite/atob-node.js
deleted file mode 100644
index 7072075..0000000
--- a/server/node_modules/atob-lite/atob-node.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = function atob(str) {
- return Buffer.from(str, 'base64').toString('binary')
-}
diff --git a/server/node_modules/atob-lite/package.json b/server/node_modules/atob-lite/package.json
deleted file mode 100644
index 4d2b69c..0000000
--- a/server/node_modules/atob-lite/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "_from": "atob-lite@^2.0.0",
- "_id": "atob-lite@2.0.0",
- "_inBundle": false,
- "_integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=",
- "_location": "/atob-lite",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "atob-lite@^2.0.0",
- "name": "atob-lite",
- "escapedName": "atob-lite",
- "rawSpec": "^2.0.0",
- "saveSpec": null,
- "fetchSpec": "^2.0.0"
- },
- "_requiredBy": [
- "/string-to-arraybuffer"
- ],
- "_resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz",
- "_shasum": "0fef5ad46f1bd7a8502c65727f0367d5ee43d696",
- "_spec": "atob-lite@^2.0.0",
- "_where": "/home/sigonasr2/divar/server/node_modules/string-to-arraybuffer",
- "author": {
- "name": "Hugh Kennedy",
- "email": "hughskennedy@gmail.com",
- "url": "http://hughsk.io/"
- },
- "browser": "atob-browser.js",
- "bugs": {
- "url": "https://github.com/hughsk/atob-lite/issues"
- },
- "bundleDependencies": false,
- "dependencies": {},
- "deprecated": false,
- "description": "Smallest/simplest possible means of using atob with both Node and browserify",
- "devDependencies": {
- "browserify": "^10.2.4",
- "smokestack": "^3.3.0",
- "tap-closer": "^1.0.0",
- "tap-spec": "^4.0.0",
- "tape": "^4.0.0"
- },
- "homepage": "https://github.com/hughsk/atob-lite",
- "keywords": [
- "atob",
- "base64",
- "isomorphic",
- "browser",
- "node",
- "shared"
- ],
- "license": "MIT",
- "main": "atob-node.js",
- "name": "atob-lite",
- "repository": {
- "type": "git",
- "url": "git://github.com/hughsk/atob-lite.git"
- },
- "scripts": {
- "test": "npm run test-node && npm run test-browser",
- "test-browser": "browserify test | smokestack | tap-spec",
- "test-node": "node test | tap-spec"
- },
- "version": "2.0.0"
-}
diff --git a/server/node_modules/bmp-js/.npmignore b/server/node_modules/bmp-js/.npmignore
deleted file mode 100644
index 34977ee..0000000
--- a/server/node_modules/bmp-js/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-.idea
\ No newline at end of file
diff --git a/server/node_modules/bmp-js/LICENSE b/server/node_modules/bmp-js/LICENSE
deleted file mode 100644
index 4b20aef..0000000
--- a/server/node_modules/bmp-js/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 @丝刀口
-
-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/server/node_modules/bmp-js/README.md b/server/node_modules/bmp-js/README.md
deleted file mode 100644
index d5fa52b..0000000
--- a/server/node_modules/bmp-js/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-bmp-js
-======
-
-A pure javascript Bmp encoder and decoder for node.js
-
-Supports all bits decoding(1,4,8,16,24,32) and encoding with 24bit.
-
-##Install
-
- $ npm install bmp-js
-
-
-How to use?
----
-###Decode BMP
-```js
-var bmp = require("bmp-js");
-var bmpBuffer = fs.readFileSync('bit24.bmp');
-var bmpData = bmp.decode(bmpBuffer);
-
-```
-
-`bmpData` has all properties includes:
-
-1. fileSize,reserved,offset
-
-2. headerSize,width,height,planes,bitPP,compress,rawSize,hr,vr,colors,importantColors
-
-3. palette
-
-4. data-------byte array order by ABGR ABGR ABGR,4 bytes per pixel
-
-
-###Encode RGB
-```js
-var bmp = require("bmp-js");
-//bmpData={data:Buffer,width:Number,height:Height}
-var rawData = bmp.encode(bmpData);//default no compression,write rawData to .bmp file
-
-```
-
-License
----
-U can use on free with [MIT License](https://github.com/shaozilee/bmp-js/blob/master/LICENSE)
\ No newline at end of file
diff --git a/server/node_modules/bmp-js/bmp-js.iml b/server/node_modules/bmp-js/bmp-js.iml
deleted file mode 100644
index 8021953..0000000
--- a/server/node_modules/bmp-js/bmp-js.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/server/node_modules/bmp-js/index.js b/server/node_modules/bmp-js/index.js
deleted file mode 100644
index dbb578c..0000000
--- a/server/node_modules/bmp-js/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * @author shaozilee
- *
- * support 1bit 4bit 8bit 24bit decode
- * encode with 24bit
- *
- */
-
-var encode = require('./lib/encoder'),
- decode = require('./lib/decoder');
-
-module.exports = {
- encode: encode,
- decode: decode
-};
diff --git a/server/node_modules/bmp-js/lib/decoder.js b/server/node_modules/bmp-js/lib/decoder.js
deleted file mode 100644
index b66d181..0000000
--- a/server/node_modules/bmp-js/lib/decoder.js
+++ /dev/null
@@ -1,485 +0,0 @@
-/**
- * @author shaozilee
- *
- * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp
- *
- */
-
-function BmpDecoder(buffer,is_with_alpha) {
- this.pos = 0;
- this.buffer = buffer;
- this.is_with_alpha = !!is_with_alpha;
- this.bottom_up = true;
- this.flag = this.buffer.toString("utf-8", 0, this.pos += 2);
- if (this.flag != "BM") throw new Error("Invalid BMP File");
- this.parseHeader();
- this.parseRGBA();
-}
-
-BmpDecoder.prototype.parseHeader = function() {
- this.fileSize = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.reserved = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.offset = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.headerSize = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.width = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.height = this.buffer.readInt32LE(this.pos);
- this.pos += 4;
- this.planes = this.buffer.readUInt16LE(this.pos);
- this.pos += 2;
- this.bitPP = this.buffer.readUInt16LE(this.pos);
- this.pos += 2;
- this.compress = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.rawSize = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.hr = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.vr = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.colors = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
- this.importantColors = this.buffer.readUInt32LE(this.pos);
- this.pos += 4;
-
- if(this.bitPP === 16 && this.is_with_alpha){
- this.bitPP = 15
- }
- if (this.bitPP < 15) {
- var len = this.colors === 0 ? 1 << this.bitPP : this.colors;
- this.palette = new Array(len);
- for (var i = 0; i < len; i++) {
- var blue = this.buffer.readUInt8(this.pos++);
- var green = this.buffer.readUInt8(this.pos++);
- var red = this.buffer.readUInt8(this.pos++);
- var quad = this.buffer.readUInt8(this.pos++);
- this.palette[i] = {
- red: red,
- green: green,
- blue: blue,
- quad: quad
- };
- }
- }
- if(this.height < 0) {
- this.height *= -1;
- this.bottom_up = false;
- }
-
-}
-
-BmpDecoder.prototype.parseRGBA = function() {
- var bitn = "bit" + this.bitPP;
- var len = this.width * this.height * 4;
- this.data = new Buffer(len);
- this[bitn]();
-};
-
-BmpDecoder.prototype.bit1 = function() {
- var xlen = Math.ceil(this.width / 8);
- var mode = xlen%4;
- var y = this.height >= 0 ? this.height - 1 : -this.height
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y
- for (var x = 0; x < xlen; x++) {
- var b = this.buffer.readUInt8(this.pos++);
- var location = line * this.width * 4 + x*8*4;
- for (var i = 0; i < 8; i++) {
- if(x*8+i>(7-i))&0x1)];
-
- this.data[location+i*4] = 0;
- this.data[location+i*4 + 1] = rgb.blue;
- this.data[location+i*4 + 2] = rgb.green;
- this.data[location+i*4 + 3] = rgb.red;
-
- }else{
- break;
- }
- }
- }
-
- if (mode != 0){
- this.pos+=(4 - mode);
- }
- }
-};
-
-BmpDecoder.prototype.bit4 = function() {
- //RLE-4
- if(this.compress == 2){
- this.data.fill(0xff);
-
- var location = 0;
- var lines = this.bottom_up?this.height-1:0;
- var low_nibble = false;//for all count of pixel
-
- while(location>4);
- }
-
- if ((i & 1) && (i+1 < b)){
- c = this.buffer.readUInt8(this.pos++);
- }
-
- low_nibble = !low_nibble;
- }
-
- if ((((b+1) >> 1) & 1 ) == 1){
- this.pos++
- }
- }
-
- }else{//encoded mode
- for (var i = 0; i < a; i++) {
- if (low_nibble) {
- setPixelData.call(this, (b & 0x0f));
- } else {
- setPixelData.call(this, (b & 0xf0)>>4);
- }
- low_nibble = !low_nibble;
- }
- }
-
- }
-
-
-
-
- function setPixelData(rgbIndex){
- var rgb = this.palette[rgbIndex];
- this.data[location] = 0;
- this.data[location + 1] = rgb.blue;
- this.data[location + 2] = rgb.green;
- this.data[location + 3] = rgb.red;
- location+=4;
- }
- }else{
-
- var xlen = Math.ceil(this.width/2);
- var mode = xlen%4;
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y
- for (var x = 0; x < xlen; x++) {
- var b = this.buffer.readUInt8(this.pos++);
- var location = line * this.width * 4 + x*2*4;
-
- var before = b>>4;
- var after = b&0x0F;
-
- var rgb = this.palette[before];
- this.data[location] = 0;
- this.data[location + 1] = rgb.blue;
- this.data[location + 2] = rgb.green;
- this.data[location + 3] = rgb.red;
-
-
- if(x*2+1>=this.width)break;
-
- rgb = this.palette[after];
-
- this.data[location+4] = 0;
- this.data[location+4 + 1] = rgb.blue;
- this.data[location+4 + 2] = rgb.green;
- this.data[location+4 + 3] = rgb.red;
-
- }
-
- if (mode != 0){
- this.pos+=(4 - mode);
- }
- }
-
- }
-
-};
-
-BmpDecoder.prototype.bit8 = function() {
- //RLE-8
- if(this.compress == 1){
- this.data.fill(0xff);
-
- var location = 0;
- var lines = this.bottom_up?this.height-1:0;
-
- while(location= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y
- for (var x = 0; x < this.width; x++) {
- var b = this.buffer.readUInt8(this.pos++);
- var location = line * this.width * 4 + x * 4;
- if (b < this.palette.length) {
- var rgb = this.palette[b];
-
- this.data[location] = 0;
- this.data[location + 1] = rgb.blue;
- this.data[location + 2] = rgb.green;
- this.data[location + 3] = rgb.red;
-
- } else {
- this.data[location] = 0;
- this.data[location + 1] = 0xFF;
- this.data[location + 2] = 0xFF;
- this.data[location + 3] = 0xFF;
- }
- }
- if (mode != 0) {
- this.pos += (4 - mode);
- }
- }
- }
-};
-
-BmpDecoder.prototype.bit15 = function() {
- var dif_w =this.width % 3;
- var _11111 = parseInt("11111", 2),_1_5 = _11111;
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y
- for (var x = 0; x < this.width; x++) {
-
- var B = this.buffer.readUInt16LE(this.pos);
- this.pos+=2;
- var blue = (B & _1_5) / _1_5 * 255 | 0;
- var green = (B >> 5 & _1_5 ) / _1_5 * 255 | 0;
- var red = (B >> 10 & _1_5) / _1_5 * 255 | 0;
- var alpha = (B>>15)?0xFF:0x00;
-
- var location = line * this.width * 4 + x * 4;
-
- this.data[location] = alpha;
- this.data[location + 1] = blue;
- this.data[location + 2] = green;
- this.data[location + 3] = red;
- }
- //skip extra bytes
- this.pos += dif_w;
- }
-};
-
-BmpDecoder.prototype.bit16 = function() {
- var dif_w =(this.width % 2)*2;
- //default xrgb555
- this.maskRed = 0x7C00;
- this.maskGreen = 0x3E0;
- this.maskBlue =0x1F;
- this.mask0 = 0;
-
- if(this.compress == 3){
- this.maskRed = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- this.maskGreen = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- this.maskBlue = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- this.mask0 = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- }
-
-
- var ns=[0,0,0];
- for (var i=0;i<16;i++){
- if ((this.maskRed>>i)&0x01) ns[0]++;
- if ((this.maskGreen>>i)&0x01) ns[1]++;
- if ((this.maskBlue>>i)&0x01) ns[2]++;
- }
- ns[1]+=ns[0]; ns[2]+=ns[1]; ns[0]=8-ns[0]; ns[1]-=8; ns[2]-=8;
-
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y;
- for (var x = 0; x < this.width; x++) {
-
- var B = this.buffer.readUInt16LE(this.pos);
- this.pos+=2;
-
- var blue = (B&this.maskBlue)<>ns[1];
- var red = (B&this.maskRed)>>ns[2];
-
- var location = line * this.width * 4 + x * 4;
-
- this.data[location] = 0;
- this.data[location + 1] = blue;
- this.data[location + 2] = green;
- this.data[location + 3] = red;
- }
- //skip extra bytes
- this.pos += dif_w;
- }
-};
-
-BmpDecoder.prototype.bit24 = function() {
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y
- for (var x = 0; x < this.width; x++) {
- //Little Endian rgb
- var blue = this.buffer.readUInt8(this.pos++);
- var green = this.buffer.readUInt8(this.pos++);
- var red = this.buffer.readUInt8(this.pos++);
- var location = line * this.width * 4 + x * 4;
- this.data[location] = 0;
- this.data[location + 1] = blue;
- this.data[location + 2] = green;
- this.data[location + 3] = red;
- }
- //skip extra bytes
- this.pos += (this.width % 4);
- }
-
-};
-
-/**
- * add 32bit decode func
- * @author soubok
- */
-BmpDecoder.prototype.bit32 = function() {
- //BI_BITFIELDS
- if(this.compress == 3){
- this.maskRed = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- this.maskGreen = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- this.maskBlue = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- this.mask0 = this.buffer.readUInt32LE(this.pos);
- this.pos+=4;
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y;
- for (var x = 0; x < this.width; x++) {
- //Little Endian rgba
- var alpha = this.buffer.readUInt8(this.pos++);
- var blue = this.buffer.readUInt8(this.pos++);
- var green = this.buffer.readUInt8(this.pos++);
- var red = this.buffer.readUInt8(this.pos++);
- var location = line * this.width * 4 + x * 4;
- this.data[location] = alpha;
- this.data[location + 1] = blue;
- this.data[location + 2] = green;
- this.data[location + 3] = red;
- }
- }
-
- }else{
- for (var y = this.height - 1; y >= 0; y--) {
- var line = this.bottom_up ? y : this.height - 1 - y;
- for (var x = 0; x < this.width; x++) {
- //Little Endian argb
- var blue = this.buffer.readUInt8(this.pos++);
- var green = this.buffer.readUInt8(this.pos++);
- var red = this.buffer.readUInt8(this.pos++);
- var alpha = this.buffer.readUInt8(this.pos++);
- var location = line * this.width * 4 + x * 4;
- this.data[location] = alpha;
- this.data[location + 1] = blue;
- this.data[location + 2] = green;
- this.data[location + 3] = red;
- }
- }
-
- }
-
-
-
-
-};
-
-BmpDecoder.prototype.getData = function() {
- return this.data;
-};
-
-module.exports = function(bmpData) {
- var decoder = new BmpDecoder(bmpData);
- return decoder;
-};
diff --git a/server/node_modules/bmp-js/lib/encoder.js b/server/node_modules/bmp-js/lib/encoder.js
deleted file mode 100644
index ddb3ef6..0000000
--- a/server/node_modules/bmp-js/lib/encoder.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @author shaozilee
- *
- * BMP format encoder,encode 24bit BMP
- * Not support quality compression
- *
- */
-
-function BmpEncoder(imgData){
- this.buffer = imgData.data;
- this.width = imgData.width;
- this.height = imgData.height;
- this.extraBytes = this.width%4;
- this.rgbSize = this.height*(3*this.width+this.extraBytes);
- this.headerInfoSize = 40;
-
- this.data = [];
- /******************header***********************/
- this.flag = "BM";
- this.reserved = 0;
- this.offset = 54;
- this.fileSize = this.rgbSize+this.offset;
- this.planes = 1;
- this.bitPP = 24;
- this.compress = 0;
- this.hr = 0;
- this.vr = 0;
- this.colors = 0;
- this.importantColors = 0;
-}
-
-BmpEncoder.prototype.encode = function() {
- var tempBuffer = new Buffer(this.offset+this.rgbSize);
- this.pos = 0;
- tempBuffer.write(this.flag,this.pos,2);this.pos+=2;
- tempBuffer.writeUInt32LE(this.fileSize,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.reserved,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.offset,this.pos);this.pos+=4;
-
- tempBuffer.writeUInt32LE(this.headerInfoSize,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.width,this.pos);this.pos+=4;
- tempBuffer.writeInt32LE(-this.height,this.pos);this.pos+=4;
- tempBuffer.writeUInt16LE(this.planes,this.pos);this.pos+=2;
- tempBuffer.writeUInt16LE(this.bitPP,this.pos);this.pos+=2;
- tempBuffer.writeUInt32LE(this.compress,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.rgbSize,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.hr,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.vr,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.colors,this.pos);this.pos+=4;
- tempBuffer.writeUInt32LE(this.importantColors,this.pos);this.pos+=4;
-
- var i=0;
- var rowBytes = 3*this.width+this.extraBytes;
-
- for (var y = 0; y 0){
- var fillOffset = this.pos+y*rowBytes+this.width*3;
- tempBuffer.fill(0,fillOffset,fillOffset+this.extraBytes);
- }
- }
-
- return tempBuffer;
-};
-
-module.exports = function(imgData, quality) {
- if (typeof quality === 'undefined') quality = 100;
- var encoder = new BmpEncoder(imgData);
- var data = encoder.encode();
- return {
- data: data,
- width: imgData.width,
- height: imgData.height
- };
-};
diff --git a/server/node_modules/bmp-js/package.json b/server/node_modules/bmp-js/package.json
deleted file mode 100644
index 05081bc..0000000
--- a/server/node_modules/bmp-js/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "_from": "bmp-js@^0.1.0",
- "_id": "bmp-js@0.1.0",
- "_inBundle": false,
- "_integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=",
- "_location": "/bmp-js",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "bmp-js@^0.1.0",
- "name": "bmp-js",
- "escapedName": "bmp-js",
- "rawSpec": "^0.1.0",
- "saveSpec": null,
- "fetchSpec": "^0.1.0"
- },
- "_requiredBy": [
- "/image-decode"
- ],
- "_resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz",
- "_shasum": "e05a63f796a6c1ff25f4771ec7adadc148c07233",
- "_spec": "bmp-js@^0.1.0",
- "_where": "/home/sigonasr2/divar/server/node_modules/image-decode",
- "author": {
- "name": "shaozilee",
- "email": "shaozilee@gmail.com"
- },
- "bugs": {
- "url": "https://github.com/shaozilee/bmp-js/issues"
- },
- "bundleDependencies": false,
- "dependencies": {},
- "deprecated": false,
- "description": "A pure javascript BMP encoder and decoder",
- "devDependencies": {},
- "homepage": "https://github.com/shaozilee/bmp-js#readme",
- "keywords": [
- "bmp",
- "1bit",
- "4bit",
- "8bit",
- "16bit",
- "24bit",
- "32bit",
- "encoder",
- "decoder",
- "image",
- "javascript",
- "js"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "bmp-js",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/shaozilee/bmp-js.git"
- },
- "version": "0.1.0"
-}
diff --git a/server/node_modules/bmp-js/test/bit1.bmp b/server/node_modules/bmp-js/test/bit1.bmp
deleted file mode 100644
index c33b94d..0000000
Binary files a/server/node_modules/bmp-js/test/bit1.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_565.bmp b/server/node_modules/bmp-js/test/bit16_565.bmp
deleted file mode 100644
index f111172..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_565.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_565_out.bmp b/server/node_modules/bmp-js/test/bit16_565_out.bmp
deleted file mode 100644
index a618d6f..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_565_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_a444.bmp b/server/node_modules/bmp-js/test/bit16_a444.bmp
deleted file mode 100644
index 7eabc66..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_a444.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_a444_out.bmp b/server/node_modules/bmp-js/test/bit16_a444_out.bmp
deleted file mode 100644
index 413b818..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_a444_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_a555.bmp b/server/node_modules/bmp-js/test/bit16_a555.bmp
deleted file mode 100644
index 8f28347..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_a555.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_a555_out.bmp b/server/node_modules/bmp-js/test/bit16_a555_out.bmp
deleted file mode 100644
index 6435286..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_a555_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_x444.bmp b/server/node_modules/bmp-js/test/bit16_x444.bmp
deleted file mode 100644
index 3afabae..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_x444.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_x444_out.bmp b/server/node_modules/bmp-js/test/bit16_x444_out.bmp
deleted file mode 100644
index 413b818..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_x444_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_x555.bmp b/server/node_modules/bmp-js/test/bit16_x555.bmp
deleted file mode 100644
index 077122e..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_x555.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit16_x555_out.bmp b/server/node_modules/bmp-js/test/bit16_x555_out.bmp
deleted file mode 100644
index 6435286..0000000
Binary files a/server/node_modules/bmp-js/test/bit16_x555_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit1_out.bmp b/server/node_modules/bmp-js/test/bit1_out.bmp
deleted file mode 100644
index 830c379..0000000
Binary files a/server/node_modules/bmp-js/test/bit1_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit24.bmp b/server/node_modules/bmp-js/test/bit24.bmp
deleted file mode 100644
index 9dcaba9..0000000
Binary files a/server/node_modules/bmp-js/test/bit24.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit24_out.bmp b/server/node_modules/bmp-js/test/bit24_out.bmp
deleted file mode 100644
index 3a9aa82..0000000
Binary files a/server/node_modules/bmp-js/test/bit24_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit32.bmp b/server/node_modules/bmp-js/test/bit32.bmp
deleted file mode 100644
index 411a176..0000000
Binary files a/server/node_modules/bmp-js/test/bit32.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit32_alpha.bmp b/server/node_modules/bmp-js/test/bit32_alpha.bmp
deleted file mode 100644
index 57acdbe..0000000
Binary files a/server/node_modules/bmp-js/test/bit32_alpha.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit32_alpha_out.bmp b/server/node_modules/bmp-js/test/bit32_alpha_out.bmp
deleted file mode 100644
index 3a9aa82..0000000
Binary files a/server/node_modules/bmp-js/test/bit32_alpha_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit32_out.bmp b/server/node_modules/bmp-js/test/bit32_out.bmp
deleted file mode 100644
index 3a9aa82..0000000
Binary files a/server/node_modules/bmp-js/test/bit32_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit4.bmp b/server/node_modules/bmp-js/test/bit4.bmp
deleted file mode 100644
index 665349b..0000000
Binary files a/server/node_modules/bmp-js/test/bit4.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit4_RLE.bmp b/server/node_modules/bmp-js/test/bit4_RLE.bmp
deleted file mode 100644
index faf74b5..0000000
Binary files a/server/node_modules/bmp-js/test/bit4_RLE.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit4_RLE_out.bmp b/server/node_modules/bmp-js/test/bit4_RLE_out.bmp
deleted file mode 100644
index 839e830..0000000
Binary files a/server/node_modules/bmp-js/test/bit4_RLE_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit4_out.bmp b/server/node_modules/bmp-js/test/bit4_out.bmp
deleted file mode 100644
index 5198720..0000000
Binary files a/server/node_modules/bmp-js/test/bit4_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit8.bmp b/server/node_modules/bmp-js/test/bit8.bmp
deleted file mode 100644
index 9d7c706..0000000
Binary files a/server/node_modules/bmp-js/test/bit8.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit8_RLE.bmp b/server/node_modules/bmp-js/test/bit8_RLE.bmp
deleted file mode 100644
index e959d98..0000000
Binary files a/server/node_modules/bmp-js/test/bit8_RLE.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit8_RLE_out.bmp b/server/node_modules/bmp-js/test/bit8_RLE_out.bmp
deleted file mode 100644
index 0ce584b..0000000
Binary files a/server/node_modules/bmp-js/test/bit8_RLE_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/bit8_out.bmp b/server/node_modules/bmp-js/test/bit8_out.bmp
deleted file mode 100644
index 6ffcb1d..0000000
Binary files a/server/node_modules/bmp-js/test/bit8_out.bmp and /dev/null differ
diff --git a/server/node_modules/bmp-js/test/test.js b/server/node_modules/bmp-js/test/test.js
deleted file mode 100644
index 239a777..0000000
--- a/server/node_modules/bmp-js/test/test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var fs = require("fs");
-
-var coder = require("../index.js");
-var bmps = ["./bit1", "./bit4", "./bit4_RLE", "./bit8", "./bit8_RLE", "./bit16_565", "./bit16_a444", "./bit16_a555", "./bit16_x444", "./bit16_x555", "./bit24", "./bit32", "./bit32_alpha"];
-
-console.log("test bmp decoding and encoding...");
-
-for(var b=0; b=0.4.0"
- },
- "homepage": "https://github.com/substack/node-buffer-equal#readme",
- "keywords": [
- "buffer",
- "equal"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "buffer-equal",
- "repository": {
- "type": "git",
- "url": "git://github.com/substack/node-buffer-equal.git"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "version": "0.0.1"
-}
diff --git a/server/node_modules/buffer-equal/test/eq.js b/server/node_modules/buffer-equal/test/eq.js
deleted file mode 100644
index 3d34006..0000000
--- a/server/node_modules/buffer-equal/test/eq.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var bufferEqual = require('../');
-var test = require('tap').test;
-
-test('equal', function (t) {
- var eq = bufferEqual(
- new Buffer([253,254,255]),
- new Buffer([253,254,255])
- );
- t.strictEqual(eq, true);
- t.end();
-});
-
-test('not equal', function (t) {
- var eq = bufferEqual(
- new Buffer('abc'),
- new Buffer('abcd')
- );
- t.strictEqual(eq, false);
- t.end();
-});
-
-test('not equal not buffer', function (t) {
- var eq = bufferEqual(
- new Buffer('abc'),
- 'abc'
- );
- t.strictEqual(eq, undefined);
- t.end();
-});
-
-test('equal not buffer', function (t) {
- var eq = bufferEqual('abc', 'abc');
- t.strictEqual(eq, undefined);
- t.end();
-});
diff --git a/server/node_modules/buffer-to-uint8array/LICENSE b/server/node_modules/buffer-to-uint8array/LICENSE
deleted file mode 100644
index ee27ba4..0000000
--- a/server/node_modules/buffer-to-uint8array/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-This software is released under the MIT license:
-
-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/server/node_modules/buffer-to-uint8array/example/buf.js b/server/node_modules/buffer-to-uint8array/example/buf.js
deleted file mode 100644
index 5391a9e..0000000
--- a/server/node_modules/buffer-to-uint8array/example/buf.js
+++ /dev/null
@@ -1,5 +0,0 @@
-var tou8 = require('../');
-var buf = new Buffer('whatever');
-var a = tou8(buf);
-console.log(a.constructor.name);
-console.log(a);
diff --git a/server/node_modules/buffer-to-uint8array/index.js b/server/node_modules/buffer-to-uint8array/index.js
deleted file mode 100644
index 669ffdf..0000000
--- a/server/node_modules/buffer-to-uint8array/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = function (buf) {
- if (!buf) return undefined;
- if (buf.constructor.name === 'Uint8Array'
- || buf.constructor === Uint8Array) {
- return buf;
- }
- if (typeof buf === 'string') buf = Buffer(buf);
- var a = new Uint8Array(buf.length);
- for (var i = 0; i < buf.length; i++) a[i] = buf[i];
- return a;
-};
diff --git a/server/node_modules/buffer-to-uint8array/package.json b/server/node_modules/buffer-to-uint8array/package.json
deleted file mode 100644
index 7663d9f..0000000
--- a/server/node_modules/buffer-to-uint8array/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "_from": "buffer-to-uint8array@^1.1.0",
- "_id": "buffer-to-uint8array@1.1.0",
- "_inBundle": false,
- "_integrity": "sha1-z29BKHwCL0WNp1LDkcGo1TXsX3I=",
- "_location": "/buffer-to-uint8array",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "buffer-to-uint8array@^1.1.0",
- "name": "buffer-to-uint8array",
- "escapedName": "buffer-to-uint8array",
- "rawSpec": "^1.1.0",
- "saveSpec": null,
- "fetchSpec": "^1.1.0"
- },
- "_requiredBy": [
- "/image-decode"
- ],
- "_resolved": "https://registry.npmjs.org/buffer-to-uint8array/-/buffer-to-uint8array-1.1.0.tgz",
- "_shasum": "cf6f41287c022f458da752c391c1a8d535ec5f72",
- "_spec": "buffer-to-uint8array@^1.1.0",
- "_where": "/home/sigonasr2/divar/server/node_modules/image-decode",
- "author": {
- "name": "substack"
- },
- "bugs": {
- "url": "https://github.com/substack/buffer-to-uint8array/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "convert a buffer (or string) to a Uint8Array",
- "devDependencies": {
- "tape": "^4.0.0"
- },
- "directories": {
- "example": "example",
- "test": "test"
- },
- "homepage": "https://github.com/substack/buffer-to-uint8array#readme",
- "keywords": [
- "Uint8Array",
- "u8",
- "byte",
- "buffer",
- "typedarray"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "buffer-to-uint8array",
- "repository": {
- "type": "git",
- "url": "git://github.com/substack/buffer-to-uint8array.git"
- },
- "scripts": {
- "test": "tape test/*.js"
- },
- "version": "1.1.0"
-}
diff --git a/server/node_modules/buffer-to-uint8array/readme.markdown b/server/node_modules/buffer-to-uint8array/readme.markdown
deleted file mode 100644
index 161bd36..0000000
--- a/server/node_modules/buffer-to-uint8array/readme.markdown
+++ /dev/null
@@ -1,37 +0,0 @@
-# buffer-to-uint8array
-
-convert a buffer (or string) to a Uint8Array
-
-# example
-
-``` js
-var tou8 = require('buffer-to-uint8array');
-var buf = new Buffer('whatever');
-var a = tou8(buf);
-console.log(a.constructor.name);
-console.log(a);
-```
-
-# methods
-
-``` js
-var tou8 = require('buffer-to-uint8array')
-```
-
-## var u = tou8(buf)
-
-Convert `buf`, a `Buffer` or `string` to a `Uint8Array`.
-
-If `buf` is already a Uint8Array, it will be returned.
-
-# install
-
-With [npm](https://npmjs.org) do:
-
-```
-npm install buffer-to-uint8array
-```
-
-# license
-
-MIT
diff --git a/server/node_modules/buffer-to-uint8array/test/buf.js b/server/node_modules/buffer-to-uint8array/test/buf.js
deleted file mode 100644
index 27f2f30..0000000
--- a/server/node_modules/buffer-to-uint8array/test/buf.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var test = require('tape');
-var tou8 = require('../');
-
-test('buffer to uint8', function (t) {
- t.plan(2);
- var buf = new Buffer('whatever');
- var a = tou8(buf);
- t.equal(a.constructor.name, 'Uint8Array', 'constructor name');
- t.equal(a.length, 8, 'buffer length');
-});
diff --git a/server/node_modules/buffer-to-uint8array/test/str.js b/server/node_modules/buffer-to-uint8array/test/str.js
deleted file mode 100644
index de1f61c..0000000
--- a/server/node_modules/buffer-to-uint8array/test/str.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var test = require('tape');
-var tou8 = require('../');
-
-test('string to uint8', function (t) {
- t.plan(2);
- var str = 'whatever';
- var a = tou8(str);
- t.equal(a.constructor.name, 'Uint8Array', 'constructor name');
- t.equal(a.length, 8, 'length');
-});
diff --git a/server/node_modules/buffer-to-uint8array/test/u8.js b/server/node_modules/buffer-to-uint8array/test/u8.js
deleted file mode 100644
index b40865f..0000000
--- a/server/node_modules/buffer-to-uint8array/test/u8.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var test = require('tape');
-var tou8 = require('../');
-
-test('uint8 to uint8', function (t) {
- t.plan(3);
- var a = new Uint8Array(8);
- var buf = Buffer('whatever');
- for (var i = 0; i < buf.length; i++) a[i] = buf[i];
-
- var b = tou8(a);
-
- t.equal(a, b, 'reference equality');
- t.equal(a.constructor.name, 'Uint8Array', 'constructor name');
- t.equal(a.length, 8, 'u8 length');
-});
diff --git a/server/node_modules/clamp/.npmignore b/server/node_modules/clamp/.npmignore
deleted file mode 100644
index eb03e3e..0000000
--- a/server/node_modules/clamp/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-*.log
diff --git a/server/node_modules/clamp/LICENSE.md b/server/node_modules/clamp/LICENSE.md
deleted file mode 100644
index deb759d..0000000
--- a/server/node_modules/clamp/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-## The MIT License (MIT) ##
-
-Copyright (c) 2013 Hugh Kennedy
-
-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/server/node_modules/clamp/README.md b/server/node_modules/clamp/README.md
deleted file mode 100644
index 6827a8e..0000000
--- a/server/node_modules/clamp/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# clamp [![frozen](http://hughsk.github.io/stability-badges/dist/frozen.svg)](http://github.com/hughsk/stability-badges) #
-
-Clamp a value between two other values. It's as simple as modules come - saving
-keystrokes because I've had to write this function too many times.
-
-## Usage ##
-
-[![clamp](https://nodei.co/npm/clamp.png?mini=true)](https://nodei.co/npm/clamp)
-
-### `clamp(value, a, b)` ###
-
-Returns `value`, if it is between `a` and `b`. Otherwise, returns the number
-it's gone past.
-
-## License ##
-
-MIT. See [LICENSE.md](http://github.com/hughsk/clamp/blob/master/LICENSE.md) for details.
diff --git a/server/node_modules/clamp/index.js b/server/node_modules/clamp/index.js
deleted file mode 100644
index 3c3b77c..0000000
--- a/server/node_modules/clamp/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = clamp
-
-function clamp(value, min, max) {
- return min < max
- ? (value < min ? min : value > max ? max : value)
- : (value < max ? max : value > min ? min : value)
-}
diff --git a/server/node_modules/clamp/package.json b/server/node_modules/clamp/package.json
deleted file mode 100644
index 88924ff..0000000
--- a/server/node_modules/clamp/package.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "_from": "clamp@^1.0.1",
- "_id": "clamp@1.0.1",
- "_inBundle": false,
- "_integrity": "sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=",
- "_location": "/clamp",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "clamp@^1.0.1",
- "name": "clamp",
- "escapedName": "clamp",
- "rawSpec": "^1.0.1",
- "saveSpec": null,
- "fetchSpec": "^1.0.1"
- },
- "_requiredBy": [
- "/to-uint8"
- ],
- "_resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz",
- "_shasum": "66a0e64011816e37196828fdc8c8c147312c8634",
- "_spec": "clamp@^1.0.1",
- "_where": "/home/sigonasr2/divar/server/node_modules/to-uint8",
- "author": {
- "name": "Hugh Kennedy",
- "email": "hughskennedy@gmail.com",
- "url": "http://github.com/hughsk"
- },
- "browser": "index.js",
- "bugs": {
- "url": "https://github.com/hughsk/clamp/issues"
- },
- "bundleDependencies": false,
- "dependencies": {},
- "deprecated": false,
- "description": "Clamp a value between two other values",
- "devDependencies": {
- "tape": "~2.0.0"
- },
- "homepage": "https://github.com/hughsk/clamp#readme",
- "keywords": [
- "clamp",
- "math",
- "greater",
- "less",
- "than",
- "between"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "clamp",
- "repository": {
- "type": "git",
- "url": "git://github.com/hughsk/clamp.git"
- },
- "scripts": {
- "test": "node test"
- },
- "version": "1.0.1"
-}
diff --git a/server/node_modules/clamp/test.js b/server/node_modules/clamp/test.js
deleted file mode 100644
index c03c0a5..0000000
--- a/server/node_modules/clamp/test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var test = require('tape')
-var clamp = require('./')
-
-test('clamp', function(t) {
- t.equal(clamp(0, -100, 100), 0)
- t.equal(clamp(0, 100, 100), 100)
- t.equal(clamp(0, 100, -100), 0)
- t.equal(clamp(100, 0, 50), 50)
- t.equal(clamp(50, 100, 150), 100)
- t.end()
-})
diff --git a/server/node_modules/clip-pixels/.eslintrc.json b/server/node_modules/clip-pixels/.eslintrc.json
deleted file mode 100644
index 1e5e08b..0000000
--- a/server/node_modules/clip-pixels/.eslintrc.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "env": {
- "browser": true,
- "node": true,
- "commonjs": true,
- "es6": true
- },
- "extends": "eslint:recommended",
- "rules": {
- "strict": 2,
- "indent": 0,
- "linebreak-style": 0,
- "quotes": 0,
- "semi": 0,
- "no-cond-assign": 1,
- "no-constant-condition": 1,
- "no-duplicate-case": 1,
- "no-empty": 1,
- "no-ex-assign": 1,
- "no-extra-boolean-cast": 1,
- "no-extra-semi": 1,
- "no-fallthrough": 1,
- "no-func-assign": 1,
- "no-global-assign": 1,
- "no-implicit-globals": 2,
- "no-inner-declarations": ["error", "functions"],
- "no-irregular-whitespace": 2,
- "no-loop-func": 1,
- "no-magic-numbers": ["warn", { "ignore": [1, 0, -1], "ignoreArrayIndexes": true}],
- "no-multi-str": 1,
- "no-mixed-spaces-and-tabs": 1,
- "no-proto": 1,
- "no-sequences": 1,
- "no-throw-literal": 1,
- "no-unmodified-loop-condition": 1,
- "no-useless-call": 1,
- "no-void": 1,
- "no-with": 2,
- "wrap-iife": 1,
- "no-redeclare": 1,
- "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
- "no-sparse-arrays": 1
- }
-}
diff --git a/server/node_modules/clip-pixels/.travis.yml b/server/node_modules/clip-pixels/.travis.yml
deleted file mode 100644
index 2c956da..0000000
--- a/server/node_modules/clip-pixels/.travis.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-sudo: false
-language: node_js
-node_js:
- - "6"
- - "5"
- - "4"
- - "0.12"
- - "0.10"
-matrix:
- fast_finish: true
- allow_failures:
- - node_js: "0.10"
- - node_js: "0.12"
diff --git a/server/node_modules/clip-pixels/index.js b/server/node_modules/clip-pixels/index.js
deleted file mode 100644
index ab7abf0..0000000
--- a/server/node_modules/clip-pixels/index.js
+++ /dev/null
@@ -1,24 +0,0 @@
-'use strict'
-
-module.exports = function clip (pixels, shape, rect) {
- var stride = shape[2] || 4
- var row = shape[0],
- col = shape[1] || Math.floor(pixels.length / stride / row)
- var x = rect[0],
- y = rect[1] || 0,
- w = rect[2] || row - x,
- h = rect[3] || col - y
-
- var result = Array(w * stride * h)
-
- var off = y * row * stride + x * stride
- for (var j = 0; j < h; j++) {
- for (var i = 0; i < w; i++) {
- for (var k = 0; k < stride; k++) {
- result[j * w * stride + i * stride + k] = pixels[off + j * row * stride + i * stride + k]
- }
- }
- }
-
- return result
-}
diff --git a/server/node_modules/clip-pixels/package.json b/server/node_modules/clip-pixels/package.json
deleted file mode 100644
index 7149788..0000000
--- a/server/node_modules/clip-pixels/package.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "_from": "clip-pixels@^1.0.1",
- "_id": "clip-pixels@1.0.1",
- "_inBundle": false,
- "_integrity": "sha512-nJ22fZvCwkJfMppkOEE7GciLX08rDnVzEJ+U46kBFZtwNzH2V4tNxMWa9Tc365WspCxy1c3NtGJ5EeT4SgjmCA==",
- "_location": "/clip-pixels",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "clip-pixels@^1.0.1",
- "name": "clip-pixels",
- "escapedName": "clip-pixels",
- "rawSpec": "^1.0.1",
- "saveSpec": null,
- "fetchSpec": "^1.0.1"
- },
- "_requiredBy": [
- "/image-pixels"
- ],
- "_resolved": "https://registry.npmjs.org/clip-pixels/-/clip-pixels-1.0.1.tgz",
- "_shasum": "c6304c5b82f6a5b555f1a5990a1cde84077614f8",
- "_spec": "clip-pixels@^1.0.1",
- "_where": "/home/sigonasr2/divar/server/node_modules/image-pixels",
- "author": {
- "name": "dy"
- },
- "bugs": {
- "url": "https://github.com/dy/clip-pixels/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "Slice rectangle from pixels array",
- "homepage": "https://github.com/dy/clip-pixels#readme",
- "keywords": [
- "clip",
- "slice",
- "ndarray",
- "flip-pixels",
- "pxls",
- "pixels"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "clip-pixels",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/dy/clip-pixels.git"
- },
- "scripts": {
- "test": "node test"
- },
- "version": "1.0.1"
-}
diff --git a/server/node_modules/clip-pixels/readme.md b/server/node_modules/clip-pixels/readme.md
deleted file mode 100644
index 66fcaa0..0000000
--- a/server/node_modules/clip-pixels/readme.md
+++ /dev/null
@@ -1,22 +0,0 @@
-[![Build Status](https://travis-ci.org/dy/clip-pixels.svg?branch=master)](https://travis-ci.org/dy/clip-pixels)
-
-Slice rectangle from an array with pixels.
-
-### `clip(arr, shape=[w, h?, channels=4], rect=[x, y?, w?, h?])`
-
-```js
-var clip = require('clip-pixels')
-
-var pixels = [
-0, 1, 0,
-1, 1, 1,
-0, 1, 0
-]
-pixels = clip(pixels, [3, 3, 1], [1, 0, 2, 3])
-
-/*
-1, 0,
-1, 1,
-1, 0
-*/
-```
diff --git a/server/node_modules/clip-pixels/test.js b/server/node_modules/clip-pixels/test.js
deleted file mode 100644
index c2bd6f2..0000000
--- a/server/node_modules/clip-pixels/test.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict'
-
-var clip = require('./')
-var a = require('assert')
-
-
-var pixels = [
-0, 1, 0,
-1, 1, 1,
-0, 1, 0
-]
-a.deepEqual(clip(pixels, [3, 3, 1], [1, 0, 2, 3]),
-[
-1, 0,
-1, 1,
-1, 0
-])
-
-
-// short args
-var pixels = [
-0,0,0,0, 1,1,1,1, 0,0,0,0,
-1,1,1,1, 1,1,1,1, 1,1,1,1,
-0,0,0,0, 1,1,1,1, 0,0,0,0
-]
-a.deepEqual(clip(pixels, [3], [1, 0]),
-[
-1,1,1,1, 0,0,0,0,
-1,1,1,1, 1,1,1,1,
-1,1,1,1, 0,0,0,0
-])
diff --git a/server/node_modules/compute-dims/LICENSE b/server/node_modules/compute-dims/LICENSE
deleted file mode 100644
index 93cf2ea..0000000
--- a/server/node_modules/compute-dims/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014-2015 The Compute.io Authors. All rights reserved.
-
-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/server/node_modules/compute-dims/README.md b/server/node_modules/compute-dims/README.md
deleted file mode 100644
index f85ee77..0000000
--- a/server/node_modules/compute-dims/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-dims
-===
-[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]
-
-> Computes dimensions for arrays and matrices.
-
-
-## Installation
-
-``` bash
-$ npm install compute-dims
-```
-
-For use in the browser, use [browserify](https://github.com/substack/node-browserify).
-
-
-## Usage
-
-
-``` javascript
-var dims = require( 'compute-dims' );
-```
-
-#### dims( x[, max] )
-
-Computes dimensions of `x`. `x` may be either an [`array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) (including nested `arrays`) or a [`matrix`](https://github.com/dstructs/matrix).
-
-``` javascript
-var matrix = require( 'dstructs-matrix' ),
- data,
- d;
-
-data = [ 1, 2 ];
-d = dims( data );
-// returns [2]
-
-data = [ [1,2], [1,2] ];
-d = dims( data );
-// returns [2,2]
-
-data = matrix( [1,2,3,4], [2,2] )
-d = dims( data );
-// returns [2,2]
-```
-
-If an `array` element has a dimension inconsistent with other elements, the function returns `null`.
-
-``` javascript
-data = [ [1,2], [1] ];
-d = dims( data );
-// returns null
-```
-
-To limit the number of dimensions returned, set the `max` option.
-
-``` javascript
-data = [ [[1,2], [3,4]] ]; // 1x2x2
-d = dims( data, 2 );
-// returns [1,2]
-
-data = [ [[1,2], [3,4,5,6,7,8]] ];
-d = dims( data );
-// returns null
-
-d = dims( data, 2 );
-// returns [1,2]
-
-data = matrix( [1,2,3,4], [2,2] );
-d = dims( data, 1 );
-// returns [2]
-```
-
-
-## Examples
-
-To run the example code from the top-level application directory,
-
-``` bash
-$ node ./examples/index.js
-```
-
-
-## Tests
-
-### Unit
-
-Unit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:
-
-``` bash
-$ make test
-```
-
-All new feature development should have corresponding unit tests to validate correct functionality.
-
-
-### Test Coverage
-
-This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
-
-``` bash
-$ make test-cov
-```
-
-Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,
-
-``` bash
-$ make view-cov
-```
-
-
----
-## License
-
-[MIT license](http://opensource.org/licenses/MIT).
-
-
-## Copyright
-
-Copyright © 2014-2015. The [Compute.io](https://github.com/compute-io) Authors.
-
-[npm-image]: http://img.shields.io/npm/v/compute-dims.svg
-[npm-url]: https://npmjs.org/package/compute-dims
-
-[travis-image]: http://img.shields.io/travis/compute-io/dims/master.svg
-[travis-url]: https://travis-ci.org/compute-io/dims
-
-[coveralls-image]: https://img.shields.io/coveralls/compute-io/dims/master.svg
-[coveralls-url]: https://coveralls.io/r/compute-io/dims?branch=master
-
-[dependencies-image]: http://img.shields.io/david/compute-io/dims.svg
-[dependencies-url]: https://david-dm.org/compute-io/dims
-
-[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/dims.svg
-[dev-dependencies-url]: https://david-dm.org/dev/compute-io/dims
-
-[github-issues-image]: http://img.shields.io/github/issues/compute-io/dims.svg
-[github-issues-url]: https://github.com/compute-io/dims/issues
diff --git a/server/node_modules/compute-dims/lib/index.js b/server/node_modules/compute-dims/lib/index.js
deleted file mode 100644
index 646e06d..0000000
--- a/server/node_modules/compute-dims/lib/index.js
+++ /dev/null
@@ -1,114 +0,0 @@
-'use strict';
-
-// MODULES //
-
-var isPositiveInteger = require( 'validate.io-positive-integer' ),
- isArray = require( 'validate.io-array' ),
- ndarrayLike = require( 'validate.io-ndarray-like' ),
- createCopy = require( 'utils-copy' );
-
-
-// DIMS //
-
-/**
-* FUNCTION: dims( x, d, max )
-* Computes array dimensions.
-*
-* @private
-* @param {Array} arr - input array
-* @param {Array} d - dimensions array
-* @param {Number} max - max number of dimensions
-* @returns {Array} dimensions array
-*/
-function dims( arr, d, max ) {
- if ( max && d.length === max ) {
- return;
- }
- if ( !isArray( arr[0] ) ) {
- return;
- }
- d.push( arr[0].length );
- dims( arr[ 0 ], d, max );
-} // end FUNCTION dims()
-
-/**
-* FUNCTION: check( arr, d )
-* Checks that all array elements have the same dimensions.
-*
-* @private
-* @param {Array} arr - input array
-* @param {Array} d - dimensions array
-* @returns {Boolean} boolean indicating if all array elements have the same dimensions
-*/
-function check( arr, d ) {
- var len = arr.length,
- dim = d.shift(),
- nDims = d.length,
- val,
- flg;
-
- for ( var i = 0; i < len; i++ ) {
- val = arr[ i ];
- if ( !isArray( val ) || val.length !== dim ) {
- return false;
- }
- if ( nDims ) {
- flg = check( val, d.slice() );
- if ( !flg ) {
- return false;
- }
- }
- }
- return true;
-} // end FUNCTION check()
-
-/**
-* FUNCTION: compute( x[, max] )
-* Computes dimensions.
-*
-* @param {Array} x - input object
-* @param {Number} [max] - limits the number of dimensions returned
-* @returns {Array|null} array of dimensions or null
-*/
-function compute( x, max ) {
-
- var d, flg;
-
- if ( arguments.length > 1 ) {
- if ( !isPositiveInteger( max ) ) {
- throw new TypeError( 'dims()::invalid input argument. `max` option must be a positive integer.' );
- }
- }
-
- if ( ndarrayLike( x ) === true ) {
- d = createCopy( x.shape );
- if ( max && max <= d.length ) {
- d.length = max;
- }
- return d;
- }
-
- if ( isArray( x ) ) {
- // [0] Initialize the dimensions array:
- d = [ x.length ];
-
- // [1] Recursively determine array dimensions:
- dims( x, d, max );
-
- // [2] Check that all array element dimensions are consistent...
- if ( d.length > 1 ) {
- flg = check( x, d.slice( 1 ) );
- if ( !flg ) {
- return null;
- }
- }
- return d;
- }
-
- throw new TypeError( 'dims()::invalid input argument. Must provide an array, matrix or ndarray.' );
-} // end FUNCTION compute()
-
-
-// EXPORTS //
-
-module.exports = compute;
diff --git a/server/node_modules/compute-dims/package.json b/server/node_modules/compute-dims/package.json
deleted file mode 100644
index 5e19705..0000000
--- a/server/node_modules/compute-dims/package.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "_from": "compute-dims@^1.1.0",
- "_id": "compute-dims@1.1.0",
- "_inBundle": false,
- "_integrity": "sha512-YHMiIKjH/8Eom8zATk3g8/lH3HxGCZcVQyEfEoVrfWI7od/WRpTgRGShnei3jArYSx77mQqPxZNokjGHCdLfxg==",
- "_location": "/compute-dims",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "compute-dims@^1.1.0",
- "name": "compute-dims",
- "escapedName": "compute-dims",
- "rawSpec": "^1.1.0",
- "saveSpec": null,
- "fetchSpec": "^1.1.0"
- },
- "_requiredBy": [
- "/pxls"
- ],
- "_resolved": "https://registry.npmjs.org/compute-dims/-/compute-dims-1.1.0.tgz",
- "_shasum": "6d5b712929b6c531af3b4d580ed5adacbbd77e0c",
- "_spec": "compute-dims@^1.1.0",
- "_where": "/home/sigonasr2/divar/server/node_modules/pxls",
- "author": {
- "name": "Athan Reines",
- "email": "kgryte@gmail.com"
- },
- "bugs": {
- "url": "https://github.com/compute-io/dims/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Athan Reines",
- "email": "kgryte@gmail.com"
- }
- ],
- "dependencies": {
- "utils-copy": "^1.0.0",
- "validate.io-array": "^1.0.6",
- "validate.io-matrix-like": "^1.0.2",
- "validate.io-ndarray-like": "^1.0.0",
- "validate.io-positive-integer": "^1.0.0"
- },
- "deprecated": false,
- "description": "Computes array dimensions.",
- "devDependencies": {
- "chai": "3.x.x",
- "coveralls": "^2.11.1",
- "dstructs-matrix": "^2.0.0",
- "istanbul": "^0.3.0",
- "jshint": "2.x.x",
- "jshint-stylish": "2.x.x",
- "mocha": "2.x.x"
- },
- "homepage": "https://github.com/compute-io/dims#readme",
- "keywords": [
- "compute.io",
- "compute",
- "computation",
- "array",
- "utilities",
- "utils",
- "dimensions",
- "size",
- "shape",
- "dims"
- ],
- "license": "MIT",
- "main": "./lib",
- "name": "compute-dims",
- "repository": {
- "type": "git",
- "url": "git://github.com/compute-io/dims.git"
- },
- "scripts": {
- "coveralls": "istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls",
- "test": "mocha",
- "test-cov": "istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec"
- },
- "version": "1.1.0"
-}
diff --git a/server/node_modules/const-max-uint32/LICENSE b/server/node_modules/const-max-uint32/LICENSE
deleted file mode 100644
index 993d355..0000000
--- a/server/node_modules/const-max-uint32/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015-2016 The Compute.io Authors.
-
-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.
\ No newline at end of file
diff --git a/server/node_modules/const-max-uint32/README.md b/server/node_modules/const-max-uint32/README.md
deleted file mode 100644
index b906002..0000000
--- a/server/node_modules/const-max-uint32/README.md
+++ /dev/null
@@ -1,130 +0,0 @@
-Max Uint32
-===
-[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]
-
-> Maximum unsigned 32-bit integer.
-
-
-## Installation
-
-``` bash
-$ npm install const-max-uint32
-```
-
-
-## Usage
-
-``` javascript
-var MAX_UINT32 = require( 'const-max-uint32' );
-```
-
-#### MAX_UINT32
-
-Maximum unsigned 32-bit `integer`.
-
-``` javascript
-MAX_UINT32 === Math.pow( 2, 32 ) - 1;
-```
-
-
-## Notes
-
-- `MAX_UINT32` is the maximum `array` length.
-
-
-## Examples
-
-``` javascript
-var MAX_UINT32 = require( 'const-max-uint32' );
-
-console.log( MAX_UINT32 );
-// returns 4294967295
-```
-
-To run the example code from the top-level application directory,
-
-``` bash
-$ node ./examples/index.js
-```
-
-
----
-## Tests
-
-### Unit
-
-This repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:
-
-``` bash
-$ make test
-```
-
-All new feature development should have corresponding unit tests to validate correct functionality.
-
-
-### Test Coverage
-
-This repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
-
-``` bash
-$ make test-cov
-```
-
-Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,
-
-``` bash
-$ make view-cov
-```
-
-
-### Browser Support
-
-This repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:
-
-``` bash
-$ make test-browsers
-```
-
-To view the tests in a local web browser,
-
-``` bash
-$ make view-browser-tests
-```
-
-
-
-
----
-## License
-
-[MIT license](http://opensource.org/licenses/MIT).
-
-
-## Copyright
-
-Copyright © 2015-2016. The [Compute.io][compute-io] Authors.
-
-
-[npm-image]: http://img.shields.io/npm/v/const-max-uint32.svg
-[npm-url]: https://npmjs.org/package/const-max-uint32
-
-[build-image]: http://img.shields.io/travis/const-io/max-uint32/master.svg
-[build-url]: https://travis-ci.org/const-io/max-uint32
-
-[coverage-image]: https://img.shields.io/codecov/c/github/const-io/max-uint32/master.svg
-[coverage-url]: https://codecov.io/github/const-io/max-uint32?branch=master
-
-[dependencies-image]: http://img.shields.io/david/const-io/max-uint32.svg
-[dependencies-url]: https://david-dm.org/const-io/max-uint32
-
-[dev-dependencies-image]: http://img.shields.io/david/dev/const-io/max-uint32.svg
-[dev-dependencies-url]: https://david-dm.org/dev/const-io/max-uint32
-
-[github-issues-image]: http://img.shields.io/github/issues/const-io/max-uint32.svg
-[github-issues-url]: https://github.com/const-io/max-uint32/issues
-
-[tape]: https://github.com/substack/tape
-[istanbul]: https://github.com/gotwarlost/istanbul
-[testling]: https://ci.testling.com
-
-[compute-io]: https://github.com/compute-io
\ No newline at end of file
diff --git a/server/node_modules/const-max-uint32/lib/index.js b/server/node_modules/const-max-uint32/lib/index.js
deleted file mode 100644
index 68cae7b..0000000
--- a/server/node_modules/const-max-uint32/lib/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-// EXPORTS //
-
-module.exports = 4294967295; // 2**32 - 1
diff --git a/server/node_modules/const-max-uint32/package.json b/server/node_modules/const-max-uint32/package.json
deleted file mode 100644
index b3056b8..0000000
--- a/server/node_modules/const-max-uint32/package.json
+++ /dev/null
@@ -1,104 +0,0 @@
-{
- "_from": "const-max-uint32@^1.0.2",
- "_id": "const-max-uint32@1.0.2",
- "_inBundle": false,
- "_integrity": "sha1-8Am7YjDmeO2HTdLWqc2ePL+rtnY=",
- "_location": "/const-max-uint32",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "const-max-uint32@^1.0.2",
- "name": "const-max-uint32",
- "escapedName": "const-max-uint32",
- "rawSpec": "^1.0.2",
- "saveSpec": null,
- "fetchSpec": "^1.0.2"
- },
- "_requiredBy": [
- "/validate.io-array-like"
- ],
- "_resolved": "https://registry.npmjs.org/const-max-uint32/-/const-max-uint32-1.0.2.tgz",
- "_shasum": "f009bb6230e678ed874dd2d6a9cd9e3cbfabb676",
- "_spec": "const-max-uint32@^1.0.2",
- "_where": "/home/sigonasr2/divar/server/node_modules/validate.io-array-like",
- "author": {
- "name": "Athan Reines",
- "email": "kgryte@gmail.com"
- },
- "bugs": {
- "url": "https://github.com/const-io/max-uint32/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Athan Reines",
- "email": "kgryte@gmail.com"
- }
- ],
- "dependencies": {},
- "deprecated": false,
- "description": "Maximum unsigned 32-bit integer.",
- "devDependencies": {
- "browserify": "12.x.x",
- "codecov": "1.x.x",
- "istanbul": "^0.4.1",
- "jshint": "2.x.x",
- "jshint-stylish": "2.x.x",
- "math-power": "^1.0.0",
- "tap-spec": "4.x.x",
- "tape": "4.x.x",
- "testling": "1.x.x"
- },
- "homepage": "https://github.com/const-io/max-uint32#readme",
- "keywords": [
- "compute.io",
- "compute",
- "computation",
- "max",
- "array",
- "length",
- "uint32",
- "integer",
- "unsigned",
- "32-bit",
- "const",
- "const-io",
- "const.io",
- "constant"
- ],
- "license": "MIT",
- "main": "./lib",
- "name": "const-max-uint32",
- "repository": {
- "type": "git",
- "url": "git://github.com/const-io/max-uint32.git"
- },
- "scripts": {
- "coverage": "istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov",
- "test": "if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi",
- "test-browsers": "browserify ./test/*.js | testling | tap-spec",
- "test-ci": "npm run test-local && xvfb-run npm run test-browsers",
- "test-cov": "istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"",
- "test-local": "tape \"./test/*.js\" | tap-spec"
- },
- "testling": {
- "files": [
- "test/*.js"
- ],
- "browsers": [
- "iexplore/6.0..latest",
- "firefox/3.0..latest",
- "firefox/nightly",
- "chrome/4.0..latest",
- "chrome/canary",
- "opera/10.0..latest",
- "opera/next",
- "safari/4.0..latest",
- "ipad/6.0..latest",
- "iphone/6.0..latest",
- "android-browser/4.2..latest"
- ]
- },
- "version": "1.0.2"
-}
diff --git a/server/node_modules/const-pinf-float64/LICENSE b/server/node_modules/const-pinf-float64/LICENSE
deleted file mode 100644
index e264f6d..0000000
--- a/server/node_modules/const-pinf-float64/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 The Compute.io Authors.
-
-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/server/node_modules/const-pinf-float64/README.md b/server/node_modules/const-pinf-float64/README.md
deleted file mode 100644
index 5dc1c38..0000000
--- a/server/node_modules/const-pinf-float64/README.md
+++ /dev/null
@@ -1,124 +0,0 @@
-Positive Infinity
-===
-[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]
-
-> Positive infinity.
-
-
-## Installation
-
-``` bash
-$ npm install const-pinf-float64
-```
-
-
-## Usage
-
-``` javascript
-var pinf = require( 'const-pinf-float64' );
-```
-
-#### pinf
-
-Positive infinity.
-
-``` javascript
-pinf === Number.POSITIVE_INFINITY;
-```
-
-
-## Examples
-
-``` javascript
-var pinf = require( 'const-pinf-float64' );
-
-console.log( pinf );
-```
-
-To run the example code from the top-level application directory,
-
-``` bash
-$ node ./examples/index.js
-```
-
-
----
-## Tests
-
-### Unit
-
-This repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:
-
-``` bash
-$ make test
-```
-
-All new feature development should have corresponding unit tests to validate correct functionality.
-
-
-### Test Coverage
-
-This repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
-
-``` bash
-$ make test-cov
-```
-
-Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,
-
-``` bash
-$ make view-cov
-```
-
-
-### Browser Support
-
-This repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:
-
-``` bash
-$ make test-browsers
-```
-
-To view the tests in a local web browser,
-
-``` bash
-$ make view-browser-tests
-```
-
-
-
-
----
-## License
-
-[MIT license](http://opensource.org/licenses/MIT).
-
-
-## Copyright
-
-Copyright © 2016. The [Compute.io][compute-io] Authors..
-
-
-[npm-image]: http://img.shields.io/npm/v/const-pinf-float64.svg
-[npm-url]: https://npmjs.org/package/const-pinf-float64
-
-[build-image]: http://img.shields.io/travis/const-io/pinf-float64/master.svg
-[build-url]: https://travis-ci.org/const-io/pinf-float64
-
-[coverage-image]: https://img.shields.io/codecov/c/github/const-io/pinf-float64/master.svg
-[coverage-url]: https://codecov.io/github/const-io/pinf-float64?branch=master
-
-[dependencies-image]: http://img.shields.io/david/const-io/pinf-float64.svg
-[dependencies-url]: https://david-dm.org/const-io/pinf-float64
-
-[dev-dependencies-image]: http://img.shields.io/david/dev/const-io/pinf-float64.svg
-[dev-dependencies-url]: https://david-dm.org/dev/const-io/pinf-float64
-
-[github-issues-image]: http://img.shields.io/github/issues/const-io/pinf-float64.svg
-[github-issues-url]: https://github.com/const-io/pinf-float64/issues
-
-[tape]: https://github.com/substack/tape
-[istanbul]: https://github.com/gotwarlost/istanbul
-[testling]: https://ci.testling.com
-
-[compute-io]: https://github.com/compute-io/
diff --git a/server/node_modules/const-pinf-float64/lib/index.js b/server/node_modules/const-pinf-float64/lib/index.js
deleted file mode 100644
index 2c6b0ae..0000000
--- a/server/node_modules/const-pinf-float64/lib/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-// EXPORTS //
-
-module.exports = Number.POSITIVE_INFINITY;
diff --git a/server/node_modules/const-pinf-float64/package.json b/server/node_modules/const-pinf-float64/package.json
deleted file mode 100644
index 9f17bee..0000000
--- a/server/node_modules/const-pinf-float64/package.json
+++ /dev/null
@@ -1,102 +0,0 @@
-{
- "_from": "const-pinf-float64@^1.0.0",
- "_id": "const-pinf-float64@1.0.0",
- "_inBundle": false,
- "_integrity": "sha1-9u+w15+cCYbT558pI6v5twtj1yY=",
- "_location": "/const-pinf-float64",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "const-pinf-float64@^1.0.0",
- "name": "const-pinf-float64",
- "escapedName": "const-pinf-float64",
- "rawSpec": "^1.0.0",
- "saveSpec": null,
- "fetchSpec": "^1.0.0"
- },
- "_requiredBy": [
- "/utils-copy"
- ],
- "_resolved": "https://registry.npmjs.org/const-pinf-float64/-/const-pinf-float64-1.0.0.tgz",
- "_shasum": "f6efb0d79f9c0986d3e79f2923abf9b70b63d726",
- "_spec": "const-pinf-float64@^1.0.0",
- "_where": "/home/sigonasr2/divar/server/node_modules/utils-copy",
- "author": {
- "name": "Athan Reines",
- "email": "kgryte@gmail.com"
- },
- "bugs": {
- "url": "https://github.com/const-io/pinf-float64/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Athan Reines",
- "email": "kgryte@gmail.com"
- }
- ],
- "dependencies": {},
- "deprecated": false,
- "description": "Positive infinity.",
- "devDependencies": {
- "browserify": "12.x.x",
- "codecov": "1.x.x",
- "istanbul": "^0.4.1",
- "jshint": "2.x.x",
- "jshint-stylish": "2.x.x",
- "tap-spec": "4.x.x",
- "tape": "4.x.x",
- "testling": "1.x.x"
- },
- "homepage": "https://github.com/const-io/pinf-float64#readme",
- "keywords": [
- "const.io",
- "const",
- "constant",
- "const-io",
- "compute.io",
- "compute-io",
- "computation",
- "compute",
- "mathematics",
- "math",
- "pinf",
- "positive",
- "infinity"
- ],
- "license": "MIT",
- "main": "./lib",
- "name": "const-pinf-float64",
- "repository": {
- "type": "git",
- "url": "git://github.com/const-io/pinf-float64.git"
- },
- "scripts": {
- "coverage": "istanbul cover --dir ./reports/codecov/coverage --report lcovonly tape -- \"./test/*.js\" && cat ./reports/codecov/coverage/lcov.info | codecov && rm -rf ./reports/codecov",
- "test": "if [ \"${TRAVIS}\" ]; then npm run test-ci; else npm run test-local; fi",
- "test-browsers": "browserify ./test/*.js | testling | tap-spec",
- "test-ci": "npm run test-local && xvfb-run npm run test-browsers",
- "test-cov": "istanbul cover --dir ./reports/coverage --report lcov tape -- \"./test/*.js\"",
- "test-local": "tape \"./test/*.js\" | tap-spec"
- },
- "testling": {
- "files": [
- "test/*.js"
- ],
- "browsers": [
- "iexplore/6.0..latest",
- "firefox/3.0..latest",
- "firefox/nightly",
- "chrome/4.0..latest",
- "chrome/canary",
- "opera/10.0..latest",
- "opera/next",
- "safari/4.0..latest",
- "ipad/6.0..latest",
- "iphone/6.0..latest",
- "android-browser/4.2..latest"
- ]
- },
- "version": "1.0.0"
-}
diff --git a/server/node_modules/crypto/README.md b/server/node_modules/crypto/README.md
deleted file mode 100644
index 5437f14..0000000
--- a/server/node_modules/crypto/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Deprecated Package
-
-This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
-
-It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
-
-Please contact support@npmjs.com if you have questions about this package.
diff --git a/server/node_modules/crypto/package.json b/server/node_modules/crypto/package.json
deleted file mode 100644
index a643171..0000000
--- a/server/node_modules/crypto/package.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "_from": "crypto",
- "_id": "crypto@1.0.1",
- "_inBundle": false,
- "_integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==",
- "_location": "/crypto",
- "_phantomChildren": {},
- "_requested": {
- "type": "tag",
- "registry": true,
- "raw": "crypto",
- "name": "crypto",
- "escapedName": "crypto",
- "rawSpec": "",
- "saveSpec": null,
- "fetchSpec": "latest"
- },
- "_requiredBy": [
- "#USER",
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
- "_shasum": "2af1b7cad8175d24c8a1b0778255794a21803037",
- "_spec": "crypto",
- "_where": "/home/sigonasr2/divar/server",
- "author": "",
- "bugs": {
- "url": "https://github.com/npm/deprecate-holder/issues"
- },
- "bundleDependencies": false,
- "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.",
- "description": "This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.",
- "homepage": "https://github.com/npm/deprecate-holder#readme",
- "license": "ISC",
- "main": "index.js",
- "name": "crypto",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/npm/deprecate-holder.git"
- },
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "version": "1.0.1"
-}
diff --git a/server/node_modules/cwise-compiler/.npmignore b/server/node_modules/cwise-compiler/.npmignore
deleted file mode 100644
index 038e024..0000000
--- a/server/node_modules/cwise-compiler/.npmignore
+++ /dev/null
@@ -1,16 +0,0 @@
-lib-cov
-*.seed
-*.log
-*.csv
-*.dat
-*.out
-*.pid
-*.gz
-
-pids
-logs
-results
-
-npm-debug.log
-node_modules/*
-test/*
\ No newline at end of file
diff --git a/server/node_modules/cwise-compiler/.travis.yml b/server/node_modules/cwise-compiler/.travis.yml
deleted file mode 100644
index 9672e12..0000000
--- a/server/node_modules/cwise-compiler/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-node_js:
- - "0.8"
- - "0.10"
-before_install:
- - npm install -g npm@~1.4.6
diff --git a/server/node_modules/cwise-compiler/LICENSE b/server/node_modules/cwise-compiler/LICENSE
deleted file mode 100644
index 8ce206a..0000000
--- a/server/node_modules/cwise-compiler/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-
-The MIT License (MIT)
-
-Copyright (c) 2013 Mikola Lysenko
-
-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/server/node_modules/cwise-compiler/README.md b/server/node_modules/cwise-compiler/README.md
deleted file mode 100644
index ae19364..0000000
--- a/server/node_modules/cwise-compiler/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-cwise-compiler
-==============
-Just the compiler from cwise. You can call this directly if you know what you are doing and want to skip calling cwise-parser and including esprima. This is only recommended in extreme cases though. Otherwise you should stick to the default interface in cwise and not mess around with this craziness.
-
-[![build status](https://secure.travis-ci.org/scijs/cwise-compiler.png)](http://travis-ci.org/scijs/cwise-compiler)
-
-# Install
-Install using [npm](https://www.npmjs.com/):
-
- npm install cwise-compiler
-
-# API
-#### `require("cwise-compiler")(procedure)`
-Compiles a cwise procedure for the given procedure. The object procedure must have the following fields:
-
-* `args` An array of argument types (as in cwise)
-* `pre` A parsed pre function
-* `body` A parsed body function
-* `post` A parsed post function
-* `funcName` Name of the function
-* `blockSize` Block size to generate
-* `debug` Debug mode flag
-
-# License
-(c) 2013 Mikola Lysenko. MIT License
diff --git a/server/node_modules/cwise-compiler/compiler.js b/server/node_modules/cwise-compiler/compiler.js
deleted file mode 100644
index d2c8927..0000000
--- a/server/node_modules/cwise-compiler/compiler.js
+++ /dev/null
@@ -1,109 +0,0 @@
-"use strict"
-
-var createThunk = require("./lib/thunk.js")
-
-function Procedure() {
- this.argTypes = []
- this.shimArgs = []
- this.arrayArgs = []
- this.arrayBlockIndices = []
- this.scalarArgs = []
- this.offsetArgs = []
- this.offsetArgIndex = []
- this.indexArgs = []
- this.shapeArgs = []
- this.funcName = ""
- this.pre = null
- this.body = null
- this.post = null
- this.debug = false
-}
-
-function compileCwise(user_args) {
- //Create procedure
- var proc = new Procedure()
-
- //Parse blocks
- proc.pre = user_args.pre
- proc.body = user_args.body
- proc.post = user_args.post
-
- //Parse arguments
- var proc_args = user_args.args.slice(0)
- proc.argTypes = proc_args
- for(var i=0; i0) {
- throw new Error("cwise: pre() block may not reference array args")
- }
- if(i < proc.post.args.length && proc.post.args[i].count>0) {
- throw new Error("cwise: post() block may not reference array args")
- }
- } else if(arg_type === "scalar") {
- proc.scalarArgs.push(i)
- proc.shimArgs.push("scalar" + i)
- } else if(arg_type === "index") {
- proc.indexArgs.push(i)
- if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {
- throw new Error("cwise: pre() block may not reference array index")
- }
- if(i < proc.body.args.length && proc.body.args[i].lvalue) {
- throw new Error("cwise: body() block may not write to array index")
- }
- if(i < proc.post.args.length && proc.post.args[i].count > 0) {
- throw new Error("cwise: post() block may not reference array index")
- }
- } else if(arg_type === "shape") {
- proc.shapeArgs.push(i)
- if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {
- throw new Error("cwise: pre() block may not write to array shape")
- }
- if(i < proc.body.args.length && proc.body.args[i].lvalue) {
- throw new Error("cwise: body() block may not write to array shape")
- }
- if(i < proc.post.args.length && proc.post.args[i].lvalue) {
- throw new Error("cwise: post() block may not write to array shape")
- }
- } else if(typeof arg_type === "object" && arg_type.offset) {
- proc.argTypes[i] = "offset"
- proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })
- proc.offsetArgIndex.push(i)
- } else {
- throw new Error("cwise: Unknown argument type " + proc_args[i])
- }
- }
-
- //Make sure at least one array argument was specified
- if(proc.arrayArgs.length <= 0) {
- throw new Error("cwise: No array arguments specified")
- }
-
- //Make sure arguments are correct
- if(proc.pre.args.length > proc_args.length) {
- throw new Error("cwise: Too many arguments in pre() block")
- }
- if(proc.body.args.length > proc_args.length) {
- throw new Error("cwise: Too many arguments in body() block")
- }
- if(proc.post.args.length > proc_args.length) {
- throw new Error("cwise: Too many arguments in post() block")
- }
-
- //Check debug flag
- proc.debug = !!user_args.printCode || !!user_args.debug
-
- //Retrieve name
- proc.funcName = user_args.funcName || "cwise"
-
- //Read in block size
- proc.blockSize = user_args.blockSize || 64
-
- return createThunk(proc)
-}
-
-module.exports = compileCwise
diff --git a/server/node_modules/cwise-compiler/lib/compile.js b/server/node_modules/cwise-compiler/lib/compile.js
deleted file mode 100644
index 87910e0..0000000
--- a/server/node_modules/cwise-compiler/lib/compile.js
+++ /dev/null
@@ -1,358 +0,0 @@
-"use strict"
-
-var uniq = require("uniq")
-
-// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index)
-// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.
-function innerFill(order, proc, body) {
- var dimension = order.length
- , nargs = proc.arrayArgs.length
- , has_index = proc.indexArgs.length>0
- , code = []
- , vars = []
- , idx=0, pidx=0, i, j
- for(i=0; i 0) {
- code.push("var " + vars.join(","))
- }
- //Scan loop
- for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards
- idx = order[i]
- code.push(["for(i",i,"=0;i",i," 0) {
- code.push(["index[",pidx,"]-=s",pidx].join(""))
- }
- code.push(["++index[",idx,"]"].join(""))
- }
- code.push("}")
- }
- return code.join("\n")
-}
-
-// Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block.
-// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.
-// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.
-function outerFill(matched, order, proc, body) {
- var dimension = order.length
- , nargs = proc.arrayArgs.length
- , blockSize = proc.blockSize
- , has_index = proc.indexArgs.length > 0
- , code = []
- for(var i=0; i0;){"].join("")) // Iterate back to front
- code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).
- code.push(["s",order[i],"=j",i].join(""))
- code.push(["j",i,"=0"].join(""))
- code.push(["}else{s",order[i],"=",blockSize].join(""))
- code.push(["j",i,"-=",blockSize,"}"].join(""))
- if(has_index) {
- code.push(["index[",order[i],"]=j",i].join(""))
- }
- }
- for(var i=0; i 0) {
- allEqual = allEqual && summary[i] === summary[i-1]
- }
- }
- if(allEqual) {
- return summary[0]
- }
- return summary.join("")
-}
-
-//Generates a cwise operator
-function generateCWiseOp(proc, typesig) {
-
- //Compute dimension
- // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.
- var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0
- var orders = new Array(proc.arrayArgs.length)
- var dtypes = new Array(proc.arrayArgs.length)
- for(var i=0; i 0) {
- vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)
- }
- if(proc.indexArgs.length > 0) {
- // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.
- var zeros = new Array(dimension)
- for(var i=0; i 0) {
- code.push("var " + vars.join(","))
- }
- for(var i=0; i 3) {
- code.push(processBlock(proc.pre, proc, dtypes))
- }
-
- //Process body
- var body = processBlock(proc.body, proc, dtypes)
- var matched = countMatches(loopOrders)
- if(matched < dimension) {
- code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.
- } else {
- code.push(innerFill(loopOrders[0], proc, body))
- }
-
- //Inline epilog
- if(proc.post.body.length > 3) {
- code.push(processBlock(proc.post, proc, dtypes))
- }
-
- if(proc.debug) {
- console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------")
- }
-
- var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("")
- var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join(""))
- return f()
-}
-module.exports = generateCWiseOp
diff --git a/server/node_modules/cwise-compiler/lib/thunk.js b/server/node_modules/cwise-compiler/lib/thunk.js
deleted file mode 100644
index 728954f..0000000
--- a/server/node_modules/cwise-compiler/lib/thunk.js
+++ /dev/null
@@ -1,86 +0,0 @@
-"use strict"
-
-// The function below is called when constructing a cwise function object, and does the following:
-// A function object is constructed which accepts as argument a compilation function and returns another function.
-// It is this other function that is eventually returned by createThunk, and this function is the one that actually
-// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.
-// The compilation passed to the first function object is used for compiling new functions.
-// Once this function object is created, it is called with compile as argument, where the first argument of compile
-// is bound to "proc" (essentially containing a preprocessed version of the user arguments to cwise).
-// So createThunk roughly works like this:
-// function createThunk(proc) {
-// var thunk = function(compileBound) {
-// var CACHED = {}
-// return function(arrays and scalars) {
-// if (dtype and order of arrays in CACHED) {
-// var func = CACHED[dtype and order of arrays]
-// } else {
-// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)
-// }
-// return func(arrays and scalars)
-// }
-// }
-// return thunk(compile.bind1(proc))
-// }
-
-var compile = require("./compile.js")
-
-function createThunk(proc) {
- var code = ["'use strict'", "var CACHED={}"]
- var vars = []
- var thunkName = proc.funcName + "_cwise_thunk"
-
- //Build thunk
- code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join(""))
- var typesig = []
- var string_typesig = []
- var proc_args = [["array",proc.arrayArgs[0],".shape.slice(", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).
- Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(","+proc.arrayBlockIndices[0]+")"):")"].join("")]
- var shapeLengthConditions = [], shapeConditions = []
- // Process array arguments
- for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices)
- shapeLengthConditions.push("array" + proc.arrayArgs[0] + ".shape.length===array" + j + ".shape.length+" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))
- shapeConditions.push("array" + proc.arrayArgs[0] + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[0]) + "]===array" + j + ".shape[shapeIndex+" + Math.max(0,proc.arrayBlockIndices[i]) + "]")
- }
- }
- // Check for shape equality
- if (proc.arrayArgs.length > 1) {
- code.push("if (!(" + shapeLengthConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same dimensionality!')")
- code.push("for(var shapeIndex=array" + proc.arrayArgs[0] + ".shape.length-" + Math.abs(proc.arrayBlockIndices[0]) + "; shapeIndex-->0;) {")
- code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')")
- code.push("}")
- }
- // Process scalar arguments
- for(var i=0; i'+
- 'Embedded Window '+
- '42 '+
- '