Skip to content
Myr

fix: add return types of void function (#2870)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* fix * chore: format

authored by Ame_x · committed by GitHub · parent c8beddb · Browse files · 6 files+20 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+20 added−16 removed

  • other:+20 added−16 removed

6 files+20 added−16 removed

modified:src/adapter/aws-lambda/handler.ts+1 added-1 removed
93 unmodified lines
9495const streamToNodeStream = async (96 reader: ReadableStreamDefaultReader<Uint8Array>,97 writer: NodeJS.WritableStream98) => {98): Promise<void> => {99 let readResult = await reader.read()100 while (!readResult.done) {101 writer.write(readResult.value)102 readResult = await reader.read()
373 unmodified lines
modified:src/helper/dev/index.ts+1 added-1 removed
modified:src/helper/streaming/sse.ts+1 added-1 removed
modified:src/jsx/dom/render.ts+15 added-11 removed
112 unmodified lines
113 key.match(/^(?:o|pai|str|u|ve)/)) // Other un-deprecated kebab-case attributes. "overline-position", "paint-order", "strikethrough-position", etc.114 ? key.replace(/([A-Z])/g, '-$1').toLowerCase()115 : key116117const applyProps = (container: SupportedElement, attributes: Props, oldAttributes?: Props) => {117const applyProps = (118 container: SupportedElement,119 attributes: Props,120 oldAttributes?: Props121): void => {122 attributes ||= {}123 for (const [key, value] of Object.entries(attributes)) {124 if (!skipProps.has(key) && (!oldAttributes || oldAttributes[key] !== value)) {125 const eventSpec = getEventSpec(key)
112 unmodified lines
238 container: Container,239 nextChildren: Node[],240 childrenToRemove: Node[],241 callbacks: EffectData[]238) => {242): void => {243 childrenToRemove.push(...node.vR)244 if (typeof node.tag === 'function') {245 node[DOM_STASH][1][STASH_EFFECT]?.forEach((data: EffectData) => callbacks.push(data))246 }
32 unmodified lines
279280 return findInsertBefore(node.nN)281}282279const removeNode = (node: Node) => {283const removeNode = (node: Node): void => {284 if (!isNodeString(node)) {285 node[DOM_STASH]?.[1][STASH_EFFECT]?.forEach((data: EffectData) => data[2]?.())286287 if (node.e && node.props?.ref) {
13 unmodified lines
301 fallbackUpdateFnArrayMap.delete(node)302 }303}304301const apply = (node: NodeObject, container: Container) => {305const apply = (node: NodeObject, container: Container): void => {306 node.c = container307 applyNodeObject(node, container)308}309306const applyNode = (node: Node, container: Container) => {310const applyNode = (node: Node, container: Container): void => {311 if (isNodeString(node)) {312 container.textContent = node.t313 } else {314 applyNodeObject(node, container)
16 unmodified lines
331332 return333}334331const applyNodeObject = (node: NodeObject, container: Container) => {335const applyNodeObject = (node: NodeObject, container: Container): void => {336 const next: Node[] = []337 const remove: Node[] = []338 const callbacks: EffectData[] = []339 getNextChildren(node, container, next, remove, callbacks)
186 unmodified lines
526 return node as NodeObject527 }528}529526const replaceContainer = (node: NodeObject, from: DocumentFragment, to: Container) => {530const replaceContainer = (node: NodeObject, from: DocumentFragment, to: Container): void => {531 if (node.c === from) {532 node.c = to533 node.vC.forEach((child) => replaceContainer(child as NodeObject, from, to))534 }535}536533const updateSync = (context: Context, node: NodeObject) => {537const updateSync = (context: Context, node: NodeObject): void => {538 node[DOM_STASH][2]?.forEach(([c, v]) => {539 c.values.push(v)540 })541 build(context, node, undefined)
51 unmodified lines
593594 return promise595}596593export const renderNode = (node: NodeObject, container: Container) => {597export const renderNode = (node: NodeObject, container: Container): void => {598 const context: Context = []599 ;(context as Context)[4] = true // start top level render600 build(context, node, undefined)601 ;(context as Context)[4] = false // finish top level render
3 unmodified lines
605 replaceContainer(node, fragment, container)606 container.replaceChildren(fragment)607}608605export const render = (jsxNode: Child, container: Container) => {609export const render = (jsxNode: Child, container: Container): void => {610 // eslint-disable-next-line @typescript-eslint/no-explicit-any611 renderNode(buildNode({ tag: '', props: { children: jsxNode } } as any) as NodeObject, container)612}613610export const flushSync = (callback: () => void) => {614export const flushSync = (callback: () => void): void => {615 const set = new Set<NodeObject>()616 currentUpdateSets.push(set)617 callback()618 set.forEach((node) => {
19 unmodified lines
modified:src/context.ts+1 added-1 removed
393 unmodified lines
394 * })395 * ```396 * @see https://hono.dev/api/context#render-setrenderer397 */398 setRenderer = (renderer: Renderer) => {398 setRenderer = (renderer: Renderer): void => {399 this.renderer = renderer400 }401402 /**
316 unmodified lines
modified:src/hono-base.ts+1 added-1 removed
424 unmodified lines
425 * @see https://hono.dev/api/hono#fire426 * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API427 * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/428 */429 fire = () => {429 fire = (): void => {430 // eslint-disable-next-line @typescript-eslint/ban-ts-comment431 // @ts-ignore432 addEventListener('fetch', (event: FetchEventLike): void => {433 event.respondWith(this.dispatch(event.request, event, undefined, event.request.method))
5 unmodified lines