// Generated by CoffeeScript 1.6.3 var balUtil, docpadUtil, pathUtil, typeChecker; pathUtil = require('path'); typeChecker = require('typechecker'); balUtil = require('bal-util'); module.exports = docpadUtil = { getBasename: function(filename) { var basename; if (filename[0] === '.') { basename = filename.replace(/^(\.[^\.]+)\..*$/, '$1'); } else { basename = filename.replace(/\..*$/, ''); } return basename; }, getExtensions: function(filename) { var extensions; extensions = filename.split(/\./g).slice(1); return extensions; }, getExtension: function(extensions) { var extension; if (!typeChecker.isArray(extensions)) { extensions = docpadUtil.getExtensions(extensions); } if (extensions.length !== 0) { extension = extensions.slice(-1)[0] || null; } else { extension = null; } return extension; }, getDirPath: function(path) { return pathUtil.dirname(path) || ''; }, getFilename: function(path) { return pathUtil.basename(path); }, getOutFilename: function(basename, extension) { if (basename === '.' + extension) { return basename; } else { return basename + (extension ? '.' + extension || '' : void 0); } }, getUrl: function(relativePath) { return '/' + relativePath.replace(/[\\]/g, '/'); }, getSlug: function(relativeBase) { return balUtil.generateSlugSync(relativeBase); } };