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

curie-util-es5

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curie-util-es5 - npm Package Compare versions

Comparing version 1.0.0 to 1.2.0

26

curie-util.js

@@ -5,6 +5,2 @@

//=======================================================================

@@ -48,5 +44,10 @@ //

//
// Utility function to convert CURIE <-> IRI
// Utility Class to convert CURIE <-> IRI
//
//=======================================================================
/**
*
* @param {*} mapping A Bidirectional Map of CURIE <-> IRI created through parseContext(context.jsonld)
*/
function CurieUtil(mapping) {

@@ -69,2 +70,6 @@ this.trie = new Trie();

/**
* Return the CURIE associated to the given IRI if any exists. Return null otherwise
* @param {*} iri The IRI of an entity (e.g. http://identifiers.org/zfin/ZDB-GENE-031112-7, http://identifiers.org/mgi/MGI:34340)
*/
CurieUtil.prototype.getCurie = function(iri) {

@@ -80,2 +85,6 @@ var prefix = this.trie.getMatchingPrefix(iri);

/**
* Return the IRI associated to the given CURIE if any exists. Return null otherwise
* @param {*} curie The CURIE of an entity (e.g. ZFIN:ZDB-GENE-031112-7, MGI:MGI:34340)
*/
CurieUtil.prototype.getIri = function(curie) {

@@ -100,2 +109,6 @@ if(!curie)

/**
* Returns a BiDirectional Map of the @context of a JSON-LD file
* @param {} jsonObject A JSON-LD file with a @context field
*/
function parseContext(jsonObject) {

@@ -115,2 +128,3 @@ try {

module.exports.parseContext = parseContext;
module.exports.CurieUtil = CurieUtil;
{
"name": "curie-util-es5",
"version": "1.0.0",
"version": "1.2.0",
"description": "Javascript Library to Translate CURIEs to IRIs and vice versa. ES5 Version.",

@@ -5,0 +5,0 @@ "main": "curie-util.js",

# curie-util-js
Javascript utility library to translate CURIEs to IRIs and vice versa.
Javascript Library to translate CURIEs to IRIs and vice versa.
ES5 Version based on the Java Implementation: https://github.com/prefixcommons/curie-util

@@ -4,0 +4,0 @@

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