Skip to content

Commit

Permalink
refactor: minor code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Apr 20, 2024
1 parent 6e4f40d commit c456af6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Utils/removeUndefined.ts
Expand Up @@ -14,7 +14,7 @@ export function removeUndefined(propertyType: UnionType): { numRemoved: number;
for (const type of propertyType.getTypes()) {
const newType = derefAnnotatedType(type);
if (newType instanceof UndefinedType) {
numRemoved += 1;
numRemoved++;
} else if (newType instanceof UnionType) {
const result = removeUndefined(newType);
numRemoved += result.numRemoved;
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/uniqueArray.ts
@@ -1,6 +1,6 @@
export function uniqueArray<T>(array: readonly T[]): T[] {
return array.reduce((result: T[], item: T) => {
if (result.indexOf(item) < 0) {
if (!result.includes(item)) {
result.push(item);
}

Expand Down

0 comments on commit c456af6

Please sign in to comment.