kmathy / cerializr Goto Github PK
View Code? Open in Web Editor NEWSerialization with decorators
License: MIT License
Serialization with decorators
License: MIT License
Hi,
first of all thanks for providing this library, which I think is a really nice object-oriented based alternative to the functional style of mapping observable responses in order to map api responses.
Unfortunately I encountered a problem with the latest version when using it with the angular cli prod build. See my sample at exaptis/nx-cerializr@15b619d
ng build --prod
or npm run build -- --prod
http-server dist/apps/cerializr -o
Uncaught TypeError: Object(...) is not a function at main-es2015...
is shown.It only works if you skip the --prod
step, as this will optimize and minify the bundle, but then the bundle is not suitable for production.
It works in prod mode if I switch back to 3.0.3
before the webpack build was introduced. Can you have a look at this please, that would be great!
Thanks and happy holidays!
David
Quite probably a missed step on my part, but can't get past this error.
import { autoserializeAs, serializeAs, deserializeAs } from 'cerializr';
export class Starship {
@serializeAs(String)
@deserializeAs(Number)
remainingFuel : number;
}
public testJSON() {
let test = {
remainingFuel: 500.5,
}
return Deserialize(test, Starship);
}
"experimentalDecorators": true,
Gives me a TypeError: Object(...) is not a function
error against the @serializeAs(String) line in Starship. Is there anything specific to get it to recognize the decorators??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.