Skip to content

Commit b90fe8e

Browse files
authored
Merge pull request #30 from alexscheitlin/prettier-config
lint-staged & husky in monorepos
2 parents 8412a8e + 2368eb8 commit b90fe8e

File tree

15 files changed

+16417
-9881
lines changed

15 files changed

+16417
-9881
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.vscode
1+
.vscode
2+
node_modules

crypto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Finite Field ElGamal (`ff-elgamal`)
44

5-
## Elliptic Curve ElGamal (`ec-elgamal`)
5+
## Elliptic Curve ElGamal (`ec-elgamal`)

crypto/package-lock.json

Lines changed: 0 additions & 130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crypto/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"types": "dist/index.d.ts",
77
"scripts": {
88
"build": "rm -rf dist && tsc",
9+
"pre-commit": "lint-staged",
910
"test": "nyc --reporter=text ts-mocha ./**/*.spec.ts",
1011
"test:timeout": "nyc --reporter=text ts-mocha ./**/*.spec.ts --timeout 10000",
1112
"test:watch": "ts-mocha ./**/*.spec.ts -w --watch-extensions ts ",
@@ -28,7 +29,6 @@
2829
"@types/elliptic": "^6.4.10",
2930
"@types/mocha": "^5.2.7",
3031
"chai": "^4.2.0",
31-
"husky": "^3.1.0",
3232
"lint-staged": "^9.4.3",
3333
"mocha": "^6.2.2",
3434
"nyc": "^14.1.1",
@@ -42,11 +42,6 @@
4242
"webpack": "^4.41.2",
4343
"webpack-cli": "^3.3.10"
4444
},
45-
"husky": {
46-
"hooks": {
47-
"pre-commit": "lint-staged"
48-
}
49-
},
5045
"lint-staged": {
5146
"*.js": [
5247
"prettier --write",

crypto/test/ecc-elgamal/encryption.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { }
1+
export {}
22
import { ECelGamal } from '../../src/index'
33

44
const { expect, assert } = require('chai')
@@ -15,12 +15,12 @@ const yesVoteInt = 6
1515
const noVoteOnCurve = ec.curve.pointFromX(noVoteInt)
1616
const yesVoteOnCurve = ec.curve.pointFromX(yesVoteInt)
1717

18-
describe('Elliptic Curve ElGamal Encryption', function () {
19-
it('Points that encode the plaintexts should lie on the curve', function () {
18+
describe('Elliptic Curve ElGamal Encryption', function() {
19+
it('Points that encode the plaintexts should lie on the curve', function() {
2020
assert(ec.curve.validate(yesVoteOnCurve) && ec.curve.validate(noVoteOnCurve))
2121
})
2222

23-
it('Decrypted value is the same as the original message', function () {
23+
it('Decrypted value is the same as the original message', function() {
2424
const keyPair = ec.genKeyPair()
2525
const privateKey = keyPair.getPrivate()
2626
const publicKey = keyPair.getPublic()
@@ -32,7 +32,7 @@ describe('Elliptic Curve ElGamal Encryption', function () {
3232
assert(decryptedCipherText.eq(messageToEncrypt))
3333
})
3434

35-
it('Two added ciphertexts should be the same as adding two plain texts', function () {
35+
it('Two added ciphertexts should be the same as adding two plain texts', function() {
3636
const keyPair = ec.genKeyPair()
3737
const privateKey = keyPair.getPrivate()
3838
const publicKey = keyPair.getPublic()

crypto/test/ff-elgamal/encryption.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export { }
2-
import BN = require("bn.js")
1+
export {}
2+
import BN = require('bn.js')
33
import { FFelGamal } from '../../src/index'
44
import { getSecureRandomValue } from '../../src/ff-elgamal/helper'
55

0 commit comments

Comments
 (0)