This commit is contained in:
miqlangelo 2025-05-07 09:24:57 +02:00
parent 5ecf7c5b65
commit ff88494585
10 changed files with 89 additions and 1 deletions

View File

@ -1,3 +1,3 @@
{
"deno.enable": true
"deno.enable": false
}

BIN
robo-readme.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,10 @@
{
"tasks": {
"dev": "deno run --watch ./src/main.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"date-fns": "npm:date-fns"
}
}

30
src/08-code-organisation/deno.lock generated Normal file
View File

@ -0,0 +1,30 @@
{
"version": "5",
"specifiers": {
"jsr:@std/assert@1": "1.0.11",
"jsr:@std/internal@^1.0.5": "1.0.5",
"npm:date-fns@*": "4.1.0"
},
"jsr": {
"@std/assert@1.0.11": {
"integrity": "2461ef3c368fe88bc60e186e7744a93112f16fd110022e113a0849e94d1c83c1",
"dependencies": [
"jsr:@std/internal"
]
},
"@std/internal@1.0.5": {
"integrity": "54a546004f769c1ac9e025abd15a76b6671ddc9687e2313b67376125650dc7ba"
}
},
"npm": {
"date-fns@4.1.0": {
"integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg=="
}
},
"workspace": {
"dependencies": [
"jsr:@std/assert@1",
"npm:date-fns@*"
]
}
}

View File

@ -0,0 +1,6 @@
import { add, log as alternativLog, log } from '@utils';
const today = new Date();
console.log('Addition: ', add(5, 3));
log('Hello from Log');
alternativLog('Hello from alternativ log');

View File

@ -0,0 +1,11 @@
import { addDays, format } from 'date-fns';
const today = new Date();
// console.log('Heute ist: ', format(today, 'yyyy-MM-dd'));
const nextWeek = addDays(today, 7);
// console.log('Nächste Woche: ', format(nextWeek, 'yyyy-MM-dd'));
export const formatDate = (date: Date, formatString = 'yyyy-MM-dd') => {
return format(date, formatString);
};

View File

@ -0,0 +1,3 @@
export * from './dateUtils.ts';
export { default as log } from './logger.ts';
export * from './mathUtils.ts';

View File

@ -0,0 +1,3 @@
export default function log(message: string) {
console.log(`Log: ${message}`);
}

View File

@ -0,0 +1,7 @@
export function add(a: number, b: number): number {
return a + b;
}
export function sub(a: number, b: number): number {
return a - b;
}

View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src"],
"@utils": ["./src/utils/index.ts"]
},
"target": "es2016",
"module": "ESNext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}