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

u2f-api

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

u2f-api - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

28

lib/u2f-api.js
'use strict';
var coreApi = require( './google-u2f-api' );
module.exports = API;
var _global =
typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: { };
var hasNativeSupport =
( typeof window.u2f !== 'undefined' ) &&
( typeof window.u2f.sign === 'function' );
var _u2f = hasNativeSupport ? window.u2f : null;
var chromeApi = hasNativeSupport ? null : require( './google-u2f-api' );
var hasNativeSupport = _global.u2f && typeof _global.u2f.sign === 'function';
var _u2f = hasNativeSupport ? _global.u2f : coreApi;
function API( Promise )

@@ -35,3 +29,3 @@ {

var backendErrorCodes = hasNativeSupport ? _global.u2f : coreApi.ErrorCodes;
var backendErrorCodes = hasNativeSupport ? _u2f : chromeApi.ErrorCodes;
(

@@ -47,3 +41,3 @@ hasNativeSupport

]
: Object.keys( coreApi.ErrorCodes )
: Object.keys( chromeApi.ErrorCodes )
)

@@ -90,3 +84,3 @@ .forEach( function( key ) {

if ( disconnect && !hasNativeSupport )
coreApi.disconnect( );
chromeApi.disconnect( );

@@ -120,3 +114,3 @@ ret.reject( makeError( msg, { errorCode: -1 } ) );

return defer( Promise, coreApi.isSupported ).promise;
return defer( Promise, chromeApi.isSupported ).promise;
}

@@ -185,3 +179,3 @@

}
coreApi.register( registerRequests, signRequests, cb, timeout );
chromeApi.register( registerRequests, signRequests, cb, timeout );
}

@@ -229,3 +223,3 @@ } ).promise;

coreApi.sign( signRequests, cb, timeout );
chromeApi.sign( signRequests, cb, timeout );
}

@@ -232,0 +226,0 @@ } ).promise;

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "0.1.0",
"version": "0.1.1",
"author": "Gustaf Räntilä <g.rantila@gmail.com>",

@@ -8,0 +8,0 @@ "repository": {

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