Skip to content

Commit

Permalink
chore: added linting fix
Browse files Browse the repository at this point in the history
Signed-off-by: Muskan Bararia <muskan.b@docusign.com>
  • Loading branch information
Muskan Bararia committed Nov 14, 2023
1 parent 079f3a5 commit d86d203
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/concerto-core/lib/decoratorextractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@ class DecoratorExtractor {
transformVocabularyDecorators(vocabObject, namespace, vocabData){
if (Object.keys(vocabObject).length > 0 ){
let strVoc = '';
strVoc = strVoc+`locale: ${this.locale}\n`;
strVoc = strVoc+`namespace: ${namespace}\n`;
strVoc = strVoc+'declarations:\n';
strVoc = strVoc + `locale: ${this.locale}\n`;
strVoc = strVoc + `namespace: ${namespace}\n`;
strVoc = strVoc + 'declarations:\n';
Object.keys(vocabObject).forEach(decl =>{
if (vocabObject[decl].term){
strVoc += ` - ${decl}: ${vocabObject[decl].term}\n`;
const otherProps = Object.keys(vocabObject[decl]).filter((str)=>str!=='term' && str!=='propertyVocabs');
const otherProps = Object.keys(vocabObject[decl]).filter((str)=>str !== 'term' && str !== 'propertyVocabs');
otherProps.forEach(key =>{
strVoc += ` ${key}: ${vocabObject[decl][key]}\n`;
});
}
if (vocabObject[decl].propertyVocabs && Object.keys(vocabObject[decl].propertyVocabs).length>0){
if (vocabObject[decl].propertyVocabs && Object.keys(vocabObject[decl].propertyVocabs).length > 0){
if (!vocabObject[decl].term){
strVoc += ` - ${decl}: ${decl}\n`;
}
strVoc += ' properties:\n';
Object.keys(vocabObject[decl].propertyVocabs).forEach(prop =>{
strVoc += ` - ${prop}: ${vocabObject[decl].propertyVocabs[prop].term}\n`;
const otherProps = Object.keys(vocabObject[decl].propertyVocabs[prop]).filter((str)=>str!=='term');
const otherProps = Object.keys(vocabObject[decl].propertyVocabs[prop]).filter((str)=>str !== 'term');
otherProps.forEach(key =>{
strVoc += ` ${key}: ${vocabObject[decl].propertyVocabs[prop][key]}\n`;
});
Expand All @@ -135,17 +135,17 @@ class DecoratorExtractor {
* @private
*/
constructTarget(namespace, obj){
const target ={
const target = {
'$class': `org.accordproject.decoratorcommands@${this.dcs_version}.CommandTarget`,
'namespace':namespace
};
if (obj.declaration && obj.declaration!==''){
if (obj.declaration && obj.declaration !== ''){
target.declaration = obj.declaration;
}
if (obj.property && obj.property!==''){
if (obj.property && obj.property !== ''){
target.property = obj.property;
}
if (obj.mapElement && obj.mapElement!==''){
if (obj.mapElement && obj.mapElement !== ''){
target.mapElement = obj.mapElement;
}
return target;
Expand Down Expand Up @@ -236,7 +236,7 @@ class DecoratorExtractor {
if (dcs.name !== 'Term' && !patternToDetermineVocab.test(dcs.name)){
dcsObjects = this.parseNonVocabularyDecorators(dcsObjects, dcs, this.dcs_version, target);
}
else{
else {
vocabObject = this.parseVocabularies(vocabObject, obj, dcs);
}
});
Expand Down Expand Up @@ -296,7 +296,7 @@ class DecoratorExtractor {
* @private
*/
processProperties(sourceProperties, declarationName, namespace){
const processedProperties=sourceProperties.map(property => {
const processedProperties = sourceProperties.map(property => {
if (property.decorators){
const constructOptions = {
declaration: declarationName,
Expand Down

0 comments on commit d86d203

Please sign in to comment.