summaryrefslogtreecommitdiffstats
path: root/lib/templating/listShortcuts.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-09-05 11:04:18 +0200
committerSamy Pessé <samypesse@gmail.com>2016-09-05 11:04:18 +0200
commita14ca3e268e95a7eab59fb205b41da7331d57631 (patch)
tree9c84b2cbd561345335fca3e26af961b2ea23d8ec /lib/templating/listShortcuts.js
parent9c071dade573aa6990878006f83c89b6065a1395 (diff)
downloadgitbook-a14ca3e268e95a7eab59fb205b41da7331d57631.zip
gitbook-a14ca3e268e95a7eab59fb205b41da7331d57631.tar.gz
gitbook-a14ca3e268e95a7eab59fb205b41da7331d57631.tar.bz2
Switch to lerna
Diffstat (limited to 'lib/templating/listShortcuts.js')
-rw-r--r--lib/templating/listShortcuts.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/templating/listShortcuts.js b/lib/templating/listShortcuts.js
deleted file mode 100644
index 8d0a64a..0000000
--- a/lib/templating/listShortcuts.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var Immutable = require('immutable');
-var parsers = require('../parsers');
-
-/**
- * Return a list of all shortcuts that can apply
- * to a file for a TemplatEngine
- *
- * @param {List<TemplateBlock>} engine
- * @param {String} filePath
- * @return {List<TemplateShortcut>}
- */
-function listShortcuts(blocks, filePath) {
- var parser = parsers.getForFile(filePath);
-
- if (!parser) {
- return Immutable.List();
- }
-
- return blocks
- .map(function(block) {
- return block.getShortcuts();
- })
- .filter(function(shortcuts) {
- return (
- shortcuts &&
- shortcuts.acceptParser(parser.getName())
- );
- });
-}
-
-module.exports = listShortcuts;