-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from IIIF-Commons/feature/avoid-partof-recursion
Fixed bug with partOf loop
- Loading branch information
Showing
8 changed files
with
81 additions
and
587 deletions.
There are no files selected for viewing
578 changes: 0 additions & 578 deletions
578
__tests__/presentation-3-parser/__snapshots__/smoke.tests.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { SpecificResource } from '@iiif/presentation-3'; | ||
|
||
export function isSpecificResource(resource: unknown): resource is SpecificResource { | ||
|
||
if (typeof resource === 'string') { | ||
return false; | ||
} | ||
|
||
if (resource && !(resource as any).type && 'source' in (resource as any)) { | ||
(resource as any).type = 'SpecificResource'; | ||
return true; | ||
} | ||
|
||
return !!resource && (resource as any).type === 'SpecificResource'; | ||
} |