beanstalkd-protocol
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -43,3 +43,3 @@ 'use strict'; | ||
if (signature.substr(-2) !== _misc.CRLF.toString()) { | ||
throw new Error(`${ key } ${ signature } does not end in CRLF`); | ||
throw new Error(`${key} ${signature} does not end in CRLF`); | ||
} | ||
@@ -57,3 +57,3 @@ | ||
if (!this.types[arg]) throw new Error(`arg ${ arg } does not have a type defined`); | ||
if (!this.types[arg]) throw new Error(`arg ${arg} does not have a type defined`); | ||
return arg; | ||
@@ -149,14 +149,14 @@ }); | ||
(0, _assert2.default)(argsOptional || !expectsArgsLength || args || args.length, `${ identifier } requires args`); | ||
(0, _assert2.default)(argsOptional || !args || !args.length || expectsArgsLength === argsLength, `${ identifier } expects ${ spec.args.length } args`); | ||
(0, _assert2.default)(argsOptional || !expectsArgsLength || args || args.length, `${identifier} requires args`); | ||
(0, _assert2.default)(argsOptional || !args || !args.length || expectsArgsLength === argsLength, `${identifier} expects ${spec.args.length} args`); | ||
if (!args || !argsLength) { | ||
return new Buffer(identifier + _misc.CRLF); | ||
return Buffer.from(identifier + _misc.CRLF); | ||
} | ||
if (spec.parts.length < 2) { | ||
return new Buffer(identifier + ' ' + args.join(' ') + _misc.CRLF); | ||
return Buffer.from(identifier + ' ' + args.join(' ') + _misc.CRLF); | ||
} | ||
let buffers = [new Buffer(identifier + ' ')]; | ||
let buffers = [Buffer.from(identifier + ' ')]; | ||
@@ -176,3 +176,3 @@ let offset = 0; | ||
} else { | ||
buffers.push(new Buffer(arg.toString())); | ||
buffers.push(Buffer.from(arg.toString())); | ||
} | ||
@@ -179,0 +179,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.reduce = reduce; | ||
const CRLF = exports.CRLF = new Buffer([0x0d, 0x0a]); | ||
const SPACE = exports.SPACE = new Buffer(' '); | ||
const CRLF = exports.CRLF = Buffer.from([0x0d, 0x0a]); // '\r\n' | ||
const SPACE = exports.SPACE = Buffer.from([0x20]); // ' ' | ||
@@ -11,0 +11,0 @@ function reduce(collection, callback, accumulator) { |
{ | ||
"name": "beanstalkd-protocol", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Beanstalkd protocol parser for Node.js/Javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36147
15