Files
speckle-server/packages/objectsender/src/utils/Base.ts
T
Dimitrie Stefanescu 01c9c3fa0e Adds an 'object sender' module (#2355)
* feat(objectsender): wip serializer and sender

* feat(objectsender): mostly done

* feat(objectsender): chores

* feat(objectsender): chores

* build refactor

* linting issue fix

* minor type adjustments

* adding in type definitions into build

* sha tests

* config fix

* fixed up servertransport

* added tests to ci

* added coverage

* storing coverage?

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2024-06-17 15:36:59 +03:00

16 lines
541 B
TypeScript

/* eslint-disable camelcase */
/**
* Basic 'Base'-like object from .NET. It will create a 'speckle_type' prop that defaults to the class' name. This can be overriden by providing yourself a 'speckle_type' property in the props argument of the constructor.
*/
export class Base implements Record<string, unknown> {
speckle_type: string
constructor(props?: Record<string, unknown>) {
this.speckle_type = this.constructor.name
if (props) {
for (const key in props) this[key] = props[key]
}
}
[x: string]: unknown
}