Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@goldfishjs/plugins

Package Overview
Dependencies
Maintainers
2
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goldfishjs/plugins - npm Package Compare versions

Comparing version 1.1.17 to 1.1.18

10

lib/BridgePlugin.js

@@ -5,10 +5,6 @@ import _bridge from "@goldfishjs/bridge/lib/bridge";

import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {

@@ -51,8 +47,6 @@ function adopt(value) {

var _super = _createSuper(BridgePlugin);
function BridgePlugin() {
_classCallCheck(this, BridgePlugin);
return _super.apply(this, arguments);
return _possibleConstructorReturn(this, _getPrototypeOf(BridgePlugin).apply(this, arguments));
}

@@ -59,0 +53,0 @@

import _regeneratorRuntime from "@babel/runtime/regenerator";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {

@@ -49,8 +45,6 @@ function adopt(value) {

var _super = _createSuper(ConfigPlugin);
function ConfigPlugin() {
_classCallCheck(this, ConfigPlugin);
return _super.apply(this, arguments);
return _possibleConstructorReturn(this, _getPrototypeOf(ConfigPlugin).apply(this, arguments));
}

@@ -57,0 +51,0 @@

@@ -6,11 +6,7 @@ import _observable from "@goldfishjs/reactive-connect/lib/decorators/observable";

import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _typeof from "@babel/runtime/helpers/typeof";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {

@@ -63,4 +59,2 @@ var c = arguments.length,

var _super = _createSuper(FeedbackPlugin);
function FeedbackPlugin() {

@@ -71,3 +65,3 @@ var _this;

_this = _super.apply(this, arguments);
_this = _possibleConstructorReturn(this, _getPrototypeOf(FeedbackPlugin).apply(this, arguments));
_this.feedbackQueue = [];

@@ -74,0 +68,0 @@ return _this;

12

lib/MockBridgePlugin.js

@@ -5,11 +5,7 @@ import _mockBridge from "@goldfishjs/bridge/lib/mock";

import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _get from "@babel/runtime/helpers/get";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {

@@ -53,8 +49,6 @@ function adopt(value) {

var _super2 = _createSuper(MockBridgePlugin);
function MockBridgePlugin() {
_classCallCheck(this, MockBridgePlugin);
return _super2.apply(this, arguments);
return _possibleConstructorReturn(this, _getPrototypeOf(MockBridgePlugin).apply(this, arguments));
}

@@ -61,0 +55,0 @@

import _regeneratorRuntime from "@babel/runtime/regenerator";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {

@@ -51,8 +47,6 @@ function adopt(value) {

var _super = _createSuper(MockRequesterPlugin);
function MockRequesterPlugin() {
_classCallCheck(this, MockRequesterPlugin);
return _super.apply(this, arguments);
return _possibleConstructorReturn(this, _getPrototypeOf(MockRequesterPlugin).apply(this, arguments));
}

@@ -59,0 +53,0 @@

import _regeneratorRuntime from "@babel/runtime/regenerator";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {

@@ -51,8 +47,6 @@ function adopt(value) {

var _super = _createSuper(RequesterPlugin);
function RequesterPlugin() {
_classCallCheck(this, RequesterPlugin);
return _super.apply(this, arguments);
return _possibleConstructorReturn(this, _getPrototypeOf(RequesterPlugin).apply(this, arguments));
}

@@ -59,0 +53,0 @@

@@ -7,11 +7,7 @@ import _observable from "@goldfishjs/reactive-connect/lib/decorators/observable";

import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _typeof from "@babel/runtime/helpers/typeof";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {

@@ -66,4 +62,2 @@ var c = arguments.length,

var _super = _createSuper(Route);
function Route() {

@@ -74,3 +68,3 @@ var _this;

_this = _super.apply(this, arguments);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Route).apply(this, arguments));
_this.bridge = new BridgePlugin();

@@ -77,0 +71,0 @@ _this.pages = [];

{
"name": "@goldfishjs/plugins",
"version": "1.1.17",
"version": "1.1.18",
"description": "goldfish-plugins",

@@ -18,23 +18,23 @@ "main": "lib/index.js",

"dependencies": {
"@goldfishjs/bridge": "^1.1.17",
"@goldfishjs/reactive": "^1.1.17",
"@goldfishjs/reactive-connect": "^1.1.17",
"@goldfishjs/requester": "^1.1.17",
"@goldfishjs/route": "^1.1.17",
"@goldfishjs/utils": "^1.1.17",
"@goldfishjs/bridge": "^1.1.18",
"@goldfishjs/reactive": "^1.1.18",
"@goldfishjs/reactive-connect": "^1.1.18",
"@goldfishjs/requester": "^1.1.18",
"@goldfishjs/route": "^1.1.18",
"@goldfishjs/utils": "^1.1.18",
"mini-types": "^0.1.0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/plugin-transform-classes": "^7.7.0",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.7.1",
"@types/jest": "^24.0.23",
"babel-plugin-import": "^1.12.2",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-typescript": "^5.0.1",
"jest": "^24.9.0",
"merge2": "^1.3.0",
"ts-jest": "^23.10.2"
"@babel/core": "7.7.0",
"@babel/plugin-transform-classes": "7.7.0",
"@babel/plugin-transform-runtime": "7.6.2",
"@babel/preset-env": "7.7.1",
"@types/jest": "24.0.23",
"babel-plugin-import": "1.12.2",
"gulp": "4.0.2",
"gulp-babel": "8.0.0",
"gulp-typescript": "5.0.1",
"jest": "24.9.0",
"merge2": "1.3.0",
"ts-jest": "23.10.2"
},

@@ -41,0 +41,0 @@ "types": "./types/index.d.ts",

import Plugin, { GetPlugin } from './Plugin';
import {
bridge,
BridgeMethods,
SpecialMethods,
Fn,
APBridgeMethods,
} from '@goldfishjs/bridge';
import { bridge, BridgeMethods, SpecialMethods, Fn, APBridgeMethods } from '@goldfishjs/bridge';

@@ -18,6 +12,3 @@ export default class BridgePlugin extends Plugin {

// my.xxx
public async call<
T extends keyof R,
R extends Record<string, any> = BridgeMethods & SpecialMethods,
>(
public async call<T extends keyof R, R extends Record<string, any> = BridgeMethods & SpecialMethods>(
api: T,

@@ -32,5 +23,3 @@ params?: Parameters<R[T]>[0],

api: string,
params?: P extends Record<string, any>
? P
: Record<string, any> | ((...args: any[]) => void),
params?: P extends Record<string, any> ? P : Record<string, any> | ((...args: any[]) => void),
) {

@@ -41,6 +30,3 @@ return bridge.mycall(api, params);

// my.ap.xxx
public async ap<
T extends keyof R,
R extends Record<string, Fn> = APBridgeMethods
>(
public async ap<T extends keyof R, R extends Record<string, Fn> = APBridgeMethods>(
api: T,

@@ -47,0 +33,0 @@ params?: Parameters<R[T]>[0],

import { GetPlugin } from './Plugin';
import {
mockBridge as bridge,
BridgeMethods,
SpecialMethods,
Fn,
APBridgeMethods,
} from '@goldfishjs/bridge';
import { mockBridge as bridge, BridgeMethods, SpecialMethods, Fn, APBridgeMethods } from '@goldfishjs/bridge';
import ConfigPlugin, { IConfig } from './ConfigPlugin';

@@ -23,6 +17,3 @@ import BridgePlugin from './BridgePlugin';

// my.xxx
public async call<
T extends keyof R,
R extends Record<string, any> = BridgeMethods & SpecialMethods,
>(
public async call<T extends keyof R, R extends Record<string, any> = BridgeMethods & SpecialMethods>(
api: T,

@@ -37,5 +28,3 @@ params?: Parameters<R[T]>[0],

api: string,
params?: P extends Record<string, any>
? P
: Record<string, any> | ((...args: any[]) => void),
params?: P extends Record<string, any> ? P : Record<string, any> | ((...args: any[]) => void),
) {

@@ -46,6 +35,3 @@ return this.host ? bridge.mycall(this.host, api, params) : super.mycall(api, params);

// my.ap.xxx
public async ap<
T extends keyof R,
R extends Record<string, Fn> = APBridgeMethods
>(
public async ap<T extends keyof R, R extends Record<string, Fn> = APBridgeMethods>(
api: T,

@@ -52,0 +38,0 @@ params?: Parameters<R[T]>[0],

@@ -9,3 +9,3 @@ import { watch } from '@goldfishjs/reactive';

export type GetPlugin = <R extends Plugin>(p: (PluginClass<R>) | string) => R;
export type GetPlugin = <R extends Plugin>(p: PluginClass<R> | string) => R;

@@ -20,6 +20,6 @@ @observable

public async waitForReady() {
return new Promise((resolve) => {
return new Promise(resolve => {
const stop = watch(
() => this.isInitCompleted,
(v) => {
v => {
if (v) {

@@ -26,0 +26,0 @@ resolve();

@@ -25,6 +25,6 @@ import { state, observable } from '@goldfishjs/reactive-connect';

public waitForReady() {
return new Promise((resolve) => {
return new Promise(resolve => {
const stop = watch(
() => this.isReady(),
(newVal) => {
newVal => {
if (newVal) {

@@ -31,0 +31,0 @@ resolve();

@@ -34,4 +34,5 @@ import { route } from '@goldfishjs/route';

// When pages stack updated, cachePages need updated page
const newPages = newPageStack.map((newPage: Pick<IPage, 'path'>) =>
this.pages.find((page: IPage) => page.path === newPage.path) || newPage);
const newPages = newPageStack.map(
(newPage: Pick<IPage, 'path'>) => this.pages.find((page: IPage) => page.path === newPage.path) || newPage,
);

@@ -91,5 +92,5 @@ this.pages = [...newPages];

public pushWindow(...args: Parameters<(typeof route)['pushWindow']>) {
public pushWindow(...args: Parameters<typeof route['pushWindow']>) {
return route.pushWindow(...args);
}
}

@@ -5,3 +5,3 @@ export declare type PluginClass<P extends Plugin = Plugin> = {

};
export declare type GetPlugin = <R extends Plugin>(p: (PluginClass<R>) | string) => R;
export declare type GetPlugin = <R extends Plugin>(p: PluginClass<R> | string) => R;
export default abstract class Plugin {

@@ -8,0 +8,0 @@ static readonly type: string;

@@ -22,4 +22,4 @@ /// <reference types="mini-types" />

backToPage(page: string): void;
pushWindow(...args: Parameters<(typeof route)['pushWindow']>): void;
pushWindow(...args: Parameters<typeof route['pushWindow']>): void;
}
export {};
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