Release 0.5.3
This commit is contained in:
1 parent
25da870601
commit
f466df2c5c
13 files changed
+1367
-771
No files matched your search
@@ -620,10 +620,11 @@ export function createPiece(template: PieceTemplateId = 'blank'): string {
|
||||
}
|
||||
|
||||
export function captureInbox(titleValue: string, urlValue: string): string {
|
||||
const title = cleanText(titleValue, 200, 'title');
|
||||
if (!title) throw new Error('INVALID_TITLE');
|
||||
let title = cleanText(titleValue, 200, 'title');
|
||||
const url = cleanText(urlValue, 2_000, 'source');
|
||||
if (url && !validUrl(url)) throw new Error('INVALID_SOURCES');
|
||||
if (!title && !url) throw new Error('INVALID_TITLE');
|
||||
if (!title) title = new URL(url).hostname;
|
||||
const id = createPiece('blank');
|
||||
const piece = getPiece(id)!;
|
||||
savePiece(id, piece.revision, {
|
||||
|
||||
Reference in new issue
Block a user