New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uport-core

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uport-core - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

11

lib/message/util.js

@@ -56,3 +56,5 @@ 'use strict';

var getUrlQueryParams = function getUrlQueryParams(url) {
return url.match(/[^&?]*?=[^&?]*/g).map(function (param) {
var params = url.match(/[^&?]*?=[^&?]*/g);
if (!params) return {};
return params.map(function (param) {
return param.split('=');

@@ -65,4 +67,9 @@ }).reduce(function (params, param) {

var getURLJWT = function getURLJWT(url) {
return url.replace(/https:\/\/id.uport.me\/req\//, '').replace(/(\#|\?)(.*)/, '');
};
exports.paramsToUrlFragment = paramsToUrlFragment;
exports.paramsToQueryString = paramsToQueryString;
exports.getUrlQueryParams = getUrlQueryParams;
exports.getUrlQueryParams = getUrlQueryParams;
exports.getURLJWT = getURLJWT;

2

lib/transport/chasqui.js

@@ -109,3 +109,3 @@ 'use strict';

var getCallback = function getCallback(uri) {
return (0, _didJwt.decodeJWT)((0, _util.getUrlQueryParams)(uri)['requestToken']).payload.callback;
return (0, _didJwt.decodeJWT)((0, _util.getURLJWT)(uri)).payload.callback;
};

@@ -112,0 +112,0 @@

{
"name": "uport-core",
"version": "0.0.23",
"version": "0.0.24",
"description": "",

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

@@ -39,10 +39,15 @@ /**

*/
const getUrlQueryParams = (url) => (
url.match(/[^&?]*?=[^&?]*/g)
.map((param) => param.split('='))
.reduce((params, param) => {
params[param[0]] = param[1]
return params
}, {}))
const getUrlQueryParams = (url) => {
const params = url.match(/[^&?]*?=[^&?]*/g)
if (!params) return {}
return params.map((param) => param.split('='))
.reduce((params, param) => {
params[param[0]] = param[1]
return params
}, {})
}
export { paramsToUrlFragment, paramsToQueryString, getUrlQueryParams }
const getURLJWT = (url) => url.replace(/https:\/\/id.uport.me\/req\//, '').replace(/(\#|\?)(.*)/, '')
export { paramsToUrlFragment, paramsToQueryString, getUrlQueryParams, getURLJWT }

@@ -1,2 +0,2 @@

import { paramsToQueryString, getUrlQueryParams } from './../message/util.js'
import { paramsToQueryString, getURLJWT } from './../message/util.js'
import { randomString } from './../crypto/index.js'

@@ -68,3 +68,3 @@ import generalPoll from './poll.js'

const isChasquiCallback = (uri) => new RegExp(CHASQUI_URL).test(getCallback(uri))
const getCallback = (uri) => decodeJWT(getUrlQueryParams(uri)['requestToken']).payload.callback
const getCallback = (uri) => decodeJWT(getURLJWT(uri)).payload.callback

@@ -71,0 +71,0 @@ export { URIHandlerSend,

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