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

@justeattakeaway/pie-webc-core

Package Overview
Dependencies
Maintainers
11
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justeattakeaway/pie-webc-core - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0-next.0

6

CHANGELOG.md
# Changelog
## 0.12.0-next.0
### Minor Changes
- [Changed] - `@validPropertyValues` and `@requiredProperty` decorators to support Lit 3. ([#999](https://github.com/justeattakeaway/pie/pull/999)) by [@siggerzz](https://github.com/siggerzz)
## 0.11.0

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@justeattakeaway/pie-webc-core",
"version": "0.11.0",
"version": "0.12.0-next.0",
"description": "PIE design system base classes, mixins and utilities for web components",

@@ -5,0 +5,0 @@ "type": "module",

@@ -14,4 +14,2 @@ /**

set (value: T): void {
const oldValue = this[privatePropertyKey];
if (value === undefined || value === null || (typeof value === 'string' && value.trim() === '')) {

@@ -21,7 +19,5 @@ console.error(`<${componentName}> Missing required attribute "${propertyKey}"`);

this[privatePropertyKey] = value;
this.requestUpdate(propertyKey, oldValue);
},
configurable: true,
});
};

@@ -28,12 +28,2 @@ import {

color?: string | null;
private _requestUpdateArgs = {};
requestUpdate (propertyKey: string, oldValue: unknown) {
this._requestUpdateArgs = { propertyKey, oldValue };
}
requestUpdateCalledWith () {
return this._requestUpdateArgs;
}
}

@@ -84,13 +74,2 @@

});
it('should call requestUpdate when the property is set', () => {
// Arrange
const mockComponent = new MockComponent();
// Act
mockComponent.color = 'blue';
// Assert
expect(mockComponent.requestUpdateCalledWith()).toStrictEqual({ propertyKey: 'color', oldValue: undefined });
});
});

@@ -28,12 +28,2 @@ import {

color = 'red';
private _requestUpdateArgs = {};
requestUpdate (propertyKey: string, oldValue: unknown) {
this._requestUpdateArgs = { propertyKey, oldValue };
}
requestUpdateCalledWith () {
return this._requestUpdateArgs;
}
}

@@ -79,14 +69,2 @@

});
it('should call requestUpdate when the property is set', () => {
// Arrange
const mockComponent = new MockComponent();
// Act
mockComponent.color = 'yellow';
// Assert
expect(mockComponent.color).toBe('red');
expect(mockComponent.requestUpdateCalledWith()).toStrictEqual({ propertyKey: 'color', oldValue: 'red' });
});
});

@@ -8,3 +8,3 @@ /**

*/
export const validPropertyValues = <T>(componentName: string, validValues: readonly T[], defaultValue: T) => function validatePropertyValues (target: object, propertyKey: string): void {
export const validPropertyValues = <T>(componentName: string, validValues: readonly T[], defaultValue: T) => function validatePropertyValues (target: object, propertyKey: string) : void {
const privatePropertyKey = `#${propertyKey}`;

@@ -17,4 +17,2 @@

set (value: T): void {
const oldValue = this[privatePropertyKey];
if (!validValues.includes(value)) {

@@ -30,6 +28,5 @@ console.error(

}
this.requestUpdate(propertyKey, oldValue);
},
configurable: true,
});
};
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