Socket
Book a DemoInstallSign in
Socket

@stamp/collision

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stamp/collision - npm Package Compare versions

Comparing version

to
1.0.1

7

__tests__/index.js

@@ -176,5 +176,10 @@ var compose = require('@stamp/compose');

it('forbid + allow', function () {
expect(function () {Collision.collisionSetup({allow: ['foo'], forbid: ['foo']})}).toThrow();
expect(function () {Collision.collisionSetup({allow: ['foo'], forbid: ['foo']})}).toThrow(/Collision/);
});
it('can be used as a standalone function', function () {
var collisionSetup = Collision.collisionSetup;
expect(function () {collisionSetup({allow: ['foo'], forbid: ['foo']})}).toThrow(/Collision/);
});
it('forbid without conflicts', function () {

@@ -181,0 +186,0 @@ var Forbid = compose({

9

index.js

@@ -56,7 +56,10 @@ var compose = require('@stamp/compose');

module.exports = compose({
var Collision = compose({
deepConfiguration: {Collision: {defer: [], forbid: []}},
staticProperties: {
collisionSetup: function (opts) {
return this.compose({deepConfiguration: {Collision: opts}});
'use strict';
var Stamp = this && this.compose ? this : Collision;
return Stamp.compose({deepConfiguration: {Collision: opts}});
},

@@ -182,1 +185,3 @@ collisionSettingsReset: function () {

});
module.exports = Collision;
{
"name": "@stamp/collision",
"version": "1.0.0",
"version": "1.0.1",
"description": "Detect and manipulate method collisions",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,10 +5,24 @@ # @stamp/collision

The `defer` collects same named methods and wraps them into a single method.
This stamp (aka behavior) will check if there are any conflicts on every `compose` call.
Throws an `Error` in case of a forbidden collision or ambiguous setup.
This stamp (aka behavior) will check on every `compose` call if there are any conflicts. Throws an `Error` in case of a forbidden collision or ambiguous setup.
## Usage
## Usage
```js
import Collision from '@stamp/collision';
const ForbidRedrawCollision = Collision.collisionSetup({forbid: ['redraw']});
```
Or if you don't want to import the stamp you can import only the method:
```js
import {collisionSetup} from '@stamp/collision';
const ForbidRedrawCollision = collisionSetup({forbid: ['redraw']});
```
The `defer` collects same named methods and wraps them into a single method.
```js
import Collision from '@stamp/collision';
import {Border, Button, Graph} from './drawable/primitives';

@@ -15,0 +29,0 @@

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.