motto and otto for nodejs module syntax in custom filters
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Sebastian Frank
2019-03-02 14:45:08 +01:00
parent 8e84901465
commit 6e3688d713
6 changed files with 27 additions and 11 deletions

View File

@@ -1,3 +1,5 @@
var strings = require('./lib/strings');
function datum(str, param) {
if (!param) {
param = "$3.$2.$1";
@@ -7,7 +9,8 @@ function datum(str, param) {
this.context.Meta.Title ist hier z.B. möglich
*/
return str.replace(/^([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+).*/, param)
return strings.replace(str, /^([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+).*/, param)
// return str.replace(/^([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+).*/, param)
}
datum;
module.exports = datum;

View File

@@ -0,0 +1,5 @@
module.exports = {
replace: function (str, regex, replace) {
return str.replace(regex, replace);
}
}