Skip to main content
Module

x/etag_parser/parse.ts>parseETag

HTTP ETag header field parser
Latest
function parseETag
import { parseETag } from "https://deno.land/x/etag_parser@1.1.0/parse.ts";

Parses string into ETag.

Examples

Example 1

import { parseETag } from "https://deno.land/x/etag_parser@$VERSION/parse.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";

assertEquals(parseETag(`W/"123456789"`), { tag: "123456789", weak: true });
assertEquals(parseETag(`"123456789"`), { tag: "123456789", weak: false });

Parameters

input: string

Any string