From 7f0e54b29d24138be1eb854ea8c68ad3a2dff062 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Fri, 19 Feb 2021 16:14:38 +0100 Subject: [PATCH] refactor: docs and makefile --- Makefile | 6 +++--- cli.ts | 2 +- src/types/id.ts | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8060b47..56fdc5a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -.PHONY: run -run: - deno run --watch --unstable src/index.ts +.PHONY: cli +cli: + deno run cli.ts tests: deno test --coverage --unstable \ No newline at end of file diff --git a/cli.ts b/cli.ts index d7741b7..8538b2f 100644 --- a/cli.ts +++ b/cli.ts @@ -1,5 +1,5 @@ import { readLines } from "https://deno.land/std@0.87.0/io/bufio.ts"; -import { ID, sayHello, sayRandomHello, ValidationError } from "./src"; +import { ID, sayHello, sayRandomHello, ValidationError } from "./src/index.ts"; const start = async () => { console.log("Hello, World! (International version)\n"); diff --git a/src/types/id.ts b/src/types/id.ts index e77eeea..9ae86a7 100644 --- a/src/types/id.ts +++ b/src/types/id.ts @@ -1,11 +1,12 @@ import { localesSize } from "../repositories/locales.ts"; import { ValidationError } from "../errors/exceptions.ts"; -/** - * ID is the input type. - * It validates input value at creation - */ export class ID { + /** + * ID is the input type. + * It validates input value at creation + * @throws ValidationError if value is not in the accepted range + */ constructor(public value: number) { this.#validate(value); }