|
|
@ -181,13 +181,17 @@ class Wappalyzer {
|
|
|
|
* Enclose string in array
|
|
|
|
* Enclose string in array
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
asArray(value) {
|
|
|
|
asArray(value) {
|
|
|
|
return typeof value === 'string' ? [ value ] : value;
|
|
|
|
return value instanceof Array ? value : [ value ];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Parse apps.json patterns
|
|
|
|
* Parse apps.json patterns
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
parsePatterns(patterns) {
|
|
|
|
parsePatterns(patterns) {
|
|
|
|
|
|
|
|
if ( !patterns ) {
|
|
|
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var parsed = {};
|
|
|
|
var parsed = {};
|
|
|
|
|
|
|
|
|
|
|
|
// Convert string to object containing array containing string
|
|
|
|
// Convert string to object containing array containing string
|
|
|
@ -197,7 +201,7 @@ class Wappalyzer {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for ( var key in patterns ) {
|
|
|
|
Object.keys(patterns).forEach(key => {
|
|
|
|
parsed[key] = [];
|
|
|
|
parsed[key] = [];
|
|
|
|
|
|
|
|
|
|
|
|
this.asArray(patterns[key]).forEach(pattern => {
|
|
|
|
this.asArray(patterns[key]).forEach(pattern => {
|
|
|
@ -226,7 +230,7 @@ class Wappalyzer {
|
|
|
|
|
|
|
|
|
|
|
|
parsed[key].push(attrs);
|
|
|
|
parsed[key].push(attrs);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Convert back to array if the original pattern list was an array (or string)
|
|
|
|
// Convert back to array if the original pattern list was an array (or string)
|
|
|
|
if ( 'main' in parsed ) {
|
|
|
|
if ( 'main' in parsed ) {
|
|
|
|