Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

halfpenny

Package Overview
Dependencies
Maintainers
7
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

halfpenny - npm Package Compare versions

Comparing version 8.0.0 to 9.0.0

4

lib/halfpenny.js
'use strict';
const btoa = require('./utils/btoa.js');
const coinsDepositBox = require('coins-deposit-box');
const cookies = require('js-cookie');

@@ -193,3 +192,2 @@ const hawk = require('hawk/dist/browser.js');

username: data.username,
coinstac: data.coinstac || false,
})

@@ -609,4 +607,2 @@ .then((response) => {

return new Halfpenny(Object.assign({}, {
baseUrl: coinsDepositBox.apiURL,
authCookieName: coinsDepositBox.cookieName,
storage,

@@ -613,0 +609,0 @@ requestEngine: require('axios'), // eslint-disable-line global-require

7

package.json

@@ -16,3 +16,2 @@ {

"axios": "^0.15.3",
"coins-deposit-box": "^7.0.0",
"dom-storage": "^2.0.2",

@@ -30,5 +29,5 @@ "hawk": "^6.0.1",

"minami": "^1.1.1",
"nyc": "^10.1.2",
"nyc": "^11.8.0",
"pre-commit": "^1.2.2",
"sinon": "^1.17.7",
"sinon": "^5.0.10",
"tape": "^4.6.3"

@@ -59,3 +58,3 @@ },

},
"version": "8.0.0"
"version": "9.0.0"
}

@@ -24,17 +24,8 @@ # Halfpenny

The easiest way to get started with Halfpenny is to use the `Halfpenny.factory` static method:
```js
const Halfpenny = require('halfpenny');
const myHalfpenny = Halfpenny.factory();
```
This configures a `Halfpenny` instance using environment-specific configuration from _[coins-deposit-box](https://github.com/MRN-Code/quarterback/tree/master/packages/coins-deposit-box)_. Alternatively, you can override configuration:
```js
const Halfpenny = require('halfpenny');
const myHalfpenny = Halfpenny.factory({
baseUrl: 'http://localhost:8800',
authCookieName: 'CAS_Auth_User'
});

@@ -45,4 +36,4 @@ ```

* **`authCookieName`** `<String>`: Authentication cookie’s name.
* **`baseUrl`** `<String>`: Base URL for the API server.
* **`authCookieName`** `<String>`: Authentication cookie’s name. [`REQUIRED`]
* **`baseUrl`** `<String>`: Base URL for the API server. [`REQUIRED`]
* **`storage`** `<Object>`: Storage instance for persisting authentication credentials. This defaults to [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) in browsers, or _[dom-storage](https://www.npmjs.com/package/dom-storage)_ in Node.js.

@@ -49,0 +40,0 @@

@@ -750,7 +750,7 @@ 'use strict';

t.throws(() => Halfpenny.factory({}), 'throws when called without all required args');
t.ok(
Halfpenny.factory() instanceof Halfpenny,
'returns instance without configuration'
Halfpenny.factory({ authCookieName, baseUrl }) instanceof Halfpenny,
'returns instance when required options are provided'
);
t.ok(Halfpenny.factory({}), 'uses default configuration');
t.equal(hp.authCookieName, authCookieName, 'passes authCookieName');

@@ -757,0 +757,0 @@ t.equal(hp.baseUrl, baseUrl, 'passes baseUrl');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc