buf-compare
Advanced tools
Comparing version 1.0.0 to 1.0.1
'use strict'; | ||
module.exports = function (a, b) { | ||
module.exports = Buffer.compare || function (a, b) { | ||
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { | ||
@@ -11,6 +11,2 @@ throw new TypeError('Arguments must be Buffers'); | ||
if (typeof Buffer.compare === 'function') { | ||
return Buffer.compare(a, b); | ||
} | ||
var x = a.length; | ||
@@ -17,0 +13,0 @@ var y = b.length; |
{ | ||
"name": "buf-compare", | ||
"version": "1.0.0", | ||
"description": "Node.js 0.12 Buffer.compare() ponyfill", | ||
"version": "1.0.1", | ||
"description": "Node.js `Buffer.compare()` ponyfill", | ||
"license": "MIT", | ||
@@ -16,3 +16,3 @@ "repository": "sindresorhus/buf-compare", | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "ava" | ||
}, | ||
@@ -36,4 +36,4 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "0.0.4" | ||
"ava": "*" | ||
} | ||
} |
# buf-compare [![Build Status](https://travis-ci.org/sindresorhus/buf-compare.svg?branch=master)](https://travis-ci.org/sindresorhus/buf-compare) | ||
> Node.js 0.12 [`Buffer.compare()`](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_compare_buf1_buf2) ponyfill | ||
> Node.js [`Buffer.compare()`](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_compare_buf1_buf2) [ponyfill](https://ponyfill.com) | ||
> Ponyfill: A polyfill that doesn't overwrite the native method | ||
## Install | ||
@@ -35,4 +33,4 @@ | ||
- [buffer-equals](https://github.com/sindresorhus/buffer-equals) - Node.js 0.12 `buffer.equals()` ponyfill | ||
- [buf-indexof](https://github.com/sindresorhus/buf-indexof) - io.js 1.5.0 (Node.js) `buffer.indexOf()` ponyfill | ||
- [buffer-equals](https://github.com/sindresorhus/buffer-equals) - Node.js `buffer.equals()` ponyfill | ||
- [buf-indexof](https://github.com/sindresorhus/buf-indexof) - Node.js `buffer.indexOf()` ponyfill | ||
@@ -39,0 +37,0 @@ |
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
3095
22
40