Socket
Socket
Sign inDemoInstall

@shopify/useful-types

Package Overview
Dependencies
Maintainers
11
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/useful-types - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

CHANGELOG.md

@@ -10,6 +10,8 @@ # Changelog

## [Unreleased]
### Added
- Added new `DeepPartial` type. ([#456](https://github.com/Shopify/quilt/pull/456))
## [1.0.0]
Initial release

@@ -6,1 +6,4 @@ import { ComponentType } from 'react';

export declare type Props<T> = T extends ComponentType<infer P> ? P : never;
export declare type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : DeepPartial<T[P]>;
};
{
"name": "@shopify/useful-types",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",

@@ -26,3 +26,4 @@ "description": "A few handy TypeScript types",

"dependencies": {
"@types/react": ">=16.4.0"
"@types/react": ">=16.4.0",
"tslib": "^1.9.3"
},

@@ -29,0 +30,0 @@ "devDependencies": {

@@ -63,1 +63,14 @@ # `@shopify/useful-types`

```
- `DeepPartial<T>`: Recusively maps over all properties in a type and transforms them to be optional. Useful when you need to make optional all of the properties (and nested properties) of an existing type.
```ts
interface Obj {
foo: string;
bar: {
baz: boolean;
};
}
type DeepPartialObj = DeepPartial<Obj>; // {foo?: string; bar?: { baz?: boolean }}
```
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