New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@remixproject/engine

Package Overview
Dependencies
Maintainers
4
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remixproject/engine - npm Package Compare versions

Comparing version 0.3.0-beta.3 to 0.3.0-beta.4

9

lib/manager.d.ts

@@ -43,3 +43,3 @@ import type { Profile } from '@remixproject/plugin-utils';

*/
updateProfile(profile: Partial<Profile>): void;
updateProfile(to: Partial<Profile>): Promise<void>;
/**

@@ -94,3 +94,10 @@ * Add a profile to the list of profile

canCall(from: Profile, to: Profile, method: string, message?: string): Promise<boolean>;
/**
* Check if a plugin can update profile of another one
* @param from Profile of the caller plugin
* @param to Updates on the profile of the target plugin
* @note This method can be overrided
*/
canUpdateProfile(from: Profile, to: Partial<Profile>): Promise<boolean>;
}
export {};

46

lib/manager.js

@@ -32,17 +32,14 @@ import { __awaiter } from "tslib";

*/
updateProfile(profile) {
if (!profile)
return;
if (profile.name && profile.name !== this.requestFrom) {
throw new Error('A plugin cannot change its name.');
}
const name = this.requestFrom;
if (!this.profiles[name]) {
throw new Error(`Plugin ${name} is not register, you cannot update it's profile.`);
}
if (profile['url'] && profile['url'] !== this.profiles[name]['url']) {
throw new Error('Url from Profile cannot be updated.');
}
this.profiles[name] = Object.assign(Object.assign({}, this.profiles[name]), profile);
this.emit('profileUpdated', this.profiles[name]);
updateProfile(to) {
return __awaiter(this, void 0, void 0, function* () {
if (!to)
return;
if (!this.profiles[to.name]) {
throw new Error(`Plugin ${to.name} is not register, you cannot update it's profile.`);
}
const from = yield this.getProfile(this.requestFrom);
yield this.canUpdateProfile(from, to);
this.profiles[name] = Object.assign(Object.assign({}, this.profiles[name]), to);
this.emit('profileUpdated', this.profiles[name]);
});
}

@@ -174,3 +171,3 @@ /**

return __awaiter(this, void 0, void 0, function* () {
if (from.name === 'manager') {
if (from.name === 'manager' || from.name === to.name) {
return true;

@@ -193,3 +190,20 @@ }

}
/**
* Check if a plugin can update profile of another one
* @param from Profile of the caller plugin
* @param to Updates on the profile of the target plugin
* @note This method can be overrided
*/
canUpdateProfile(from, to) {
return __awaiter(this, void 0, void 0, function* () {
if (to.name && from.name !== to.name) {
throw new Error('A plugin cannot change its name.');
}
if (to['url'] && to['url'] !== this.profiles[to.name]['url']) {
throw new Error('Url from Profile cannot be updated.');
}
return true;
});
}
}
//# sourceMappingURL=manager.js.map
{
"name": "@remixproject/engine",
"version": "0.3.0-beta.3",
"version": "0.3.0-beta.4",
"homepage": "https://github.com/ethereum/remix-plugin/tree/master/packages/engine/core#readme",

@@ -23,8 +23,5 @@ "repository": {

"license": "MIT",
"gitHead": "ca5c69be64ec4eaf7fe5d1d362726e75cb3b5726",
"main": "index.js",
"typings": "index.d.ts",
"dependencies": {
"@remixproject/plugin-utils": "0.3.0-beta.3",
"@remixproject/plugin-api": "0.3.0-beta.3"
}
"typings": "index.d.ts"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc