Skip to content

Commit

Permalink
Some nits (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek authored Mar 11, 2024
1 parent b998db1 commit 60e937a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build & test

on:
Expand All @@ -14,14 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: 20
cache: yarn

- run: yarn install --pure-lockfile
- run: yarn typecheck
- run: yarn test
- run: yarn build
- run: yarn build
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Release

on:
Expand All @@ -9,15 +6,15 @@ on:
- "v*"

jobs:
build:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: 20
cache: yarn

- run: yarn install --pure-lockfile
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Swan
Copyright (c) 2024 Swan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Request.make({ url: "/api/health" }).onResolve(console.log);
// Result.Ok({status: 200, ok: true, response: Option.Some("{\"ok\":true}")})

// Timeout
Request.make({ url: "/api/health", timeout: 50 }).onResolve(console.log);
Request.make({ url: "/api/health", timeout: 2000 }).onResolve(console.log);
// Result.Error(TimeoutError)

// Network error
Expand Down
1 change: 1 addition & 0 deletions src/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type JsonValue = JsonPrimitive | JsonObject | JsonArray;

// The type system allows us infer the response type from the requested `responseType`
type ResponseType = "text" | "arraybuffer" | "document" | "blob" | "json";

type ResponseTypeMap = {
text: string;
arraybuffer: ArrayBuffer;
Expand Down
18 changes: 13 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{
"include": ["src"],
"compilerOptions": {
"module": "ES2015",
"target": "ES2015",
"lib": ["DOM", "DOM.Iterable", "ES2017"],
"module": "ESNext",
"target": "ES2018",
"lib": ["DOM", "DOM.Iterable", "ES2018"],
"moduleResolution": "Node",
"outDir": "dist/",

"allowJs": false,
"declaration": true,
"esModuleInterop": true,
"noEmit": true,
"sourceMap": true,
"strict": true,
"skipLibCheck": true,
"stripInternal": true,

// https://www.typescriptlang.org/tsconfig#Type_Checking_6248
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": false,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true
"noUnusedLocals": true,
"noUnusedParameters": true
}
}

0 comments on commit 60e937a

Please sign in to comment.