spee.ch/helpers/functions/isFreePublicClaim.js
caseyparker 2a10baf72c modified: helpers/functions/isFreePublicClaim.js
list of allowable licenses is now an array
2017-07-23 16:52:16 -07:00

13 lines
436 B
JavaScript

const logger = require('winston');
const licenses = ['Creative Commons', 'Public Domain', 'CC Attribution-NonCommercial 4.0 International'];
module.exports = ({ value }) => {
logger.debug('checking isFreePublicClaim ?');
if (
(Array.asList(licenses).contains(value.stream.metadata.license)) &&
(!value.stream.metadata.fee || value.stream.metadata.fee.amount === 0)
) {
return true;
} else {
return false;
}
};