From f4c800793bb58aa01732c6af88b2d1805cb4b5be Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 6 Nov 2024 11:31:33 +0900 Subject: [PATCH] update examples --- src/index.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/index.ts b/src/index.ts index eadb9df..089f244 100644 --- a/src/index.ts +++ b/src/index.ts @@ -136,16 +136,16 @@ export class IntegrityMetadata implements IntegrityMetadataLike { * @returns `true` if the integrity metadata matches, `false` otherwise. * @example * ```js - * integrityMetadata.match({ - * alg: "sha256", - * val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=", - * }) + * integrityMetadata.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=") * ``` * * or * * ```js - * integrityMetadata.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=") + * integrityMetadata.match({ + * alg: "sha256", + * val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=", + * }) * ``` */ match(integrity: IntegrityMetadataLike | string | null | undefined): boolean { @@ -252,22 +252,22 @@ export class IntegrityMetadataSet { * @param options Optional configuration options for hash algorithm prioritization. * @example * ```js - * new IntegrityMetadataSet(` - * sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM= - * sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r - * sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ== - * `) - * ``` - * - * or - * - * ```js * new IntegrityMetadataSet([ * "sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=", * "sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r", * "sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ==", * ]) * ``` + * + * or + * + * ```js + * new IntegrityMetadataSet(` + * sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM= + * sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r + * sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ== + * `) + * ``` */ constructor( integrity: @@ -355,16 +355,16 @@ export class IntegrityMetadataSet { * @returns `true` if the integrity metadata matches, `false` otherwise. * @example * ```js - * integrityMetadataSet.match({ - * alg: "sha256", - * val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=", - * }) + * integrityMetadataSet.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=") * ``` * * or * * ```js - * integrityMetadataSet.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=") + * integrityMetadataSet.match({ + * alg: "sha256", + * val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=", + * }) * ``` */ match(integrity: IntegrityMetadataLike | string | null | undefined): boolean {