Skip to content

Commit

Permalink
Update dependencies to enable Greenkeeper 🌴 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and blakeembrey committed May 7, 2017
1 parent a1ab96b commit eac10b2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ notifications:
on_failure: change

node_js:
- "0.10"
- "0.12"
- "4"
- "stable"

after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Greenkeeper badge](https://badges.greenkeeper.io/blakeembrey/popsicle-basic-auth.svg)](https://greenkeeper.io/)

> Add basic authentication to requests.
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "1.0.0",
"description": "Add basic authentication to Popsicle requests",
"main": "popsicle-basic-auth.js",
"browser": {
"safe-buffer": false
},
"typings": "popsicle-basic-auth.d.ts",
"files": [
"popsicle-basic-auth.js",
Expand Down Expand Up @@ -36,12 +39,14 @@
},
"homepage": "https://github.com/blakeembrey/popsicle-basic-auth",
"devDependencies": {
"es6-promise": "^3.1.2",
"es6-promise": "^4.1.0",
"istanbul": "^0.4.3",
"mocha": "^2.0.1",
"nock": "^8.0.0",
"popsicle": "^6.0.0",
"pre-commit": "^1.0.6",
"standard": "^7.0.1"
"mocha": "^3.3.0",
"nock": "^9.0.13",
"popsicle": "^9.1.0",
"standard": "^10.0.2"
},
"dependencies": {
"safe-buffer": "^5.0.1"
}
}
4 changes: 3 additions & 1 deletion popsicle-basic-auth.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
var Buffer = require('safe-buffer').Buffer

/**
* Native base 64 encoding.
*
* @param {String} str
* @return {String}
*/
var encode = typeof window === 'object' ? /* istanbul ignore next */ window.btoa : function (str) {
return new Buffer(str).toString('base64')
return Buffer.from(str).toString('base64')
}

module.exports = popsicleBasicAuth
Expand Down
3 changes: 2 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ require('es6-promise').polyfill()

var popsicle = require('popsicle')
var nock = require('nock')
var Buffer = require('safe-buffer').Buffer
var auth = require('./')

describe('popsicle basic auth', function () {
describe('authorization header', function () {
beforeEach(function () {
var str = new Buffer('blakeembrey:hunter2').toString('base64')
var str = Buffer.from('blakeembrey:hunter2').toString('base64')

nock('http://example.com', {
reqheaders: {
Expand Down

0 comments on commit eac10b2

Please sign in to comment.