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

ssb-uri2

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-uri2 - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

23

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decompose = exports.compose = exports.getMessageSSBURIRegex = exports.getFeedSSBURIRegex = exports.isSSBURI = exports.isExperimentalSSBURIWithAction = exports.isExperimentalSSBURI = exports.isIdentityFusionSSBURI = exports.isIdentityPOBoxSSBURI = exports.isEncryptionKeyBox2DMDiffieHellmanSSBURI = exports.isAddressSSBURI = exports.isBlobSSBURI = exports.isGabbyGroveV1MessageSSBURI = exports.isBendyButtV1MessageSSBURI = exports.isMessageSSBURI = exports.isGabbyGroveV1FeedSSBURI = exports.isBendyButtV1FeedSSBURI = exports.isFeedSSBURI = exports.toMultiserverAddress = exports.toBlobSigil = exports.toMessageSigil = exports.toFeedSigil = exports.fromMultiserverAddress = exports.fromBlobSigil = exports.fromMessageSigil = exports.fromFeedSigil = void 0;
const urlParse = require('url-parse');
const url_1 = require("url");
const Base64 = {

@@ -45,3 +45,3 @@ unsafeToSafe(input) {

return null;
const base64Data = extractBase64Data(urlParse(uri, true).pathname);
const base64Data = extractBase64Data(new url_1.URL(uri).pathname);
if (!base64Data)

@@ -55,3 +55,3 @@ return null;

return null;
const base64Data = extractBase64Data(urlParse(uri, true).pathname);
const base64Data = extractBase64Data(new url_1.URL(uri).pathname);
if (!base64Data)

@@ -63,3 +63,3 @@ return null;

function toBlobSigil(uri) {
const base64Data = extractBase64Data(urlParse(uri, true).pathname);
const base64Data = extractBase64Data(new url_1.URL(uri).pathname);
if (!base64Data)

@@ -71,3 +71,3 @@ return null;

function toMultiserverAddress(uri) {
return urlParse(uri, true).query.multiserverAddress;
return new url_1.URL(uri).searchParams.get('multiserverAddress');
}

@@ -82,3 +82,3 @@ exports.toMultiserverAddress = toMultiserverAddress;

uri.startsWith(`ssb://${type}/${format}/`)) &&
!!extractBase64Data(urlParse(uri, true).pathname));
!!extractBase64Data(new url_1.URL(uri).pathname));
}

@@ -114,3 +114,2 @@ function isFeedSSBURI(uri) {

function isAddressSSBURI(uri) {
var _a;
if (!uri)

@@ -121,3 +120,3 @@ return false;

uri.startsWith('ssb://address/multiserver')) &&
!!((_a = urlParse(uri, true).query) === null || _a === void 0 ? void 0 : _a.multiserverAddress));
!!new url_1.URL(uri).searchParams.get('multiserverAddress'));
}

@@ -145,4 +144,6 @@ exports.isAddressSSBURI = isAddressSSBURI;

return (uri) => {
var _a;
return (isExperimentalSSBURI(uri) && ((_a = urlParse(uri, true).query) === null || _a === void 0 ? void 0 : _a.action) === action);
if (!uri)
return false;
return (isExperimentalSSBURI(uri) &&
new url_1.URL(uri).searchParams.get('action') === action);
};

@@ -249,3 +250,3 @@ }

function decompose(uri) {
const pathname = urlParse(uri, true).pathname;
const pathname = new url_1.URL(uri).pathname;
if (!pathname) {

@@ -252,0 +253,0 @@ throw new Error('Invalid SSB URI: ' + uri);

{
"name": "ssb-uri2",
"version": "1.7.0",
"version": "1.7.1",
"description": "Utilities for recognizing and converting SSB URIs",

@@ -24,4 +24,3 @@ "repository": {

"dependencies": {
"ssb-typescript": "^2.5.0",
"url-parse": "^1.5.3"
"ssb-typescript": "^2.5.0"
},

@@ -28,0 +27,0 @@ "devDependencies": {

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