-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
591 additions
and
580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"extends": [ | ||
"@nuxtjs/eslint-config-typescript" | ||
] | ||
"eslint-config-unjs" | ||
], | ||
"rules": { | ||
"no-undef": 0, | ||
"unicorn/consistent-destructuring": 0, | ||
"unicorn/no-await-expression-member": 0, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 - UnJS | ||
Copyright (c) Pooya Parsa <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
import { defineBuildConfig } from "unbuild"; | ||
|
||
export default defineBuildConfig({ | ||
declaration: true, | ||
emitCJS: false, | ||
rollup: { | ||
emitCJS: true | ||
}, | ||
entries: [ | ||
'src/index', | ||
'src/node', | ||
'src/undici' | ||
"src/index", | ||
"src/node", | ||
"src/undici" | ||
] | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './dist/node' | ||
export * from "./dist/node"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,25 +49,25 @@ | |
"test": "pnpm lint && vitest run --coverage" | ||
}, | ||
"dependencies": { | ||
"destr": "^1.2.0", | ||
"node-fetch-native": "^0.1.8", | ||
"ufo": "^0.8.6", | ||
"destr": "^1.2.1", | ||
"node-fetch-native": "^1.0.1", | ||
"ufo": "^1.0.0", | ||
"undici": "^5.12.0" | ||
}, | ||
"devDependencies": { | ||
"@nuxtjs/eslint-config-typescript": "^11.0.0", | ||
"@types/node": "^18.11.9", | ||
"@vitest/coverage-c8": "^0.25.1", | ||
"@vitest/coverage-c8": "^0.25.2", | ||
"eslint": "^8.27.0", | ||
"eslint-config-unjs": "^0.0.2", | ||
"fetch-blob": "^3.2.0", | ||
"formdata-polyfill": "^4.0.10", | ||
"h3": "^0.8.6", | ||
"h3": "^1.0.1", | ||
"jiti": "^1.16.0", | ||
"listhen": "^0.3.5", | ||
"listhen": "^1.0.0", | ||
"standard-version": "^9.5.0", | ||
"typescript": "^4.8.4", | ||
"unbuild": "^0.9.4", | ||
"vitest": "^0.25.1" | ||
"vitest": "^0.25.2" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { $fetch } from '../src/node' | ||
import { $fetch } from "../src/node"; | ||
|
||
async function main () { | ||
// const r = await $fetch<string>('http://google.com/404') | ||
const r = await $fetch<string>('http://httpstat.us/500') | ||
const r = await $fetch<string>("http://httpstat.us/500"); | ||
// const r = await $fetch<string>('http://httpstat/500') | ||
// eslint-disable-next-line no-console | ||
console.log(r) | ||
console.log(r); | ||
} | ||
|
||
main().catch((err) => { | ||
// eslint-disable-next-line unicorn/prefer-top-level-await | ||
main().catch((error) => { | ||
// eslint-disable-next-line no-console | ||
console.error(err) | ||
process.exit(1) | ||
}) | ||
console.error(error); | ||
// eslint-disable-next-line unicorn/no-process-exit | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { $fetch } from '../src/undici' | ||
import { $fetch } from "../src/undici"; | ||
|
||
async function main () { | ||
const r = await $fetch<string>('http://google.com/404') | ||
const r = await $fetch<string>("http://google.com/404"); | ||
// eslint-disable-next-line no-console | ||
console.log(r) | ||
console.log(r); | ||
} | ||
|
||
main().catch((err) => { | ||
// eslint-disable-next-line unicorn/prefer-top-level-await | ||
main().catch((error) => { | ||
// eslint-disable-next-line no-console | ||
console.error(err) | ||
process.exit(1) | ||
}) | ||
console.error(error); | ||
// eslint-disable-next-line unicorn/no-process-exit | ||
process.exit(1); | ||
}); |
Oops, something went wrong.