hof 21.1.0-deindex-toggle-beta → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/deindex.js +4 -3
- package/package.json +1 -1
package/lib/deindex.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
module.exports = (app, config) => {
|
4
|
-
|
4
|
+
// Ensure the value of deIndex is evaluated as a boolean regardless of if single quotes are used
|
5
|
+
// to have the expected conditional behaviour in the Mustache template
|
6
|
+
const deIndex = (config.deIndexForm === 'true' || config.deIndexForm === true);
|
5
7
|
|
6
8
|
app.use((req, res, next) => {
|
7
|
-
|
8
9
|
// Preparing common res.locals properties
|
9
10
|
const properties = {
|
10
11
|
deIndex: deIndex
|
@@ -14,4 +15,4 @@ module.exports = (app, config) => {
|
|
14
15
|
});
|
15
16
|
|
16
17
|
return app;
|
17
|
-
}
|
18
|
+
};
|