From 56eb4afd1ababda180ac91b36fc56216fd40cbec Mon Sep 17 00:00:00 2001 From: Jackson Date: Fri, 9 Feb 2018 13:17:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"feat:=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=20(#24)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1dadc7e1e3e2216d65d668cee7772b2b6b27a156. --- package.json | 2 +- src/encoding/index.js | 2 +- test/encoding.js | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 04659e9..f466006 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mip-validator", - "version": "1.5.14", + "version": "1.5.13", "description": "MIP validator", "main": "index.js", "dependencies": { diff --git a/src/encoding/index.js b/src/encoding/index.js index f97b203..93d4878 100644 --- a/src/encoding/index.js +++ b/src/encoding/index.js @@ -1,4 +1,4 @@ -const jschardet = require('jschardet') +const jschardet = require('./fake-jschardet.js') const ERR = require('../error/dfn.json') const allowedEncoding = ['UTF-8', 'ascii'] const logger = require('../logger.js')('mip-validator:encoding') diff --git a/test/encoding.js b/test/encoding.js index 1c365f3..118811e 100644 --- a/test/encoding.js +++ b/test/encoding.js @@ -2,9 +2,7 @@ const chai = require('./chai.js') const expect = chai.expect const Validator = require('..') const asciiStr = 'hello' -const ERR = require('../src/error/dfn.json') const utf8Str = '\xc3\xa0\xc3\xad\xc3\xa0\xc3\xa7\xc3\xa3' -const big5Str = '\xa6\xb8\xb1\x60\xa5\xce\xb0\xea\xa6\x72\xbc\xd0\xb7\xc7\xa6\x72\xc5\xe9\xaa\xed' describe('encoding', function() { it('should accept ASCII', function() { @@ -17,10 +15,4 @@ describe('encoding', function() { var result = validator.validate(utf8Str) expect(result).to.have.lengthOf(0) }) - it('should reject Big5', function () { - var validator = Validator({}) - var result = validator.validate(big5Str) - expect(result).to.have.lengthOf(1) - expect(result[0].code).to.equal(ERR.DISALLOWED_ENCODING.code) - }) }) \ No newline at end of file From 42831cfe0304bf3c8504086af94937bd44d2ecc4 Mon Sep 17 00:00:00 2001 From: Jackson Date: Fri, 9 Feb 2018 13:18:52 +0800 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f466006..be0893e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mip-validator", - "version": "1.5.13", + "version": "1.5.15", "description": "MIP validator", "main": "index.js", "dependencies": {