3 * Express - view - Partial
4 * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
15 * Resolve partial object name from the view path.
19 * "user.ejs" becomes "user"
20 * "forum thread.ejs" becomes "forumThread"
21 * "forum/thread/post.ejs" becomes "post"
22 * "blog-post.ejs" becomes "blogPost"
28 exports.resolveObjectName = function(view){
29 return cache[view] || (cache[view] = view
34 .replace(/[^a-zA-Z0-9 ]+/g, ' ')
35 .split(/ +/).map(function(word, i){
37 ? word[0].toUpperCase() + word.substr(1)