Skip to content

Commit

Permalink
Merge branch 'main' into Quests
Browse files Browse the repository at this point in the history
  • Loading branch information
MDaffyduck authored Jan 13, 2025
2 parents 056068c + a5f0f1c commit b3daea4
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 39 deletions.
19 changes: 0 additions & 19 deletions .eslintrc.yaml

This file was deleted.

21 changes: 20 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
permissions:
id-token: write
jobs:
publish:
npm:
name: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -27,3 +28,21 @@ jobs:
run: pnpm publish --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
jsr:
name: JSR
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- name: Install dependencies
uses: pnpm/action-setup@v4
with:
version: 9.14.2
run_install: |
- args: [--frozen-lockfile]
- name: Publish package
run: pnpm dlx jsr publish
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

2 changes: 0 additions & 2 deletions .prettierrc.yaml

This file was deleted.

8 changes: 6 additions & 2 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@runescape/runescape",
"version": "0.9.0",
"exports": "./source/index.ts"
"version": "0.10.5",
"exports": "./source/index.ts",
"publish": {
"include": ["source/", "README.md"]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "runescape",
"version": "0.10.4",
"version": "0.10.5",
"description": "A library to interact with the non-existent RuneScape API.",
"keywords": ["RuneScape", "Jagex", "RS3"],
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions source/hi-scores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,17 @@ export interface GroupIronmanHiScoreOptions {
/**
* The size of the page.
*/
size?: number;
size?: number | undefined;
/**
* The page number.
*
* @remarks The page number is 0-indexed.
*/
page?: number;
page?: number | undefined;
/**
* Whether the group is competitive.
*/
isCompetitive?: boolean;
isCompetitive?: boolean | undefined;
/**
* The abort signal for the fetch.
*/
Expand Down
8 changes: 4 additions & 4 deletions source/miscellaneous.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export interface AvatarOptions {
*
* @remarks 100 is the maximum number the width abides by.
*/
width?: number;
width?: number | undefined;
/**
* The desired height.
*
* @remarks 100 is the maximum number the height abides by.
*/
height?: number;
height?: number | undefined;
}

/**
Expand All @@ -33,11 +33,11 @@ export interface AvatarOptions {
export function avatar({ name, width, height }: AvatarOptions): string {
const urlSearchParams = new URLSearchParams();

if (typeof width === "number") {
if (width !== undefined) {
urlSearchParams.set("w", String(width));
}

if (typeof height === "number") {
if (height !== undefined) {
urlSearchParams.set("h", String(height));
}

Expand Down
4 changes: 2 additions & 2 deletions source/rune-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export interface ProfileOptions {
*
* @remarks 20 is the maximum number this limit abides by.
*/
activities?: number;
activities?: number | undefined;
/**
* The abort signal for the fetch.
*/
Expand All @@ -246,7 +246,7 @@ export async function profile({ name, activities, abortSignal }: ProfileOptions)
const urlSearchParams = new URLSearchParams();
urlSearchParams.set("user", name);

if (typeof activities === "number") {
if (activities !== undefined) {
urlSearchParams.set("activities", String(activities));
}

Expand Down
2 changes: 1 addition & 1 deletion source/utility/make-request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function makeRequest(url: string, abortSignal?: AbortSignal) {
export function makeRequest(url: string, abortSignal: AbortSignal | undefined) {
const options: RequestInit = {};

if (abortSignal) {
Expand Down
2 changes: 1 addition & 1 deletion source/wilderness-warbands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @returns Whether a Wilderness Warbands camp is set up.
* @see {@link https://runescape.wiki/w/Wilderness_Warbands}
*/
export function wildernessWarbands(timestamp: number) {
export function wildernessWarbands(timestamp: number): boolean {
const date = new Date(timestamp);
const start = new Date(date);
start.setUTCDate(date.getUTCDate() - ((date.getUTCDay() + 6) % 7));
Expand Down

0 comments on commit b3daea4

Please sign in to comment.