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
0
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.23.0 to 0.24.0

9

CHANGELOG.md
# Changelog
## 0.24.0
### Minor Changes
- [Changed] - Update default props generic helper type to include all props by default ([#1582](https://github.com/justeattakeaway/pie/pull/1582)) by [@xander-marjoram](https://github.com/xander-marjoram)
[Changed] - Naming of generic type
[Added] - JSDoc comment
## 0.23.0

@@ -4,0 +13,0 @@

2

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

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

@@ -1,1 +0,31 @@

export type ComponentDefaultPropsGeneric<T, K extends keyof T> = Readonly<Required<Pick<T, K>>>;
/**
* This type should be used when defining the default props for a component.
* It is a generic type that takes two type parameters:
* - `T` is the type of the props object that the default props are being defined for.
* - `K` is the type of the keys in `T` that should be required in the default props.
* By default, `K` is set to be all the keys in `T`. This means that all the keys in `T` will be required in the default props.
* You can override this by specifying a subset of the keys in `T` that should be required in the default props.
*
* @example ```tsx
* interface MyComponentProps {
* a: string;
* b?: number;
* c: boolean;
* }
* const allProps: ComponentDefaultProps<MyComponentProps> = {
* a: 'default value',
* b: 42,
* c: true,
* };
*
* const pickProps: ComponentDefaultProps<MyComponentProps, 'a'> = {
* a: 'default value',
* };
*
* const omitProps: ComponentDefaultProps<MyComponentProps, keyof Omit<MyComponentProps, 'a'>> = {
* b: 42,
* c: true,
* };
* ```
*/
export type ComponentDefaultProps<T, K extends keyof T = keyof T> = Readonly<Required<Pick<T, K>>>;

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