yumechi-no-kuni/src/text/parse/elements/search.ts

14 lines
196 B
TypeScript
Raw Normal View History

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