Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Derstilon committed Jul 19, 2023
1 parent 97026d9 commit e3acc0c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ declare module '@mui/material/styles' {

declare global {
interface Window {
theme: Theme;
editor: YaptideEditor;
THREE: typeof THREE;
}
Expand Down Expand Up @@ -76,7 +75,6 @@ function App() {
}),
[prefersDarkMode]
);
window.theme ??= theme;
window.THREE ??= THREE;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function EditorTitleBar() {
const [editMode, setEditMode] = useState(false);
const [title, setTitle] = useState<string>(yaptideEditor?.config.getKey('project/title'));
const titleRef = useRef(title);
console.log('title', title);
useDocumentTitle(titleRef.current);

const startSave = useCallback(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/services/StoreService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ const Store = ({ children }: GenericContextProviderProps) => {
}
});

//

let timeout: NodeJS.Timeout;

function saveState() {
Expand Down
12 changes: 12 additions & 0 deletions src/types/TypeTransformUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ export type UppercaseObjectKeys<T> = {
[K in keyof T as TransformCase<K, 'Uppercase'>]: T[K];
};

/**
* Validates that a tuple of keys is tuple of all keys of a type.
* @template T - The set of keys to validate against.
* @template U - The tuple of keys to validate.
* @template KeyTuple - The original tuple of keys (used for recursion).
* @example
* ```ts
* type Keys = 'a' | 'b' | 'c';
* type Tuple = ['a', 'b', 'c'];
* type Validated = ValidateKeysTuple<Keys, Tuple>; // ['a', 'b', 'c']
* ```
*/
export type ValidateKeysTuple<
T extends PropertyKey,
U extends readonly PropertyKey[],
Expand Down

0 comments on commit e3acc0c

Please sign in to comment.