mirror of
https://github.com/rjNemo/deno_hello
synced 2026-06-06 01:56:40 +00:00
refactor: docs and makefile
This commit is contained in:
parent
328eef7876
commit
7f0e54b29d
3 changed files with 9 additions and 8 deletions
6
Makefile
6
Makefile
|
|
@ -1,5 +1,5 @@
|
||||||
.PHONY: run
|
.PHONY: cli
|
||||||
run:
|
cli:
|
||||||
deno run --watch --unstable src/index.ts
|
deno run cli.ts
|
||||||
tests:
|
tests:
|
||||||
deno test --coverage --unstable
|
deno test --coverage --unstable
|
||||||
2
cli.ts
2
cli.ts
|
|
@ -1,5 +1,5 @@
|
||||||
import { readLines } from "https://deno.land/std@0.87.0/io/bufio.ts";
|
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 () => {
|
const start = async () => {
|
||||||
console.log("Hello, World! (International version)\n");
|
console.log("Hello, World! (International version)\n");
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import { localesSize } from "../repositories/locales.ts";
|
import { localesSize } from "../repositories/locales.ts";
|
||||||
import { ValidationError } from "../errors/exceptions.ts";
|
import { ValidationError } from "../errors/exceptions.ts";
|
||||||
|
|
||||||
/**
|
|
||||||
* ID is the input type.
|
|
||||||
* It validates input value at creation
|
|
||||||
*/
|
|
||||||
export class ID {
|
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) {
|
constructor(public value: number) {
|
||||||
this.#validate(value);
|
this.#validate(value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue