Socket
Socket
Sign inDemoInstall

jskos-tools

Package Overview
Dependencies
0
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.21 to 1.0.22

19

lib/tools.js

@@ -119,9 +119,4 @@ const _ = require("./utils")

/**
* Returns all possible URIs for a JSKOS object. Takes into consideration both the uri and identifier properties, as well as different variants of those identifiers.
* Returns all possible URIs for a JSKOS object. Takes into consideration both the uri and identifier properties.
*
* Variants:
* - http vs. https
* - with trailing slash vs. without trailing slash
* - /en/ vs. /de/
*
* @memberof module:jskos-tools

@@ -132,8 +127,3 @@ * @param {object} object

if (!object) return []
let uris = (object.uri ? [object.uri] : []).concat(object.identifier || [])
// Generate several variants of URIs to work around inconsistencies
uris = uris.concat(uris.map(uri => uri.startsWith("https") ? uri.replace("https", "http") : uri.replace("http", "https")))
uris = uris.concat(uris.map(uri => uri.endsWith("/") ? uri.substring(0, uri.length - 1) : uri + "/"))
uris = uris.concat(uris.map(uri => uri.indexOf("/en/") != -1 ? uri.replace("/en/", "/de/") : uri.replace("/de/", "/en/")))
return [...new Set(uris)]
return (object.uri ? [object.uri] : []).concat(object.identifier || [])
}

@@ -154,4 +144,5 @@

// Compare URIs for objects.
let object1uris = getAllUris(object1)
let object2uris = getAllUris(object2)
const replaceUri = uri => uri.replace("http://").replace("https://")
let object1uris = getAllUris(object1).map(replaceUri)
let object2uris = getAllUris(object2).map(replaceUri)
if (_.intersection(object1uris, object2uris).length > 0) {

@@ -158,0 +149,0 @@ return true

{
"name": "jskos-tools",
"version": "1.0.21",
"version": "1.0.22",
"description": "Tools for working with the JSKOS data format.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/gbv/jskos-tools",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc