Skip to content

Commit

Permalink
Adds Mutable type (#2259)
Browse files Browse the repository at this point in the history
* creates Mutable type

* Create twelve-comics-agree.md

* Update index.ts

* Update yarn.lock
  • Loading branch information
TheSonOfThomp authored Mar 22, 2024
1 parent 6c57056 commit 66df9ab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-comics-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/lib': minor
---

Creates `Mutable` utility type
1 change: 1 addition & 0 deletions packages/lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import getTheme from './getTheme';
export * from './helpers';
export { validateChildren, isComponentType } from './validateChildren';
export { createSyntheticEvent } from './createSyntheticEvent';
export { type Mutable } from './types';

export {
type ExtendedComponentProps,
Expand Down
4 changes: 4 additions & 0 deletions packages/lib/src/types/Mutable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** Redefine a Readonly type as mutable */
export type Mutable<Type> = {
-readonly [Key in keyof Type]: Type[Key];
};
1 change: 1 addition & 0 deletions packages/lib/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { type Mutable } from './Mutable';
9 changes: 0 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3425,15 +3425,6 @@
resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.4.0.tgz#08d6c5e20cf7e4cc02fd181c4b0c225cd31dbb60"
integrity sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==

"@leafygreen-ui/lib@^11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/lib/-/lib-11.0.0.tgz#dde085e103adc8650699785407650cef61cedd40"
integrity sha512-sHkY/MOwRQDc9qAR1awreW0dP+6ELueJJd4JCJmi6XYbdL0wDotFwsWfCwkL+N6cFbE1e+xBQtFLB6T1+58+iQ==
dependencies:
"@storybook/csf" "^0.1.0"
lodash "^4.17.21"
prop-types "^15.7.2"

"@manypkg/find-root@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@manypkg/find-root/-/find-root-1.1.0.tgz#a62d8ed1cd7e7d4c11d9d52a8397460b5d4ad29f"
Expand Down

0 comments on commit 66df9ab

Please sign in to comment.