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

viki-web-utils

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viki-web-utils - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

7

dist/blocked_checker/BlockedResourceChecker.js

@@ -18,2 +18,6 @@ 'use strict';

}
if (!(fetch && Request)) {
throw new Error('BlockedResourceChecker: fetch and Request not supported on this browser');
}
}

@@ -33,3 +37,4 @@ /**

});
return fetch(request).then(function (resolve, reject) {
return fetch(request).then(function () {
return Promise.resolve({

@@ -36,0 +41,0 @@ blocked: false,

2

package.json
{
"name": "viki-web-utils",
"version": "0.0.14",
"version": "0.0.15",
"description": "Utils used by the Viki web app",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -13,2 +13,18 @@ /* eslint-env jasmine */

it('should throw an if fetch not supported', () => {
const fetch = window.fetch;
window.fetch = undefined;
expect(function () {new BlockedResourceChecker('http://viki.com');})
.toThrow(new Error('BlockedResourceChecker: fetch and Request not supported on this browser'));
window.fetch = fetch;
});
it('should throw an if Request not supported', () => {
const Request = window.Request;
window.Request = undefined;
expect(function () {new BlockedResourceChecker('http://viki.com');})
.toThrow(new Error('BlockedResourceChecker: fetch and Request not supported on this browser'));
window.Request = Request;
});
it('should throw an error when passed an invalid resource', () => {

@@ -68,3 +84,3 @@ const expectedError = new Error('BlockedResourceChecker: Please pass in valid URI for resource param');

it('promise returned should resolve with blocked: false if resource is available', (done) => {
const url = 'https://secure.quantserve.com/quant.js'
const url = 'https://secure.quantserve.com/quant.js';
this.checker = new BlockedResourceChecker(url);

@@ -71,0 +87,0 @@ const promise = this.checker.test();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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