Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/workerd/http.js>ifMatch

A JavaScript extension package for building strong and modern applications.
Latest
function ifMatch
Re-export
import { ifMatch } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/workerd/http.js";

Checks if the value from the If-Match header matches the given ETag.

NOTE: Weak tags cannot be matched and will return false.

Examples

Example 1

import { etag, ifMatch } from "@ayonli/jsext/http";

const _etag = await etag("Hello, World!");
const match = ifMatch("d-3/1gIbsr1bCvZ2KQgJ7DpTGR3YH", _etag);
console.log(match); // true

Parameters

value
etag