Skip to content

Commit 60cd97d

Browse files
committed
Add editArticleRef() summary modifier
1 parent 646b616 commit 60cd97d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var mergeAtLevel = require('./mergeAtLevel');
2+
3+
/**
4+
Edit ref of an article
5+
6+
@param {Summary} summary
7+
@param {String} level
8+
@param {String} newRef
9+
@return {Summary}
10+
*/
11+
function editArticleRef(summary, level, newRef) {
12+
return mergeAtLevel(summary, level, {
13+
ref: newRef
14+
});
15+
}
16+
17+
module.exports = editArticleRef;

lib/modifiers/summary/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ module.exports = {
55
unshiftArticle: require('./unshiftArticle'),
66

77
editPartTitle: require('./editPartTitle'),
8-
editArticleTitle: require('./editArticleTitle')
8+
editArticleTitle: require('./editArticleTitle'),
9+
editArticleRef: require('./editArticleRef')
910
};

0 commit comments

Comments
 (0)