mirror of
https://github.com/kou029w/websri.git
synced 2025-01-18 16:08:16 +00:00
update examples
This commit is contained in:
parent
f2854638df
commit
f4c800793b
1 changed files with 20 additions and 20 deletions
40
src/index.ts
40
src/index.ts
|
@ -136,16 +136,16 @@ export class IntegrityMetadata implements IntegrityMetadataLike {
|
||||||
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
||||||
* @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* integrityMetadata.match({
|
* integrityMetadata.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
||||||
* alg: "sha256",
|
|
||||||
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
|
||||||
* })
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* integrityMetadata.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
* integrityMetadata.match({
|
||||||
|
* alg: "sha256",
|
||||||
|
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
|
* })
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
match(integrity: IntegrityMetadataLike | string | null | undefined): boolean {
|
match(integrity: IntegrityMetadataLike | string | null | undefined): boolean {
|
||||||
|
@ -252,22 +252,22 @@ export class IntegrityMetadataSet {
|
||||||
* @param options Optional configuration options for hash algorithm prioritization.
|
* @param options Optional configuration options for hash algorithm prioritization.
|
||||||
* @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* new IntegrityMetadataSet(`
|
|
||||||
* sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=
|
|
||||||
* sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r
|
|
||||||
* sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ==
|
|
||||||
* `)
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* or
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* new IntegrityMetadataSet([
|
* new IntegrityMetadataSet([
|
||||||
* "sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
* "sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
* "sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r",
|
* "sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r",
|
||||||
* "sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ==",
|
* "sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ==",
|
||||||
* ])
|
* ])
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* or
|
||||||
|
*
|
||||||
|
* ```js
|
||||||
|
* new IntegrityMetadataSet(`
|
||||||
|
* sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=
|
||||||
|
* sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r
|
||||||
|
* sha512-wVJ82JPBJHc9gRkRlwyP5uhX1t9dySJr2KFgYUwM2WOk3eorlLt9NgIe+dhl1c6ilKgt1JoLsmn1H256V/eUIQ==
|
||||||
|
* `)
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
integrity:
|
integrity:
|
||||||
|
@ -355,16 +355,16 @@ export class IntegrityMetadataSet {
|
||||||
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
||||||
* @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* integrityMetadataSet.match({
|
* integrityMetadataSet.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
||||||
* alg: "sha256",
|
|
||||||
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
|
||||||
* })
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* integrityMetadataSet.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
* integrityMetadataSet.match({
|
||||||
|
* alg: "sha256",
|
||||||
|
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
|
* })
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
match(integrity: IntegrityMetadataLike | string | null | undefined): boolean {
|
match(integrity: IntegrityMetadataLike | string | null | undefined): boolean {
|
||||||
|
|
Loading…
Add table
Reference in a new issue