fix: resolve all lint warnings and fix failing playground toolbar test
- Fix playground-toolbar test: URL changed to github.com but test still expected docs.emdashcms.com - create-emdash: extract selectTemplate() to eliminate unsafe/unnecessary type assertions - create-emdash: use type-safe Object.keys filter instead of bare cast - cloudflare/cache: use Reflect.get with typeof guard instead of double type assertion - x402/enforcer: replace unsafe request cast with Reflect.get type guards for CF bot management - x402/middleware: suppress unavoidable virtual module any-cast with eslint comment
This commit is contained in:
4
packages/cloudflare/src/cache/runtime.ts
vendored
4
packages/cloudflare/src/cache/runtime.ts
vendored
@@ -134,7 +134,9 @@ function normalizeCacheKey(url: URL): string {
|
||||
*/
|
||||
function resolveEnvValue(explicit: string | undefined, envVarName: string): string | undefined {
|
||||
if (explicit) return explicit;
|
||||
return (env as Record<string, unknown>)[envVarName] as string | undefined;
|
||||
if (!(envVarName in env)) return undefined;
|
||||
const value: unknown = Reflect.get(env, envVarName);
|
||||
return typeof value === "string" ? value : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ describe("renderPlaygroundToolbar", () => {
|
||||
it("renders the deploy CTA link", () => {
|
||||
const html = renderPlaygroundToolbar(BASE_CONFIG);
|
||||
expect(html).toContain("Deploy your own");
|
||||
expect(html).toContain("docs.emdashcms.com/getting-started");
|
||||
expect(html).toContain("github.com/emdash-cms/emdash");
|
||||
});
|
||||
|
||||
it("renders reset and dismiss buttons", () => {
|
||||
|
||||
Reference in New Issue
Block a user