jhipster-core
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -60,4 +60,3 @@ 'use strict'; | ||
return { | ||
fields: {}, | ||
comment: null | ||
fields: {} | ||
}; | ||
@@ -64,0 +63,0 @@ } |
@@ -67,5 +67,4 @@ 'use strict'; | ||
return { | ||
comment: '', | ||
validations: {} | ||
}; | ||
} |
@@ -11,3 +11,4 @@ 'use strict'; | ||
module.exports = { | ||
exportToJSON: exportToJSON | ||
exportToJSON: exportToJSON, | ||
createJHipsterJSONFolder: createJHipsterJSONFolder | ||
}; | ||
@@ -21,5 +22,3 @@ | ||
} | ||
if (!fs.statSync('./.jhipster').isFile()) { | ||
fs.mkdirSync('.jhipster'); | ||
} | ||
createJHipsterJSONFolder(); | ||
let filteredEntities = filterOutUnchangedEntities(entities); | ||
@@ -32,7 +31,18 @@ for (let i = 0, entityNames = Object.keys(filteredEntities); i < entityNames.length; i++) { | ||
function createJHipsterJSONFolder() { | ||
try { | ||
if (!fs.statSync('./.jhipster').isDirectory()) { | ||
fs.mkdirSync('.jhipster'); | ||
} | ||
} catch (error) { | ||
fs.mkdirSync('.jhipster'); | ||
} | ||
} | ||
function filterOutUnchangedEntities(entities) { | ||
var filtered = {}; | ||
for (let i = 0, entityNames = Object.keys(entities); i < entityNames.length; i++) { | ||
if (!areJHipsterEntitiesEqual(readEntityJSON(toFilePath(entityNames[i])), entities[entityNames[i]])) { | ||
filtered[entityNames[i]].push(entities[entityNames[i]]); | ||
let filePath = toFilePath(entityNames[i]); | ||
if (!(fs.existsSync(filePath) && areJHipsterEntitiesEqual(readEntityJSON(filePath), entities[entityNames[i]]))) { | ||
filtered[entityNames[i]] = (entities[entityNames[i]]); | ||
} | ||
@@ -39,0 +49,0 @@ } |
@@ -137,2 +137,3 @@ 'use strict'; | ||
if (jdlObject.enums[jdlField.type]) { | ||
fieldData.fieldType = jdlField.type; | ||
fieldData.fieldValues = jdlObject.enums[jdlField.type].values.join(','); | ||
@@ -139,0 +140,0 @@ } |
@@ -15,3 +15,3 @@ 'use strict'; | ||
if (!comment) { | ||
return comment; | ||
return undefined; | ||
} | ||
@@ -58,2 +58,2 @@ var parts = comment.trim().split('\n'); | ||
return `${year}${month}${day}${hour}${minute}${second}`; | ||
} | ||
} |
@@ -71,3 +71,5 @@ 'use strict'; | ||
return Object.keys(field).every(function(key) { | ||
return field[key] === secondEntityField[key]; | ||
if (field[key].constructor === Array) | ||
return field[key].toString() === secondEntityField[key].toString(); | ||
else return field[key] === secondEntityField[key]; | ||
}); | ||
@@ -74,0 +76,0 @@ }); |
@@ -22,2 +22,5 @@ 'use strict'; | ||
exportToJSON = require('../lib/export/json_exporter').exportToJSON, | ||
createJHipsterJSONFolder = require('../lib/export/json_exporter').createJHipsterJSONFolder, | ||
toFilePath = require('../lib/reader/json_file_reader').toFilePath, | ||
readEntityJSON = require('../lib/reader/json_file_reader').readEntityJSON, | ||
ObjectUtils = require('../lib/utils/object_utils'), | ||
@@ -56,4 +59,7 @@ Set = require('../lib/utils/objects/set'); | ||
ObjectUtils: ObjectUtils, | ||
createJHipsterJSONFolder: createJHipsterJSONFolder, | ||
readEntityJSON: readEntityJSON, | ||
toFilePath: toFilePath, | ||
/* Objects */ | ||
Set: Set | ||
}; |
{ | ||
"name": "jhipster-core", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "JHipster's own domain language and core objects", | ||
@@ -5,0 +5,0 @@ "main": "module/index.js", |
@@ -80,3 +80,4 @@ 'use strict'; | ||
startDate: new JDLField({name: 'startDate', type: FieldTypes.ZONED_DATE_TIME}), | ||
endDate: new JDLField({name: 'endDate', type: FieldTypes.ZONED_DATE_TIME}) | ||
endDate: new JDLField({name: 'endDate', type: FieldTypes.ZONED_DATE_TIME}), | ||
language: new JDLField({name: 'language', type: 'Language'}) | ||
}, | ||
@@ -83,0 +84,0 @@ comment: 'JobHistory comment.' |
Sorry, the diff of this file is not supported yet
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
380921
75
10443
7