Skip to content

Commit

Permalink
Fix prototype function pollution
Browse files Browse the repository at this point in the history
Fixes #53 per MadsAppvice
  • Loading branch information
mvolz committed Aug 24, 2024
1 parent 0febe84 commit c771724
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ exports.parseAll = function ( chtml ) {
const arr = keys.map( ( key ) => exports.metadataFunctions[ key ]( chtml ) );

let result; // Result in for loop over results
let key; // Key corrsponding to location of result
let key; // Key corresponding to location of result
return BBPromise.all( arr.map( ( x ) => x.reflect() ) )
.then( ( results ) => {
for ( const r in results ) {
Object.keys( results ).forEach( function ( r ) {
result = results[ r ];
key = keys[ r ];
if ( result && result.isFulfilled() && result.value() ) {
meta[ key ] = result.value();
}
}
} );
if ( Object.keys( meta ).length === 0 ) {
throw new Error( 'No metadata found in page' );
}
Expand Down

0 comments on commit c771724

Please sign in to comment.