Use RegExp#test intead of String#match
This commit is contained in:
@@ -81,10 +81,10 @@ function includeAugments(doclet) {
|
|||||||
|
|
||||||
function extractTypes(item) {
|
function extractTypes(item) {
|
||||||
item.type.names.forEach(function (type) {
|
item.type.names.forEach(function (type) {
|
||||||
const match = type.match(/^(.*<)?([^>]*)>?$/);
|
const match = type.match(/^(?:.*<)?([^>]*)>?$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
modules[match[2]] = true;
|
modules[match[1]] = true;
|
||||||
types[match[2]] = true;
|
types[match[1]] = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,10 +321,7 @@ const modify = new Modify({
|
|||||||
.getFeatures()
|
.getFeatures()
|
||||||
.getArray()
|
.getArray()
|
||||||
.every(function (feature) {
|
.every(function (feature) {
|
||||||
return feature
|
return /Polygon/.test(feature.getGeometry().getType());
|
||||||
.getGeometry()
|
|
||||||
.getType()
|
|
||||||
.match(/Polygon/);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const SAFARI = ua.includes('safari') && !ua.includes('chrom');
|
|||||||
export const SAFARI_BUG_237906 =
|
export const SAFARI_BUG_237906 =
|
||||||
SAFARI &&
|
SAFARI &&
|
||||||
(ua.includes('version/15.4') ||
|
(ua.includes('version/15.4') ||
|
||||||
!!ua.match(/cpu (os|iphone os) 15_4 like mac os x/));
|
/cpu (os|iphone os) 15_4 like mac os x/.test(ua));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User agent string says we are dealing with a WebKit engine.
|
* User agent string says we are dealing with a WebKit engine.
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ function indexHandler(req, res) {
|
|||||||
function notFound(req, res) {
|
function notFound(req, res) {
|
||||||
return () => {
|
return () => {
|
||||||
// first, try the default directory
|
// first, try the default directory
|
||||||
if (req.url.match(/^\/cases\/[^\/]+\/(index.html)?$/)) {
|
if (/^\/cases\/[^\/]+\/(index.html)?$/.test(req.url)) {
|
||||||
// request for a case index file, and file not found, use default
|
// request for a case index file, and file not found, use default
|
||||||
req.url = '/index.html';
|
req.url = '/index.html';
|
||||||
return defaultHandler(req, res, () => indexHandler(req, res));
|
return defaultHandler(req, res, () => indexHandler(req, res));
|
||||||
|
|||||||
Reference in New Issue
Block a user