q3-schema-utils
Advanced tools
Comparing version 1.0.21 to 1.0.22
12
index.js
/* eslint-disable no-param-reassign */ | ||
const moment = require('moment'); | ||
const micromatch = require('micromatch'); | ||
const { compact } = require('lodash'); | ||
@@ -37,2 +38,3 @@ /** | ||
{ effectiveFrom: { $exists: false } }, | ||
{ effectiveFrom: '' }, | ||
], | ||
@@ -44,2 +46,3 @@ }, | ||
{ expiresOn: { $exists: false } }, | ||
{ expiresOn: '' }, | ||
], | ||
@@ -94,6 +97,11 @@ }, | ||
const isMatch = (name, pattern = '*') => | ||
micromatch.isMatch(String(name).toLowerCase(), pattern, { | ||
const isMatch = (name, resource = '*') => { | ||
let pattern = compact(resource); | ||
if (!pattern) pattern = ['!*']; | ||
if (!name) return false; | ||
return micromatch.isMatch(name, pattern, { | ||
nocase: true, | ||
}); | ||
}; | ||
@@ -100,0 +108,0 @@ exports.round = toFixed; |
{ | ||
"name": "q3-schema-utils", | ||
"version": "1.0.21", | ||
"version": "1.0.22", | ||
"main": "index.js", | ||
@@ -10,6 +10,6 @@ "dependencies": { | ||
"mongoose": "^5.7.1", | ||
"q3-core-responder": "^1.0.49" | ||
"q3-core-responder": "^1.0.50" | ||
}, | ||
"devDependencies": { | ||
"q3-test-utils": "^1.0.60" | ||
"q3-test-utils": "^1.0.61" | ||
}, | ||
@@ -24,3 +24,3 @@ "jest": { | ||
}, | ||
"gitHead": "a7aba02039253051f6b4e0cdecccaac534ea8e99" | ||
"gitHead": "0b3acc2bb8c4da529f9c214bc166a326fd995b90" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18889
611
Updatedq3-core-responder@^1.0.50