Skip to content

Commit c67fb70

Browse files
committed
chore: use redis-parser dependency
1 parent 4944637 commit c67fb70

File tree

9 files changed

+13
-89
lines changed

9 files changed

+13
-89
lines changed

index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
'use strict'
22

33
module.exports = require('./lib/parser')
4-
module.exports.ReplyError = require('./lib/replyError')
5-
module.exports.RedisError = require('./lib/redisError')
6-
module.exports.ParserError = require('./lib/redisError')

lib/parser.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
const StringDecoder = require('string_decoder').StringDecoder
44
const decoder = new StringDecoder()
5-
const ReplyError = require('./replyError')
6-
const ParserError = require('./parserError')
5+
const errors = require('redis-errors')
6+
const ReplyError = errors.ReplyError
7+
const ParserError = errors.ParserError
78
var bufferPool = Buffer.allocUnsafe(32 * 1024)
89
var bufferOffset = 0
910
var interval = null

lib/parserError.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/redisError.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

lib/replyError.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
"engines": {
3030
"node": ">=6"
3131
},
32+
"dependencies": {
33+
"redis-errors": "^1.0.0"
34+
},
3235
"devDependencies": {
3336
"benchmark": "^2.1.0",
3437
"codeclimate-test-reporter": "^0.4.0",

test/errors.spec.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/hiredis.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
'use strict'
22

33
const hiredis = require('hiredis')
4-
const ReplyError = require('../lib/replyError')
5-
const ParserError = require('../lib/parserError')
4+
const errors = require('redis-errors')
5+
const ReplyError = errors.ReplyError
6+
const ParserError = errors.ParserError
67

78
/**
89
* Parse data

test/parsers.spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ const assert = require('assert')
77
const util = require('util')
88
const JavascriptParser = require('../')
99
const HiredisParser = require('./hiredis')
10-
const ReplyError = JavascriptParser.ReplyError
11-
const ParserError = JavascriptParser.ParserError
12-
const RedisError = JavascriptParser.RedisError
10+
const errors = require('redis-errors')
11+
const ReplyError = errors.ReplyError
12+
const ParserError = errors.ParserError
13+
const RedisError = errors.RedisError
1314
const parsers = [HiredisParser, JavascriptParser]
1415

1516
// Mock the not needed return functions

0 commit comments

Comments
 (0)