Skip to content

Commit

Permalink
chore: use redis-parser dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR committed May 19, 2017
1 parent 4944637 commit c67fb70
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 89 deletions.
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
'use strict'

module.exports = require('./lib/parser')
module.exports.ReplyError = require('./lib/replyError')
module.exports.RedisError = require('./lib/redisError')
module.exports.ParserError = require('./lib/redisError')
5 changes: 3 additions & 2 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

const StringDecoder = require('string_decoder').StringDecoder
const decoder = new StringDecoder()
const ReplyError = require('./replyError')
const ParserError = require('./parserError')
const errors = require('redis-errors')
const ReplyError = errors.ReplyError
const ParserError = errors.ParserError
var bufferPool = Buffer.allocUnsafe(32 * 1024)
var bufferOffset = 0
var interval = null
Expand Down
26 changes: 0 additions & 26 deletions lib/parserError.js

This file was deleted.

11 changes: 0 additions & 11 deletions lib/redisError.js

This file was deleted.

20 changes: 0 additions & 20 deletions lib/replyError.js

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"engines": {
"node": ">=6"
},
"dependencies": {
"redis-errors": "^1.0.0"
},
"devDependencies": {
"benchmark": "^2.1.0",
"codeclimate-test-reporter": "^0.4.0",
Expand Down
22 changes: 0 additions & 22 deletions test/errors.spec.js

This file was deleted.

5 changes: 3 additions & 2 deletions test/hiredis.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict'

const hiredis = require('hiredis')
const ReplyError = require('../lib/replyError')
const ParserError = require('../lib/parserError')
const errors = require('redis-errors')
const ReplyError = errors.ReplyError
const ParserError = errors.ParserError

/**
* Parse data
Expand Down
7 changes: 4 additions & 3 deletions test/parsers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const assert = require('assert')
const util = require('util')
const JavascriptParser = require('../')
const HiredisParser = require('./hiredis')
const ReplyError = JavascriptParser.ReplyError
const ParserError = JavascriptParser.ParserError
const RedisError = JavascriptParser.RedisError
const errors = require('redis-errors')
const ReplyError = errors.ReplyError
const ParserError = errors.ParserError
const RedisError = errors.RedisError
const parsers = [HiredisParser, JavascriptParser]

// Mock the not needed return functions
Expand Down

0 comments on commit c67fb70

Please sign in to comment.