Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


Deno standard library
Go to Latest
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license./** Returns true if the etags match. Weak etag comparisons are handled. */export function compareEtag(a: string, b: string): boolean { if (a === b) { return true; } if (a.startsWith("W/") && !b.startsWith("W/")) { return a.slice(2) === b; } if (!a.startsWith("W/") && b.startsWith("W/")) { return a === b.slice(2); } return false;}