This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const messageFunc = (message: string) => { | |
return `Here is your message: ${message}`; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const userFunc = (user: string) => { | |
return `Here is your user: ${user}`; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IUser } from "@interfaces/user"; | |
export const isUsersNameJesse = (user: IUser): boolean => { | |
return user.name === "Jesse"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IMessage, IUser } from "@interfaces"; | |
import { isUsersNameJesse, message } from "@utils"; | |
import express from "express"; | |
const app = express(); | |
app.get("/", (request, response) => { | |
const user: IUser = { name: "Jesse", age: 31 }; | |
const msg: IMessage = { body: "Sending User" }; | |
if (isUsersNameJesse(user)) message({ body: "Hello Jesse" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IUser, IMessage } from "@interfaces"; | |
import { message } from "@utils/common/common"; | |
import express from "express"; | |
const app = express(); | |
app.get("/", (request, response) => { | |
const user: IUser = { name: "Jesse", age: 31 }; | |
const msg: IMessage = { body: "Sending User" } | |
message(msg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export * from "./message"; | |
export * from "./user"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IUser } from "@interfaces/user"; | |
import { IMessage } from "@interfaces/message"; | |
import { message } from "@utils/common/common"; | |
import { isUsersNameJesse } from "@utils/user/user" | |
import express from "express"; | |
const app = express(); | |
app.get("/", (request, response) => { | |
const user: IUser = { name: "Jesse", age: 31 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var __importDefault = (this && this.__importDefault) || function (mod) { | |
return (mod && mod.__esModule) ? mod : { "default": mod }; | |
}; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
var common_1 = require("./utils/common/common"); // <-- alias is now relative path | |
var express_1 = __importDefault(require("express")); | |
var app = (0, express_1.default)(); | |
app.get("/", function (request, response) { | |
var user = { name: "Jesse", age: 31 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var __importDefault = (this && this.__importDefault) || function (mod) { | |
return (mod && mod.__esModule) ? mod : { "default": mod }; | |
}; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
var common_1 = require("@utils/common/common"); // <--- alias has been carried through | |
var express_1 = __importDefault(require("express")); | |
var app = (0, express_1.default)(); | |
app.get("/", function (request, response) { | |
var user = { name: "Jesse", age: 31 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IUser } from "@interfaces/user"; | |
import { message } from "@utils/common/common"; | |
import express from "express"; | |
const app = express(); | |
app.get("/", (request, response) => { | |
const user: IUser = { name: "Jesse", age: 31 }; | |
message("Sending User"); | |
response.send(user); |