Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Mar 21, 2023
1 parent 7b5f6ab commit 4dc0915
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "restricted"
},
"version": "1.0.61",
"version": "1.0.62",
"license": "GPL-3.0-or-later",
"name": "@clevercanyon/utilities.cfw",
"description": "Utilities for JavaScript apps running in a Cloudflare Worker environment.",
Expand Down
12 changes: 6 additions & 6 deletions src/cfw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import { $env, $http, $str, $url } from '@clevercanyon/utilities';
/**
* Environment.
*/
export interface Environment {
export type Environment = {
readonly R2?: R2Bucket;
readonly KV?: KVNamespace;
readonly DO?: DurableObjectNamespace;
readonly __STATIC_CONTENT?: KVNamespace;
readonly [x: string]: unknown;
}
};

/**
* Route interface.
Expand All @@ -32,21 +32,21 @@ export type Route = (x: FetchEventData) => Promise<Response>;
/**
* Routes interface.
*/
export interface Routes {
export type Routes = {
readonly subpathGlobs: {
readonly [x: string]: Route;
};
}
};

/**
* Initial fetch event data.
*/
interface InitialFetchEventData {
type InitialFetchEventData = {
readonly request: Request;
readonly env: Environment;
readonly ctx: ExecutionContext;
readonly routes: Routes;
}
};

/**
* Fetch event data.
Expand Down
4 changes: 2 additions & 2 deletions src/geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { FetchEventData } from './cfw.js';
*
* @returns Geo property value.
*/
export function prop(fed: FetchEventData, prop: string): string {
export const prop = (fed: FetchEventData, prop: string): string => {
const { request: r } = fed; // Request extraction.
return String(r.cf && prop in r.cf ? r.cf[prop as keyof typeof r.cf] || '' : '');
}
};

0 comments on commit 4dc0915

Please sign in to comment.