Skip to content
Snippets Groups Projects
Commit e8948452 authored by Aya Morisawa's avatar Aya Morisawa Committed by syuilo
Browse files

Resolve #2629 (#2630)

parent ade7e628
No related branches found
No related tags found
No related merge requests found
......@@ -4,10 +4,7 @@ const { JSDOM } = jsdom;
import config from '../config';
import { INote } from '../models/note';
import { TextElement } from './parse';
function intersperse<T>(sep: T, xs: T[]): T[] {
return [].concat(...xs.map(x => [sep, x])).slice(1);
}
import { intersperse } from '../prelude/array';
const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers: INote['mentionedRemoteUsers']) => void } = {
bold({ document }, { bold }) {
......
......@@ -5,3 +5,7 @@ export function countIf<T>(f: (x: T) => boolean, xs: T[]): number {
export function count<T>(x: T, xs: T[]): number {
return countIf(y => x === y, xs);
}
export function intersperse<T>(sep: T, xs: T[]): T[] {
return [].concat(...xs.map(x => [sep, x])).slice(1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment