mizzkey/src/text/parse/elements/search.ts

14 lines
196 B
TypeScript
Raw Normal View History

2018-04-21 11:59:16 +02:00
/**
* Search
*/
module.exports = text => {
const match = text.match(/^(.+?) 検索(\n|$)/);
if (!match) return null;
return {
type: 'search',
content: match[0],
query: match[1]
};
};