spee.ch/helpers/functions/isFreePublicClaim.js

14 lines
436 B
JavaScript
Raw Normal View History

2017-06-20 04:34:34 +02:00
const logger = require('winston');
const licenses = ['Creative Commons', 'Public Domain', 'CC Attribution-NonCommercial 4.0 International'];
module.exports = ({ value }) => {
2017-06-20 04:34:34 +02:00
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;
}
};