mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
1ad7a91f4d
refs #6301 - In the migration folder, commands.js changed to builder.js to resolve conflict with the 'commands' inside data/utils/clients/. - a new data/schema/ folder has been added to hold all the code related to the database schema - data/utils/clients have been moved to data/schema/clients - data/utils/index.js has become data/schema/commands.js - data/schema.js has been split, the definition of the DB schema stays put, the additional checks have moved to data/schema/checks.js - data/validation/index.js has become data/schema/versioning.js - data/fixtures has moved to data/migration/fixtures - data/default-settings.json has moved to data/schema/default-settings.json
27 lines
872 B
JavaScript
27 lines
872 B
JavaScript
function isPost(jsonData) {
|
|
return jsonData.hasOwnProperty('html') && jsonData.hasOwnProperty('markdown') &&
|
|
jsonData.hasOwnProperty('title') && jsonData.hasOwnProperty('slug');
|
|
}
|
|
|
|
function isTag(jsonData) {
|
|
return jsonData.hasOwnProperty('name') && jsonData.hasOwnProperty('slug') &&
|
|
jsonData.hasOwnProperty('description') && jsonData.hasOwnProperty('parent');
|
|
}
|
|
|
|
function isUser(jsonData) {
|
|
return jsonData.hasOwnProperty('bio') && jsonData.hasOwnProperty('website') &&
|
|
jsonData.hasOwnProperty('status') && jsonData.hasOwnProperty('location');
|
|
}
|
|
|
|
function isNav(jsonData) {
|
|
return jsonData.hasOwnProperty('label') && jsonData.hasOwnProperty('url') &&
|
|
jsonData.hasOwnProperty('slug') && jsonData.hasOwnProperty('current');
|
|
}
|
|
|
|
module.exports = {
|
|
isPost: isPost,
|
|
isTag: isTag,
|
|
isUser: isUser,
|
|
isNav: isNav
|
|
};
|