diff --git a/.gitignore b/.gitignore index bc7fc55..b6ee8b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +lib/ + # Logs logs *.log diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 4c2d610..0000000 --- a/lib/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// -const crypto = require('crypto') - -module.exports = function (size ) { - return { - expand (data ) { - const buffer = crypto.randomBytes(data.length < size - 4 ? size : data.length + 4) - buffer.writeUInt32BE(data.length, 0) - data.copy(buffer, 4, 0) - return buffer - }, - shrink (buffer ) { - const dataLen = buffer.readUInt32BE(0) - return buffer.slice(4, dataLen + 4) - } - } -} diff --git a/package.json b/package.json index cc95f78..8d80fc8 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,17 @@ "license": "MIT", "author": "Exodus Movement, Inc.", "main": "./lib/index.js", + "files": [ + "src/" + ], "repository": { "type": "git", "url": "git+https://github.com/ExodusMovement/buffer-noise.git" }, "scripts": { - "build": "flow-remove-types ./src/index.js > ./lib/index.js", + "build": "make-dir lib && flow-remove-types ./src/index.js > ./lib/index.js", "lint": "standard", + "prepare": "npm run build", "pretest": "npm run build", "test": "npm run lint && flow check && npm run unit", "unit": "tape -r flow-remove-types/register ./test/index.js | tf-spec" @@ -25,6 +29,7 @@ "babel-eslint": "^7.2.1", "flow-bin": "^0.43.0", "flow-remove-types": "^1.2.0", + "make-dir-cli": "^3.0.0", "standard": "^10.0.0", "tape": "^4.6.3" },