-
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.
Package updates, use RCI source-mapper
Update vulnerable packages. Also updates where we pull nypl-source-mapper util from - previously discovery-store-models (deprecated), now RCI. The implementation in RCI is more secure and has a major API change in that it works async, so the integration here had to change in several places (sync functions become async, and related fallout). https://newyorkpubliclibrary.atlassian.net/browse/SCC-4328
- Loading branch information
Showing
101 changed files
with
447,499 additions
and
403,658 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\d+/ | ||
|
||
// 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.