Skip to content

Commit

Permalink
use phet-core types instead of custom implementations, phetsims/chipp…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 27, 2023
1 parent e79b6f5 commit a851b77
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions js/optionize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@
import phetCore from './phetCore.js';
import merge from './merge.js';
import IntentionalAny from './types/IntentionalAny.js';

// https://github.com/piotrwitek/utility-types/blob/master/src/mapped-types.ts
type OptionalKeys<T> = {
[K in keyof T]-?: object extends Pick<T, K> ? K : never;
}[keyof T];
import RequiredKeys from './types/RequiredKeys.js';
import OptionalKeys from './types/OptionalKeys.js';

// Gets the parts of an object that are optional
type Options<T> = Pick<T, OptionalKeys<T>>;

export type RequiredKeys<T> = {
[K in keyof T]-?: object extends Pick<T, K> ? never : K;
}[keyof T];

type ObjectWithNoKeys = Record<string | number, never>;

export type EmptySelfOptions = {
Expand Down

0 comments on commit a851b77

Please sign in to comment.