Skip to content

Commit

Permalink
fix examples/change-type-mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Jul 28, 2022
1 parent 9371511 commit 5ce0540
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
18 changes: 18 additions & 0 deletions examples/change-type-mapping/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Should be able to render models with custom naming formatter and should log expected output to console 1`] = `
Array [
"class Root {
private _email?: integer;
constructor(input: {
email?: integer,
}) {
this._email = input.email;
}
get email(): integer | undefined { return this._email; }
set email(email: integer | undefined) { this._email = email; }
}",
]
`;
8 changes: 3 additions & 5 deletions examples/change-type-mapping/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { TypeScriptGenerator } from '../../src';

const generator = new TypeScriptGenerator({
constraints: {
typeMapping: {
Number: ({renderer, model}) => {
return 'integer';
}
typeMapping: {
String: ({constrainedModel, options, propertyKey}) => {
return 'integer';
}
}
});
Expand Down

0 comments on commit 5ce0540

Please sign in to comment.