cmvr-wms/mobile-app/src/core/update-notes.ts
lixiaolong 6b43b0104f feat(app): 优化移动端应用配置和功能实现
- 添加生产环境服务器地址配置支持内外网切换
- 实现采购列表只看我创建的功能开关
- 更新构建脚本中的默认生产环境API地址
- 优化采购单表格单元格编辑体验改用自动补全组件
- 调整应用更新检查逻辑增强生产环境兼容性
- 修复开发服务器切换时的一些验证问题
- 增强应用启动时的服务地址配置灵活性
2026-10-30 15:02:54 +08:00

12 lines
911 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** Accept existing plain-text release notes as well as signed update bullet lists. */
export function updateNotes(value:unknown):string[]{
const source=typeof value==='string'?value:Array.isArray(value)?value.filter((v):v is string=>typeof v==='string').join('\n'):'';
const lines=source.slice(0,8000).replace(/(^|[\s;;。])(?:\d{1,2}[、..))](?!\d)|[•●▪·*])\s*/g,'$1\n').replace(/。(?=\S)/g,'。\n').split(/[\r\n;;]+/);
return [...new Set(lines.map(line=>line.replace(/^\s*[-—]\s+/,'').trim()).filter(line=>line&&!/^(?:本次更新|更新说明|更新内容)[::]?$/.test(line)))].slice(0,20);
}
export function manifestUpdateNotes(manifest:unknown):string[]{
if(!manifest||typeof manifest!=='object')return[];
const metadata=(manifest as {metadata?:unknown}).metadata;
return metadata&&typeof metadata==='object'?updateNotes((metadata as {releaseNotes?:unknown}).releaseNotes):[];
}