UNPKG

livescript

Version:

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming,

20 lines 498 B
// Generated by LiveScript 1.6.0 var path, stripString, nameFromPath; path = require('path'); stripString = function(val){ var that; if (that = /^['"](.*)['"]$/.exec(val.trim())) { return that[1]; } else { return val; } }; nameFromPath = function(modulePath){ return path.basename(stripString(modulePath)).split('.')[0].replace(/-[a-z]/ig, function(it){ return it.charAt(1).toUpperCase(); }); }; module.exports = { nameFromPath: nameFromPath, stripString: stripString };