if .properties dont exist shouldn't .properties.periods be undefined? and if it is, i do check that
if .properties dont exist shouldn't .properties.periods be undefined?
and if it is, i do check that
and if it is, i do check that
export function exists<T>(data: T|null|undefined): data is T {
if (
(data === null) ||
(data === undefined)
) return false;
return true;
}.properties.periods would throw a TypeError if properties doesn't exist. For example:
performance.now() isn’t available in Workers and Date.now() doesn’t increment unless you do I/O is there any way to actually benchmark CPU bound function execution times in a worker?performance.now() is available but it just calls Date.now()internal server error anyplace to look to see better logging?app.onError to add your own handlerproduction stuff on the dashboard entirely right now
request.cf.colorequest.cf.region for more region like info
.properties.periodsTypeErrorperformance.now()performance.now()Date.now()Date.now()internal server errorrequest.cf.colorequest.cf.regionconst obj = {foo: 'bar'}
console.log(obj.foo) // bar
console.log(obj.bar) // undefined
console.log(obj.bar.baz) // TypeErrorimport { Hono } from 'hono'
import { Client } from 'pg'
const app = new Hono()
const connstring = "postgresql://postgres@localhost:5432/hhscdev?schema=public"
app.get('*', async (c) => {
const client = new Client("postgresql://postgres@localhost:5432/hhscdev?schema=public");
await client.connect();
const { rows: [{ now }] } = await client.query('select now();');
return c.text(`Hello Hono! ${now}`)
})
export default app