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

@yoctol/kurator

Package Overview
Dependencies
Maintainers
6
Versions
703
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yoctol/kurator - npm Package Compare versions

Comparing version 0.5.6 to 0.5.7

2

package.json
{
"name": "@yoctol/kurator",
"license": "UNLICENSED",
"version": "0.5.6",
"version": "0.5.7",
"main": "src/index.js",

@@ -6,0 +6,0 @@ "files": [

@@ -47,3 +47,3 @@ const nock = require('nock');

async function setup() {
async function setup(options = {}) {
nock('https://kurator.yoctol.com')

@@ -56,2 +56,3 @@ .get('/api/projects/1/definition')

accessToken: 'ACCESS_TOKEN',
...options,
});

@@ -97,2 +98,15 @@

});
it('should support actionMap', async () => {
const { kurator } = await setup({ actionMap: { 測試: '1' } });
const context = {
sendText: jest.fn(),
};
const action = kurator.getAction('測試');
await action(context);
expect(context.sendText).toBeCalledWith('基本的', {});
});
});

@@ -99,0 +113,0 @@

@@ -20,3 +20,3 @@ const B = require('bottender-compose');

class Kurator {
constructor({ projectId, accessToken, origin }) {
constructor({ projectId, accessToken, origin, actionMap }) {
this._projectId = projectId;

@@ -36,2 +36,3 @@ this._accessToken = accessToken;

this._predicates = [];
this._actionMap = actionMap || {};

@@ -93,3 +94,5 @@ this._initPromise = this.syncDefinition();

return (...args) => {
const action = this._remoteActions[actionId];
const action =
this._remoteActions[actionId] ||
this._remoteActions[this._actionMap[actionId]];

@@ -107,3 +110,6 @@ if (!action) {

}
return this._remoteActions[actionId];
return (
this._remoteActions[actionId] ||
this._remoteActions[this._actionMap[actionId]]
);
}

@@ -110,0 +116,0 @@

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