Initial commit
This commit is contained in:
0
theme/helpers/.gitkeep
Normal file
0
theme/helpers/.gitkeep
Normal file
6
theme/helpers/aspect.js
Normal file
6
theme/helpers/aspect.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = (width, height) => {
|
||||
if (width <0 || !width || height < 0 || !height) {
|
||||
return null;
|
||||
}
|
||||
return width/height;
|
||||
};
|
||||
6
theme/helpers/multiply.js
Normal file
6
theme/helpers/multiply.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = (a, b) => {
|
||||
if (isNaN(a) || isNaN(b)) {
|
||||
return null;
|
||||
}
|
||||
return a * b;
|
||||
};
|
||||
9
theme/helpers/remove_extension.js
Normal file
9
theme/helpers/remove_extension.js
Normal file
@@ -0,0 +1,9 @@
|
||||
module.exports = (filename) => {
|
||||
let dot = filename.lastIndexOf(".");
|
||||
|
||||
if (dot < 0) {
|
||||
return filename;
|
||||
}
|
||||
|
||||
return filename.substring(0, dot);
|
||||
};
|
||||
Reference in New Issue
Block a user