Files
NapCatQQ/.pnpm-store/v3/files/4f/7998774f5890de3d8278cb7a2b702eb4c1b8c3d15b84df2a865dce04ae94c6884c7bbe1ec6221af9b10406be1a9952ad8d04242adb077c32ce3208d7cddd89
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
836 B
Plaintext

interface CompileResult {
pattern: string;
tokens: string[];
}
/**
* Compile a format string into a regular expression and extract date parts.
* 编译格式字符串,生成正则表达式和匹配的日期部分
*
* @param formatString - The format string to compile. (要编译的格式字符串。)
* @returns A compiled result object containing the regular expression pattern and extracted date parts.
* (包含正则表达式模式的编译结果对象,以及提取的日期部分。)
* @example
* ```ts
* compile('YYYY-MM-DD HH:mm:ss.SSS');
* // {
* // pattern: '(\\d{1,4})-(\\d{1,2})-(\\d{1,2}) (\\d{1,2}):(\\d{1,2}):(\\d{1,2})\\.(\\d{1,3})',
* // tokens: ['YYYY', 'MM', 'DD','HH', 'mm', 'ss', 'SSS']
* // }
* ```
*/
export default function compile(formatString: string): CompileResult;
export {};