Socket
Socket
Sign inDemoInstall

@ideal-postcodes/core-browser

Package Overview
Dependencies
1
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

14

CHANGELOG.md

@@ -0,1 +1,15 @@

## [1.0.1](https://github.com/ideal-postcodes/core-browser/compare/1.0.0...1.0.1) (2019-10-21)
### Bug Fixes
* **Async:** Simplify transpilation by removing async/await ([6bf6aa0](https://github.com/ideal-postcodes/core-browser/commit/6bf6aa02372ddb77d24e622faa037ecc3b0488c9))
## [1.0.1](https://github.com/ideal-postcodes/core-browser/compare/1.0.0...1.0.1) (2019-10-21)
### Bug Fixes
* **Async:** Simplify transpilation by removing async/await ([6bf6aa0](https://github.com/ideal-postcodes/core-browser/commit/6bf6aa02372ddb77d24e622faa037ecc3b0488c9))
# 1.0.0 (2019-10-16)

@@ -2,0 +16,0 @@

1

dist/agent.d.ts

@@ -28,3 +28,4 @@ import { Agent as IAgent, HttpResponse, HttpRequest } from "@ideal-postcodes/core-interface";

constructor(config?: RequestInit);
private abortController;
http(httpRequest: HttpRequest): Promise<HttpResponse>;
}

46

dist/agent.js

@@ -71,25 +71,22 @@ "use strict";

}
async http(httpRequest) {
// Return AbortController instance if present
abortController() {
if (window.AbortController === undefined)
return;
return new window.AbortController();
}
http(httpRequest) {
const { body, method, url, header, query, timeout } = httpRequest;
const requestInfo = {
method,
headers: header,
...this.defaultConfig,
...this.config,
};
const abortController = this.abortController();
if (abortController)
requestInfo.signal = abortController.signal;
try {
const { body, method, url, header, query, timeout } = httpRequest;
const requestInfo = {
method,
headers: header,
...this.defaultConfig,
...this.config,
};
// Append body if present
if (body !== undefined)
requestInfo.body = JSON.stringify(body);
// Add AbortController if available in browser
let abortController;
if (window.AbortController !== undefined) {
abortController = new window.AbortController();
requestInfo.signal = abortController.signal;
}
// Assemble and dispatch request
const request = new Request(`${url}${exports.parseQuery(query)}`, requestInfo);
const response = await timed_fetch_1.timedFetch(request, timeout, abortController);
const responseBody = await response.json();
return exports.toHttpResponse(httpRequest, response, responseBody);
}

@@ -99,2 +96,11 @@ catch (error) {

}
const request = new Request(`${url}${exports.parseQuery(query)}`, requestInfo);
let response;
return timed_fetch_1.timedFetch(request, timeout, abortController)
.then(r => {
response = r;
return r.json();
})
.then(responseBody => exports.toHttpResponse(httpRequest, response, responseBody))
.catch(handleError);
}

@@ -101,0 +107,0 @@ }

{
"name": "@ideal-postcodes/core-browser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Browser javascript client for api.ideal-postcodes.co.uk",

@@ -70,3 +70,3 @@ "author": {

"@types/mocha": "~5.2.7",
"@types/node": "~12.7.8",
"@types/node": "~12.11.1",
"@types/puppeteer": "~1.20.2",

@@ -76,5 +76,5 @@ "babel-polyfill": "~6.26.0",

"codecov": "~3.6.1",
"dotenv": "~8.1.0",
"dotenv": "~8.2.0",
"eslint": "~6.5.1",
"karma": "~4.3.0",
"karma": "~4.4.0",
"karma-cbt-launcher": "~0.4.6",

@@ -81,0 +81,0 @@ "karma-chrome-launcher": "~3.1.0",

@@ -8,6 +8,6 @@ <h1 align="center">

[![CircleCI](https://circleci.com/gh/ideal-postcodes/core-browser/tree/master.svg?style=svg)](https://circleci.com/gh/ideal-postcodes/core-browser/tree/master)
[![Coverage Status](https://coveralls.io/repos/github/ideal-postcodes/core-browser/badge.svg?branch=master&t=nyUaqN)](https://coveralls.io/github/ideal-postcodes/core-browser?branch=master)
[![codecov](https://codecov.io/gh/ideal-postcodes/core-browser/branch/master/graph/badge.svg?token=bjeFUcTPi5)](https://codecov.io/gh/ideal-postcodes/core-browser)
![Dependency Status](https://david-dm.org/ideal-postcodes/core-browser.svg)
[![npm version](https://badge.fury.io/js/%40ideal-postcodes%2Fcore-browser.svg)](https://badge.fury.io/js/%40ideal-postcodes%2Fcore-browser)
[![install size](https://packagephobia.now.sh/badge?p=@ideal-postcodes/core-browser)](https://packagephobia.now.sh/result?p=@ideal-postcodes/core-browser)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/@ideal-postcodes/core-browser)

@@ -36,2 +36,4 @@ `@ideal-postcodes/core-browser` is the JavaScript browser client for api.ideal-postcodes.co.uk

- [Webpack](examples/webpack/)
- [Parcel](examples/parcel/)
- [Rollup](examples/rollup/)

@@ -144,3 +146,3 @@ ## Other JavaScript Clients

[Method options](https://core-interface.ideal-postcodes.dev/interfaces/lookupumprnoptions.html)
[Method options](https://core-interface.ideal-postcodes.dev/interfaces/lookupudprnoptions.html)

@@ -147,0 +149,0 @@ ## Test

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc