From 9dc3740d9802b7b8b0ff513c170ed5970467d6fa Mon Sep 17 00:00:00 2001 From: Alex Iglesias Date: Tue, 27 Apr 2021 13:12:53 +0200 Subject: [PATCH] Added PickPartial type --- package.json | 2 +- types/PickPartial.ts | 6 ++++++ types/index.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 types/PickPartial.ts diff --git a/package.json b/package.json index 5fc90af..00aae2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@finsweet/ts-utils", - "version": "0.3.0", + "version": "0.4.0", "description": "Typescript utils for custom Webflow projects.", "main": "index.ts", "module": "index.ts", diff --git a/types/PickPartial.ts b/types/PickPartial.ts new file mode 100644 index 0000000..eeedb7b --- /dev/null +++ b/types/PickPartial.ts @@ -0,0 +1,6 @@ +/** + * The picked keys will become Partial and the rest of the interface will stay the same. + */ +type PickPartial = Omit & Partial>; + +export default PickPartial; diff --git a/types/index.ts b/types/index.ts index 41c6f99..5a31a04 100644 --- a/types/index.ts +++ b/types/index.ts @@ -2,4 +2,5 @@ export { default as Entry } from './Entry'; export { default as FormField } from './FormField'; export { default as Instance } from './Instance'; export { default as PartialExcept } from './PartialExcept'; +export { default as PickPartial } from './PickPartial'; export { default as Webflow } from './Webflow';