Comparing version 1.7.0 to 1.7.1
"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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
295
25244
- Removedurl-parse@^1.5.3
- Removedquerystringify@2.2.0(transitive)
- Removedrequires-port@1.0.0(transitive)
- Removedurl-parse@1.5.10(transitive)