-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: merge themes into components (#2388)
- Loading branch information
Showing
33 changed files
with
117 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/models/src/Domain/Syncable/Component/TypeGuards.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ComponentInterface } from './ComponentInterface' | ||
import { ItemInterface } from '../../Abstract/Item/Interfaces/ItemInterface' | ||
import { DecryptedItemInterface } from '../../Abstract/Item/Interfaces/DecryptedItem' | ||
import { isDecryptedItem } from '../../Abstract/Item' | ||
import { ContentType } from '@standardnotes/domain-core' | ||
|
||
export function isComponent(x: ItemInterface): x is ComponentInterface { | ||
if (!isDecryptedItem(x as DecryptedItemInterface)) { | ||
return false | ||
} | ||
|
||
return x.content_type === ContentType.TYPES.Component | ||
} | ||
|
||
export function isTheme(x: ItemInterface): x is ComponentInterface { | ||
if (!isDecryptedItem(x as DecryptedItemInterface)) { | ||
return false | ||
} | ||
|
||
return x.content_type === ContentType.TYPES.Theme | ||
} | ||
|
||
export function isComponentOrTheme(x: ItemInterface): x is ComponentInterface { | ||
if (!isDecryptedItem(x as DecryptedItemInterface)) { | ||
return false | ||
} | ||
|
||
return x.content_type === ContentType.TYPES.Component || x.content_type === ContentType.TYPES.Theme | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.