Optimize the file storage structure of the knowledge base (#386)
This commit is contained in:
5
packages/common/tools/str.ts
Normal file
5
packages/common/tools/str.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export function strIsLink(str?: string) {
|
||||
if (!str) return false;
|
||||
if (/^((http|https)?:\/\/|www\.|\/)[^\s/$.?#].[^\s]*$/i.test(str)) return true;
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user