mirror of
https://github.com/sim1222/misskey.git
synced 2025-07-01 00:09:58 +09:00
wip
This commit is contained in:
@ -10,9 +10,9 @@ module.exports = function(src) {
|
||||
const search = options.search;
|
||||
const g = search[search.length - 1] == 'g';
|
||||
const file = this.resourcePath.replace(/\\/g, '/');
|
||||
const replace = global[options.replace].bind(null, {
|
||||
const replace = options.i18n ? global[options.replace].bind(null, {
|
||||
src: file
|
||||
});
|
||||
}) : global[options.replace];
|
||||
if (typeof search != 'string' || search.length == 0) console.error('invalid search');
|
||||
if (typeof replace != 'function') console.error('invalid replacer:', replace, this.request);
|
||||
src = src.replace(new RegExp(trim(search, g), g ? 'g' : ''), replace);
|
||||
|
Reference in New Issue
Block a user