Closed jossErnesto closed 3 years ago
Can you please provide a plukr or something similar example? Thanks.
+1 with this problem. Is there some other dependency?
▶ node
> require('json-object-mapper')
/usr/local/lib/node_modules/json-object-mapper/dist/ObjectMapper.es2015.js:1
(function (exports, require, module, __filename, __dirname) { import 'reflect-metadata';
^^^^^^
SyntaxError: Unexpected token import
@DeliciousPickle are u trying running directly on node?
if so, i don't think it's going to work as this is a typescript library. May I suggest looking into .. http://brianflove.com/2016/11/08/typescript-2-express-node/ ?
I am replicating the example class from the wiki page: import {JsonProperty} from 'json-object-mapper'; export class SimpleRoster { private worksOnWeekend: Boolean = undefined; @JsonProperty({type: Date}) private systemDate: Date = undefined; public isAvailableToday(): Boolean { if (this.systemDate.getDay() % 6 === 0 && this.worksOnWeekend === false) { return false; } return true; }
} but i get this: .../node_modules\json-object-mapper\dist\ObjectMapper.es2015.js:1 (function (exports, require, module, filename, dirname) { import 'reflect-metadata';
is this the correct way?