New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle situation when prev and next orders are empty; fix#225 #226
Changes from 1 commit
File filter...
Jump to…
fixed codereview notices and CI report
- Loading branch information
| @@ -44,16 +44,18 @@ const getPrevOrderFromNextOrder = (lastNumber, order) => { | ||
| * Returns current bookmark order based on previous and next bookmark order. | ||
| * @param {String} prevOrder | ||
| * @param {String} nextOrder | ||
|
||
| * @param {String} parentOrder | ||
| * @returns {String} | ||
| */ | ||
| module.exports.getBookmarkOrder = (prevOrder, nextOrder, parentOrder) => { | ||
| let prevOrderSplit = prevOrder.split('.') | ||
| let nextOrderSplit = nextOrder.split('.') | ||
|
|
||
| if (prevOrderSplit.length === 1 && nextOrderSplit.length === 1) { | ||
| if (!parentOrder) { | ||
bridiver
Contributor
|
||
| throw new Error(`Invalid previous and next orders: ${prevOrderSplit}, ${nextOrderSplit} and ${parentOrder}`) | ||
| throw new Error(`Invalid previous, next and parent orders: ${prevOrderSplit}, ${nextOrderSplit} and ${parentOrder}`) | ||
| } else { | ||
| return parentOrder + '.1'; | ||
| return parentOrder + '.1' | ||
| } | ||
| } | ||
| let order = '' | ||
please document parentOrder in these comments (using jsdoc)