mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
3e60941054
refs #8275 - Adds support for `formats` param - Returns `html` by default - Can optionally return other formats by providing a comma-separated list
27 lines
833 B
JavaScript
27 lines
833 B
JavaScript
function isPost(jsonData) {
|
|
return jsonData.hasOwnProperty('html') &&
|
|
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
|
|
};
|