From 1e337d45f4266630d1f60f796163fabcc420913f Mon Sep 17 00:00:00 2001 From: arve0 Date: Sun, 20 May 2018 13:56:43 +0200 Subject: [PATCH] rename to plural, hasDelimiters --- patterns.js | 18 +++++++++--------- utils.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/patterns.js b/patterns.js index 2d1906c..a389003 100644 --- a/patterns.js +++ b/patterns.js @@ -19,7 +19,7 @@ module.exports = options => ([ { shift: 0, block: true, - info: utils.hasDelimiter('end', options) + info: utils.hasDelimiters('end', options) } ], transform: (tokens, i) => { @@ -48,7 +48,7 @@ module.exports = options => ([ }, { shift: 0, type: 'text', - content: utils.hasDelimiter('start', options) + content: utils.hasDelimiters('start', options) } ] } @@ -85,7 +85,7 @@ module.exports = options => ([ }, { shift: 2, type: 'inline', - content: utils.hasDelimiter('only', options) + content: utils.hasDelimiters('only', options) } ], transform: (tokens, i) => { @@ -113,7 +113,7 @@ module.exports = options => ([ }, { shift: 0, type: 'text', - content: utils.hasDelimiter('start', options) + content: utils.hasDelimiters('start', options) } ] } @@ -145,7 +145,7 @@ module.exports = options => ([ type: 'softbreak' }, { position: -1, - content: utils.hasDelimiter('only', options) + content: utils.hasDelimiters('only', options) } ] } @@ -184,7 +184,7 @@ module.exports = options => ([ }, { shift: 2, type: 'inline', - content: utils.hasDelimiter('only', options), + content: utils.hasDelimiters('only', options), children: (arr) => arr.length === 1 }, { shift: 3, @@ -214,7 +214,7 @@ module.exports = options => ([ children: [ { position: -1, - content: utils.hasDelimiter('end', options) + content: utils.hasDelimiters('end', options) } ] } @@ -245,7 +245,7 @@ module.exports = options => ([ }, { position: -1, type: 'text', - content: utils.hasDelimiter('only', options) + content: utils.hasDelimiters('only', options) } ] } @@ -272,7 +272,7 @@ module.exports = options => ([ children: [ { position: -1, - content: utils.hasDelimiter('end', options), + content: utils.hasDelimiters('end', options), type: (t) => t !== 'code_inline' } ] diff --git a/utils.js b/utils.js index 9b7ba46..770b11d 100644 --- a/utils.js +++ b/utils.js @@ -124,7 +124,7 @@ exports.addAttrs = function (attrs, token) { * @param {string} where to expect {} curly. start, middle, end or only. * @return {function(string)} Function which testes if string has curly. */ -exports.hasDelimiter = function (where, options) { +exports.hasDelimiters = function (where, options) { if (!where) { throw new Error('Parameter `where` not passed. Should be "start", "middle", "end" or "only".');