surrealdb / surrealdb.js

SurrealDB SDK for JavaScript
https://surrealdb.com
Apache License 2.0
272 stars 45 forks source link

fix: forgot type in constructor for some geometry classes #231

Closed welpie21 closed 3 months ago

welpie21 commented 3 months ago

Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.

What is the motivation?

When I was reading the code I noticed a few forgotten types that were checked with instanceof inside the constructor.

What does this change do?

Make sure it accepts the missing type as an argument.

What is your testing strategy?

Before the change when you instantiated a new GeometryCollection with the given argument of another GeometryCollection instance that already exists. The error that typescript gives is: Argument of type 'GeometryCollection' is not assignable to parameter of type '[Geometry, ...Geometry[]]'

After the change the argument accepts a other GeometryCollection class.

The following classes had the same forgotten type issue:

Is this related to any issues?

There are no related issues.

Have you read the Contributing Guidelines?