Improve readability.
This commit is contained in:
parent
81f7f805fa
commit
9dabf19d1b
1 changed files with 5 additions and 9 deletions
|
@ -232,17 +232,13 @@ function onMessage(event) {
|
||||||
* @return {boolean} True if trusted
|
* @return {boolean} True if trusted
|
||||||
*/
|
*/
|
||||||
function trustedEndpoint(origin) {
|
function trustedEndpoint(origin) {
|
||||||
if (origin) {
|
if (!origin) {
|
||||||
if (messageEndpoints.filter(function(endpoint) {
|
return false;
|
||||||
if (endpoint.endpointUrl == origin) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}).length > 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return messageEndpoints.some((endpoint) => {
|
||||||
|
return endpoint.endpointUrl === origin;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue