This commit is contained in:
Kfir Dayan 2023-09-11 15:47:30 +03:00
parent 42d89b893a
commit 8e07fd97b3
7 changed files with 56 additions and 0 deletions

16
dist/index.js vendored Normal file
View file

@ -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

1
dist/index.js.map vendored Normal file
View file

@ -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"}

3
dist/types.js vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

1
dist/types.js.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}

17
src/index.ts Normal file
View file

@ -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);

4
src/types.ts Normal file
View file

@ -0,0 +1,4 @@
export interface User {
name: string;
email: string;
}

14
tsconfig.json Normal file
View file

@ -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,
}
}