@metamask/post-message-stream
Advanced tools
Comparing version 6.1.0 to 6.1.1
"use strict"; | ||
var _a, _b; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WindowPostMessageStream = void 0; | ||
const utils_1 = require("@metamask/utils"); | ||
const BasePostMessageStream_1 = require("../BasePostMessageStream"); | ||
const utils_1 = require("../utils"); | ||
const utils_2 = require("../utils"); | ||
/* istanbul ignore next */ | ||
const getSource = (_a = Object.getOwnPropertyDescriptor(MessageEvent.prototype, 'source')) === null || _a === void 0 ? void 0 : _a.get; | ||
(0, utils_1.assert)(getSource, 'MessageEvent.prototype.source getter is not defined.'); | ||
/* istanbul ignore next */ | ||
const getOrigin = (_b = Object.getOwnPropertyDescriptor(MessageEvent.prototype, 'origin')) === null || _b === void 0 ? void 0 : _b.get; | ||
(0, utils_1.assert)(getOrigin, 'MessageEvent.prototype.origin getter is not defined.'); | ||
/** | ||
@@ -45,8 +53,11 @@ * A {@link Window.postMessage} stream. | ||
const message = event.data; | ||
if ((this._targetOrigin !== '*' && event.origin !== this._targetOrigin) || | ||
event.source !== this._targetWindow || | ||
!(0, utils_1.isValidStreamMessage)(message) || | ||
/* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
if ((this._targetOrigin !== '*' && | ||
getOrigin.call(event) !== this._targetOrigin) || | ||
getSource.call(event) !== this._targetWindow || | ||
!(0, utils_2.isValidStreamMessage)(message) || | ||
message.target !== this._name) { | ||
return; | ||
} | ||
/* eslint-enable @typescript-eslint/no-non-null-assertion */ | ||
this._onData(message.data); | ||
@@ -53,0 +64,0 @@ } |
{ | ||
"name": "@metamask/post-message-stream", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Sets up a duplex object stream over window.postMessage", | ||
@@ -35,3 +35,3 @@ "homepage": "https://github.com/MetaMask/post-message-stream#readme", | ||
"dependencies": { | ||
"@metamask/utils": "^3.0.1", | ||
"@metamask/utils": "^4.0.0", | ||
"readable-stream": "2.3.3" | ||
@@ -38,0 +38,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
725
70268
39
+ Added@metamask/utils@4.0.0(transitive)
- Removed@metamask/utils@3.6.0(transitive)
Updated@metamask/utils@^4.0.0