@accordproject/concerto-metamodel
Advanced tools
Comparing version 1.2.2-20220311171354 to 1.2.2-20220315163947
@@ -377,2 +377,38 @@ /* | ||
module.exports = { metaModelAst, metaModelCto, resolveLocalNames, resolveLocalNamesForAll }; | ||
/** | ||
* Return the fully qualified name for an import | ||
* @param {object} imp - the import | ||
* @return {string} - the fully qualified name for that import | ||
* @private | ||
*/ | ||
function importFullyQualifiedName(imp) { | ||
return imp.$class === 'concerto.metamodel.ImportAll' ? `${imp.namespace}.*` : `${imp.namespace}.${imp.name}`; | ||
} | ||
/** | ||
* Returns an object that maps from the import declarations to the URIs specified | ||
* @param {*} ast - the model ast | ||
* @return {Object} keys are import declarations, values are URIs | ||
* @private | ||
*/ | ||
function getExternalImports(ast) { | ||
const uriMap = {}; | ||
if (ast.imports) { | ||
ast.imports.forEach((imp) => { | ||
const fqn = importFullyQualifiedName(imp); | ||
if(imp.uri) { | ||
uriMap[fqn] = imp.uri; | ||
} | ||
}); | ||
} | ||
return uriMap; | ||
} | ||
module.exports = { | ||
metaModelAst, | ||
metaModelCto, | ||
resolveLocalNames, | ||
resolveLocalNamesForAll, | ||
importFullyQualifiedName, | ||
getExternalImports, | ||
}; |
{ | ||
"name": "@accordproject/concerto-metamodel", | ||
"version": "1.2.2-20220311171354", | ||
"version": "1.2.2-20220315163947", | ||
"description": "Concerto metamodel utilities", | ||
@@ -51,3 +51,3 @@ "homepage": "https://github.com/accordproject/concerto", | ||
"dependencies": { | ||
"@accordproject/concerto-util": "1.2.2-20220311171354" | ||
"@accordproject/concerto-util": "1.2.2-20220315163947" | ||
}, | ||
@@ -54,0 +54,0 @@ "browserslist": "> 0.25%, not dead", |
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
57007
410
+ Added@accordproject/concerto-util@1.2.2-20220315163947(transitive)
- Removed@accordproject/concerto-util@1.2.2-20220311171354(transitive)