You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
15 lines
588 B
TypeScript
15 lines
588 B
TypeScript
import { checkObjectHasProperties } from '@joplin/utils/object';
|
|
import conflictFolderId from '../../models/utils/getConflictFolderId';
|
|
import getTrashFolderId from './getTrashFolderId';
|
|
|
|
type ItemSlice = { id?: string };
|
|
|
|
// This function is separate from isTrashableItem to handle the case where we know that an item
|
|
// is either a note or a folder, but don't know which.
|
|
const isTrashableNoteOrFolder = (item: ItemSlice) => {
|
|
checkObjectHasProperties(item, ['id']);
|
|
return item.id !== conflictFolderId() && item.id !== getTrashFolderId();
|
|
};
|
|
|
|
export default isTrashableNoteOrFolder;
|