-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add comments to exported members of utils.js
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,32 @@ | ||
/** | ||
* "Kind" of the navigation post. | ||
* | ||
* @type {string} | ||
*/ | ||
export const KIND = 'root'; | ||
|
||
/** | ||
* "post type" of the navigation post. | ||
* | ||
* @type {string} | ||
*/ | ||
export const POST_TYPE = 'postType'; | ||
|
||
/** | ||
* Builds an ID for a new navigation post. | ||
* | ||
* @param {number} menuId Menu id. | ||
* @return {string} An ID. | ||
*/ | ||
export const buildNavigationPostId = ( menuId ) => | ||
`navigation-post-${ menuId }`; | ||
|
||
/** | ||
* Builds a query to resolve menu items. | ||
* | ||
* @param {number} menuId Menu id. | ||
* @return {Object} Query. | ||
*/ | ||
export function menuItemsQuery( menuId ) { | ||
return { menus: menuId, per_page: -1 }; | ||
} |