express-titles
Advanced tools
Comparing version 1.0.0 to 1.0.6
20
index.js
@@ -6,17 +6,19 @@ var title = function(app){ | ||
if(app.get('suffix')==null) app.set('suffix', ''); | ||
if(app.get('ps')==null) app.set('ps', ' | '); | ||
return function (req, res, next) { | ||
if($title){ | ||
var _title = $title, title = $title; | ||
var _title = $title, title = $title, ps = app.get('ps'); | ||
if($options){ | ||
if($options.ps != null) ps = $options.ps; | ||
if($options.prefix != null){ | ||
if($options.prefix === true) title = app.get('prefix')+app.get('ps')+title; | ||
else if($options.prefix !== false) title = $options.prefix+app.get('ps')+title; | ||
} else if(app.get('prefix')) title = app.get('prefix')+app.get('ps')+title; | ||
if($options.prefix === true) title = app.get('prefix')+ps+title; | ||
else if($options.prefix !== false) title = $options.prefix+ps+title; | ||
} else if(app.get('prefix')) title = app.get('prefix')+ps+title; | ||
if($options.suffix != null){ | ||
if($options.suffix === true) title += app.get('ps')+app.get('suffix'); | ||
else if($options.suffix !== false) title += app.get('ps')+$options.suffix; | ||
} else if(app.get('suffix')) title += app.get('ps')+app.get('suffix'); | ||
if($options.suffix === true) title += ps+app.get('suffix'); | ||
else if($options.suffix !== false) title += ps+$options.suffix; | ||
} else if(app.get('suffix')) title += ps+app.get('suffix'); | ||
}else{ | ||
if(app.get('prefix')) title = app.get('prefix')+app.get('ps')+title; | ||
if(app.get('suffix')) title += app.get('ps')+app.get('suffix'); | ||
if(app.get('prefix')) title = app.get('prefix')+ps+title; | ||
if(app.get('suffix')) title += ps+app.get('suffix'); | ||
} | ||
@@ -23,0 +25,0 @@ var params = title.match(/\:(.+?)(\/|(?=\s|$))/g); |
{ | ||
"name": "express-titles", | ||
"version": "1.0.0", | ||
"description": "A simple express middleware to manage website title.", | ||
"version": "1.0.6", | ||
"description": "A simple express middleware to manage website title with prefix and suffix control.", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wvffle/express-titles.git" | ||
}, | ||
"keywords": [ | ||
@@ -7,0 +11,0 @@ "express", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4503
4
37
1
72
0