Skip to content

Commit

Permalink
Add extension helper property to input.file result
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmischka committed Jun 27, 2022
1 parent c6c70f8 commit a458e26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/upload.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path'
import fetch, { Response } from 'node-fetch'
import { IntervalError } from '..'
import { T_IO_PROPS, T_IO_RETURNS } from '../ioSchema'
Expand All @@ -8,6 +9,9 @@ export function file(_: T_IO_PROPS<'UPLOAD_FILE'>) {
return {
...response,
lastModified: new Date(response.lastModified),
get extension(): string {
return path.extname(response.name)
},
async url(): Promise<string> {
return url
},
Expand Down

0 comments on commit a458e26

Please sign in to comment.