diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..40c344b --- /dev/null +++ b/dist/index.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getFromDb() { + return [{ + name: "kfir", + email: "kfir@gmail.com", + }]; +} +function sendError(error) { + throw new Error(error); +} +const data = getFromDb(); +const name = data[0].name; +const email = data[0].email; +console.log(data); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..5ecf9af --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,SAAS,SAAS;IAChB,OAAO,CAAC;YACN,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,gBAAgB;SACxB,CAAC,CAAC;AACL,CAAC;AACD,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAGD,MAAM,IAAI,GAAG,SAAS,EAAE,CAAC;AACzB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/types.js b/dist/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/dist/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/types.js.map b/dist/types.js.map new file mode 100644 index 0000000..c768b79 --- /dev/null +++ b/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..014a4f5 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,17 @@ +import { User } from "./types"; + +function getFromDb(): User[] { + return [{ + name: "kfir", + email: "kfir@gmail.com", + }]; +} +function sendError(error: string): void { + throw new Error(error); +} + + +const data = getFromDb(); +const name = data[0].name; +const email = data[0].email; +console.log(data); diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..6f60f3a --- /dev/null +++ b/src/types.ts @@ -0,0 +1,4 @@ +export interface User { + name: string; + email: string; +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..64c2ec2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "exclude": ["__tests__"], + "compilerOptions": { + "module": "CommonJS", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "target": "es2022", + "moduleResolution": "node", + "sourceMap": true, + "outDir": "./dist", + "rootDir": "./src", + "noImplicitAny": true, + } +} \ No newline at end of file