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

@morjs/core

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@morjs/core - npm Package Compare versions

Comparing version 1.0.6 to 1.0.11

4

esm/utils/invokeHook.d.ts
import { MorHooks } from '@morjs/api';
/**
* 调用hook
* @param hookName hook名字
* 调用 hook
* @param hookName hook 名字
*/
export declare const invokeHook: (hookName: keyof MorHooks) => (this: Record<string, any>, ...args: any[]) => void;
import { __spreadArray } from "tslib";
import { getSharedProperty } from '@morjs/api';
import { getSharedProperty, logger } from '@morjs/api';
/**
* 调用hook
* @param hookName hook名字
* 调用 hook
* @param hookName hook 名字
*/

@@ -14,5 +14,11 @@ export var invokeHook = function (hookName) {

}
(_a = getSharedProperty('$morHooks', this)[hookName]).call.apply(_a, __spreadArray([this], args, false));
var hook = (_a = getSharedProperty('$morHooks', this)) === null || _a === void 0 ? void 0 : _a[hookName];
if (typeof (hook === null || hook === void 0 ? void 0 : hook.call) === 'function') {
hook.call.apply(hook, __spreadArray([this], args, false));
}
else {
logger.error("".concat(hookName, " \u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684 hook"));
}
};
};
//# sourceMappingURL=invokeHook.js.map
import { MorHooks } from '@morjs/api';
/**
* 调用hook
* @param hookName hook名字
* 调用 hook
* @param hookName hook 名字
*/
export declare const invokeHook: (hookName: keyof MorHooks) => (this: Record<string, any>, ...args: any[]) => void;

@@ -7,4 +7,4 @@ "use strict";

/**
* 调用hook
* @param hookName hook名字
* 调用 hook
* @param hookName hook 名字
*/

@@ -18,3 +18,9 @@ var invokeHook = function (hookName) {

}
(_a = (0, api_1.getSharedProperty)('$morHooks', this)[hookName]).call.apply(_a, tslib_1.__spreadArray([this], args, false));
var hook = (_a = (0, api_1.getSharedProperty)('$morHooks', this)) === null || _a === void 0 ? void 0 : _a[hookName];
if (typeof (hook === null || hook === void 0 ? void 0 : hook.call) === 'function') {
hook.call.apply(hook, tslib_1.__spreadArray([this], args, false));
}
else {
api_1.logger.error("".concat(hookName, " \u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684 hook"));
}
};

@@ -21,0 +27,0 @@ };

{
"name": "@morjs/core",
"version": "1.0.6",
"version": "1.0.11",
"description": "mor runtime core",

@@ -46,3 +46,3 @@ "keywords": [

},
"gitHead": "ac35a068e22045a136eb267ae608081e82ad1dc8"
"gitHead": "f17bedf00db165bbb16e14cfa3017c5e625b05a7"
}

Sorry, the diff of this file is not supported yet

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