Skip to content
Myr

handler.test.ts

This file

Path

src/adapter/lambda-edge/handler.test.ts

17 lines · 861 bytes · TypeScript

Last changed by

fix: add missing tail to svg regex (#1788)Elias Brangebefore adoption521db64

History of this file

Take it

The walk stopped after 200 commits: lines older than 48a8729 point at it.

perf(hono-base): use `constructor.name` instead of `instanceof` (#1311)Yusuke Wadabefore adoption48a8729

lines 1–6why, one step back
1import { isContentTypeBinary } from './handler'
23describe('isContentTypeBinary', () => {4 it('Should determine whether it is binary', () => {5 expect(isContentTypeBinary('image/png')).toBe(true)6 expect(isContentTypeBinary('font/woff2')).toBe(true)

fix: add missing tail to svg regex (#1788)Elias Brangebefore adoption521db64

lines 7–8why, one step back
7 expect(isContentTypeBinary('image/svg+xml')).toBe(false)
8 expect(isContentTypeBinary('image/svg+xml; charset=UTF-8')).toBe(false)

perf(hono-base): use `constructor.name` instead of `instanceof` (#1311)Yusuke Wadabefore adoption48a8729

lines 9–17why, one step back
9 expect(isContentTypeBinary('text/plain')).toBe(false)
10 expect(isContentTypeBinary('text/plain; charset=UTF-8')).toBe(false)11 expect(isContentTypeBinary('text/css')).toBe(false)12 expect(isContentTypeBinary('text/javascript')).toBe(false)13 expect(isContentTypeBinary('application/json')).toBe(false)14 expect(isContentTypeBinary('application/ld+json')).toBe(false)15 expect(isContentTypeBinary('application/json; charset=UTF-8')).toBe(false)16 })17})