-
Notifications
You must be signed in to change notification settings - Fork 0
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 #415 from NYPL/scc-4328
Package updates, use RCI source-mapper
- Loading branch information
Showing
102 changed files
with
447,505 additions
and
403,659 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
const NyplSourceMapper = require('discovery-store-models/lib/nypl-source-mapper') | ||
// NYPL item ids start with an 'i' | ||
const NYPL_ITEM_ID_PATTERN = /^i/ | ||
|
||
// This is based on uri now but should be changed to use the 'item.owner' field once it's more reliably serialized. | ||
// This just talks about ownership, not recap vs non-recap | ||
const isItemNyplOwned = (item) => { | ||
const { nyplSource } = NyplSourceMapper.instance().splitIdentifier(item.uri) | ||
return nyplSource === 'sierra-nypl' | ||
return NYPL_ITEM_ID_PATTERN.test(item?.uri) | ||
} | ||
|
||
module.exports = { isItemNyplOwned } |
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
Oops, something went wrong.