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

@bangle.dev/core

Package Overview
Dependencies
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bangle.dev/core - npm Package Compare versions

Comparing version 0.16.1 to 0.16.2

2

package.json
{
"name": "@bangle.dev/core",
"version": "0.16.1",
"version": "0.16.2",
"homepage": "https://bangle.dev",

@@ -5,0 +5,0 @@ "authors": [

@@ -86,2 +86,50 @@ import { SpecRegistry } from '../../spec-registry';

test('passes params correctly to plugins which are functions', () => {
const pluginFn = jest.fn(
() => new Plugin({ key: new PluginKey('myPlug') }),
);
const groupChildPluginFn = jest.fn(
() => new Plugin({ key: new PluginKey('grp1.first') }),
);
const group1 = new PluginGroup('grp1', [[groupChildPluginFn]]);
expect(
pluginLoader(specRegistry, [group1, pluginFn])
.map((r) => r.key)
.includes('myPlug$'),
).toBe(true);
expect(pluginFn).toBeCalledTimes(1);
expect(groupChildPluginFn).toBeCalledTimes(1);
expect(pluginFn).nthCalledWith(1, {
specRegistry,
schema: specRegistry.schema,
metadata: {},
});
expect(groupChildPluginFn).nthCalledWith(1, {
specRegistry,
schema: specRegistry.schema,
metadata: {},
});
});
test('passes params metadata correctly to plugins which are functions', () => {
const pluginFn = jest.fn(() => new Plugin({ key: new PluginKey('myPug') }));
const metadata = { hello: 'world' };
expect(
pluginLoader(specRegistry, [pluginFn], { metadata })
.map((r) => r.key)
.includes('myPug$'),
).toBe(true);
expect(pluginFn).toBeCalledTimes(1);
expect(pluginFn).nthCalledWith(1, {
specRegistry,
schema: specRegistry.schema,
metadata,
});
});
test('Throws error if duplicate groups', () => {

@@ -88,0 +136,0 @@ const group1_child = new PluginGroup('grp1_child', [

@@ -28,8 +28,10 @@ import {

const schema = specRegistry.schema;
let [flatPlugins, pluginGroupNames] = flatten(plugins, {
const pluginPayload = {
schema,
specRegistry,
});
metadata,
};
let [flatPlugins, pluginGroupNames] = flatten(plugins, pluginPayload);
if (defaultPlugins) {

@@ -47,3 +49,3 @@ let defaultPluginGroups = [];

flatPlugins = flatPlugins.concat(
flatten(defaultPluginGroups, { schema, specRegistry, metadata })[0],
flatten(defaultPluginGroups, pluginPayload)[0],
);

@@ -50,0 +52,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