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

@eclipse-glsp/protocol

Package Overview
Dependencies
Maintainers
6
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-glsp/protocol - npm Package Compare versions

Comparing version 2.2.0-next.341 to 2.2.0-next.342

7

lib/sprotty-geometry-bounds.d.ts

@@ -29,2 +29,9 @@ /********************************************************************************

/**
* Type guard to check if a bound is valid. For a bound to be valid it needs to be defined and have valid
* coordinates and dimensions.
*
* @param bounds the bounds to be checked for validity
*/
function isValid(bounds?: Bounds): bounds is Bounds;
/**
* Checks whether the inner bounds are compeletely encompassed by the outer bounds.

@@ -31,0 +38,0 @@ *

1

lib/sprotty-geometry-bounds.js

@@ -36,2 +36,3 @@ "use strict";

(0, type_util_1.hasNumberProp)(bounds, 'height');
geometry_1.Bounds.isValid = (bounds) => bounds !== undefined && sprotty_geometry_dimension_1.Dimension.isValid(bounds) && sprotty_geometry_point_1.Point.isValid(bounds);
geometry_1.Bounds.encompasses = (outer, inner) => geometry_1.Bounds.includes(outer, geometry_1.Bounds.topLeft(inner)) && geometry_1.Bounds.includes(outer, geometry_1.Bounds.bottomRight(inner));

@@ -38,0 +39,0 @@ geometry_1.Bounds.overlap = (one, other, touch) => {

4

package.json
{
"name": "@eclipse-glsp/protocol",
"version": "2.2.0-next.341+65b68e3",
"version": "2.2.0-next.342+fb31fc2",
"description": "The protocol definition for client-server communication in GLSP",

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

},
"gitHead": "65b68e37b8d18852c6a8a4a81f5db5f716ef926b"
"gitHead": "fb31fc22d9b5eb7244c7c0aa4a53f55d979e8d56"
}

@@ -35,2 +35,22 @@ /********************************************************************************

describe('isValid', () => {
it('should return true if the bounds are valid', () => {
const bounds: Bounds = { x: 0, y: 0, width: 100, height: 100 };
const result = Bounds.isValid(bounds);
expect(result).to.be.true;
});
it('should return false if a dimension is not valid', () => {
const bounds = { x: 0, y: 0, width: 100, height: -1 };
const result = Bounds.isValid(bounds);
expect(result).to.be.false;
});
it('should return false if a coordinate is not valid', () => {
const bounds = { x: 0, y: NaN, width: 100, height: 0 };
const result = Bounds.isValid(bounds);
expect(result).to.be.false;
});
});
describe('encompasses', () => {

@@ -37,0 +57,0 @@ it('should return true if the outer bounds completely encompass the inner bounds', () => {

@@ -37,2 +37,10 @@ /********************************************************************************

/**
* Type guard to check if a bound is valid. For a bound to be valid it needs to be defined and have valid
* coordinates and dimensions.
*
* @param bounds the bounds to be checked for validity
*/
function isValid(bounds?: Bounds): bounds is Bounds;
/**
* Checks whether the inner bounds are compeletely encompassed by the outer bounds.

@@ -276,2 +284,4 @@ *

Bounds.isValid = (bounds?: Bounds): bounds is Bounds => bounds !== undefined && Dimension.isValid(bounds) && Point.isValid(bounds);
Bounds.encompasses = (outer: Bounds, inner: Bounds): boolean =>

@@ -278,0 +288,0 @@ Bounds.includes(outer, Bounds.topLeft(inner)) && Bounds.includes(outer, Bounds.bottomRight(inner));

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