mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 12:39:59 +01:00
Use arrow function
This commit is contained in:
parent
c31e1c7e37
commit
ef71cf483b
@ -3,20 +3,19 @@ const nyaize = require('nyaize').default;
|
|||||||
const emojinize = require('emojinize');
|
const emojinize = require('emojinize');
|
||||||
const CONFIG = require('./config');
|
const CONFIG = require('./config');
|
||||||
|
|
||||||
const escape = function(text) {
|
const escape = text =>
|
||||||
return text
|
text
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
.replace(/</g, '<');
|
.replace(/</g, '<');
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = function(tokens, shouldBreak) {
|
module.exports = (tokens, shouldBreak) => {
|
||||||
if (shouldBreak == null) {
|
if (shouldBreak == null) {
|
||||||
shouldBreak = true;
|
shouldBreak = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const me = riot.mixin('i').me;
|
const me = riot.mixin('i').me;
|
||||||
|
|
||||||
let text = tokens.map(function(token) {
|
let text = tokens.map(token => {
|
||||||
switch (token.type) {
|
switch (token.type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
return escape(token.content)
|
return escape(token.content)
|
||||||
@ -45,4 +44,4 @@ module.exports = function(tokens, shouldBreak) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user