Warn! Text encoding for urls has not been implemented.
package main
import "fmt"
type Parrams struct {
import { useCalendar } from '@h6s/calendar'; | |
import { useMachine } from '@xstate/react'; | |
import { Button as AriaButton } from 'ariakit/button'; | |
import clsx from 'clsx'; | |
import { isSunday, isSameDay, addMonths, isFuture, isPast, setDate } from 'date-fns'; | |
import format from 'date-fns/format'; | |
import isWithinInterval from 'date-fns/isWithinInterval'; | |
import { FC, useCallback, useMemo } from 'react'; | |
import Select from '@components/forms/components/Select'; |
type IO<T, Input = never> = Input extends never ? () => T : (input: Input) => T; | |
export type InputType = 'text' | 'number' | 'password' | 'email' | 'date' | 'time' | 'datetime-local' | 'month' | 'week' | 'url' | 'search' | 'tel' | 'color'; | |
export type BaseInput<Shape extends object, Metadata = Record<string, any>> = { | |
placeholder?: string; | |
required?: string | boolean; | |
disabled?: string | boolean; | |
readonly?: string | boolean; | |
autofocus?: string | boolean; |
{ | |
"PolymorphicFunctionComponent": { | |
"prefix": "fncpp", | |
"description": "React Function Component (Polymorphic)", | |
"body": [ | |
"import React from \"react\";", | |
"", | |
"interface PolymorphicProps<C extends React.ElementType> {", | |
"\tas?: C", | |
"}", |
const links = ` | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;600;700;800&display=swap" rel="stylesheet"> | |
` | |
const data = links.split('\n').map(l => l.trim()).filter(Boolean).map(link => { | |
const relRe = /rel="(?<rel>.*?)"/ | |
const hrefRe = /href="(?<href>.*?)"/ |
export class Numbers { | |
#data: number[]; | |
#max = 0; | |
addNumber(num: number) { | |
this.#max = Math.max(num, this.#max); | |
this.#data.push(num); | |
} | |
getAll(): number[] { |
import * as RD from '@devexperts/remote-data-ts'; | |
import * as E from 'fp-ts/Either'; | |
import { flow, Lazy, pipe } from 'fp-ts/lib/function'; | |
import * as T from 'fp-ts/Task'; | |
import * as TE from 'fp-ts/TaskEither'; | |
import Task = T.Task; | |
import Either = E.Either; | |
import TaskEither = TE.TaskEither; | |
import RemoteData = RD.RemoteData; |
import type { NextApiResponse } from 'next/types' | |
export default class HTTPError extends Error { | |
status: number | |
_tag: 'HTTPError' = 'HTTPError' as const | |
constructor( status: number, message: string ) { | |
super( message ) | |
this.status = status | |
} |
// for custom model validation (inspired by ZOD) | |
type StringType = { | |
_type: 'STRING' | |
} | |
type DateType = { | |
_type: 'DATE' | |
} |