mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
17 lines
484 B
TypeScript
17 lines
484 B
TypeScript
import { checkObjectHasProperties } from '@joplin/utils/object';
|
|
import { ModelType } from '../../BaseModel';
|
|
import isTrashableNoteOrFolder from './isTrashableNoteOrFolder';
|
|
|
|
type ItemSlice = { id?: string };
|
|
const isTrashableItem = (itemType: ModelType, item: ItemSlice) => {
|
|
checkObjectHasProperties(item, ['id']);
|
|
|
|
if (itemType !== ModelType.Folder && itemType !== ModelType.Note) {
|
|
return false;
|
|
}
|
|
|
|
return isTrashableNoteOrFolder(item);
|
|
};
|
|
|
|
export default isTrashableItem;
|