Skip to content

Commit

Permalink
chore: Fix typescript errors
Browse files Browse the repository at this point in the history
to allow me to publish the package
  • Loading branch information
MonkeyDo committed Oct 18, 2023
1 parent 3dbf659 commit 77a16b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/func/create-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export async function createEntity({
);

// Get additional props
// @ts-expect-error Not sure why we have this error but this whole function is unused across our repos

This comment has been minimized.

Copy link
@kellnerd

kellnerd Oct 18, 2023

Contributor

Oops, I didn't realize this would prevent us from publishing on npm...
My new type definitions and the ones in this module are slightly incompatible. It might be possible to align them, but it wasn't worth wasting more time for this unused code.

This comment has been minimized.

Copy link
@MonkeyDo

MonkeyDo Oct 18, 2023

Author Contributor

Yep, didn't realized either until after I had published the release… something for me to fix in the automated workflow !
I agree it's not worth the effort to fix unused code, and same goes for existing code that should definitely throw an error, like the other two errors

const additionalProps = getAdditionalEntityProps(entityData, entityType);

// Create entitySets
Expand Down
5 changes: 4 additions & 1 deletion src/func/entity-sets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ function updateEntitySet<Item extends SetItemT>(
// No action - set has not changed
return Promise.resolve(oldSet);
}

return createNewSetWithItems(
// @ts-expect-error We don't know why this `model` property is expected,
// even though it does not exist on Entity Set metadata
orm, transacting, derivedSet.model, [...unchangedItems, ...addedItems],
[], derivedSet.propName, derivedSet.idField
);
Expand All @@ -80,6 +81,8 @@ export async function updateEntitySets(
}

// TODO: Find out why we expect a non-existing `model` property here!?
// @ts-expect-error We don't know why this `model` property is expected,
// even though it does not exist on Entity Set metadata
const oldSetRecord = await derivedSet.model.forge({
id: currentEntity[derivedSet.name].id
}).fetch({
Expand Down

0 comments on commit 77a16b2

Please sign in to comment.