I am creating a `object {}` with any number of pro...
# javascript
s
I am creating a
object {}
with any number of properties and functions that will be processed in a given way. I would like to mark the properties to make logical decisions about them in the processor. If I understand correctly, js annotations are not possible. Is there another way? What I need specifically is I need properties of the object to exist in the definition but not the final product. Potentially I could have
val prop1: String = "value"  and val prop2: String = "value2"
and I would like to include
prop1
but not
prop2
.
a
Not sure I got the question, but couldn't you inherit the object from a class with "to be removed" properties? The processor could then drop all the members of the base class (i.e. look for
A.prototype.foo = ...
and remove those). You could also inherit from an interface. In that case there will be a block of code, which looks like
YOUR_OBJECT.prototype.foo = BASE_INTERFACE.prototype.foo
.
s
Given the implementation the interface approach you've suggested is probably my best option, I hadn't considered that. Thank you!
😃 1