mirror of
https://github.com/kou029w/websri.git
synced 2025-01-18 16:08:16 +00:00
specify code block syntax
This commit is contained in:
parent
472df9a60f
commit
8f7b6bd105
1 changed files with 12 additions and 12 deletions
24
src/index.ts
24
src/index.ts
|
@ -98,13 +98,13 @@ export class IntegrityMetadata implements IntegrityMetadataLike {
|
||||||
* Creates an instance of `IntegrityMetadata` from a given object or string.
|
* Creates an instance of `IntegrityMetadata` from a given object or string.
|
||||||
* @param integrity The integrity metadata input, which can be a string or object.
|
* @param integrity The integrity metadata input, which can be a string or object.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* new IntegrityMetadata("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
* new IntegrityMetadata("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* ```
|
* ```js
|
||||||
* new IntegrityMetadata({
|
* new IntegrityMetadata({
|
||||||
* alg: "sha256",
|
* alg: "sha256",
|
||||||
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
|
@ -135,7 +135,7 @@ export class IntegrityMetadata implements IntegrityMetadataLike {
|
||||||
* @param integrity The integrity metadata to compare with.
|
* @param integrity The integrity metadata to compare with.
|
||||||
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* integrityMetadata.match({
|
* integrityMetadata.match({
|
||||||
* alg: "sha256",
|
* alg: "sha256",
|
||||||
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
|
@ -144,7 +144,7 @@ export class IntegrityMetadata implements IntegrityMetadataLike {
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* ```
|
* ```js
|
||||||
* integrityMetadata.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
* integrityMetadata.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
@ -177,7 +177,7 @@ export class IntegrityMetadata implements IntegrityMetadataLike {
|
||||||
* @param integrity The integrity metadata object to stringify.
|
* @param integrity The integrity metadata object to stringify.
|
||||||
* @returns The stringified integrity metadata.
|
* @returns The stringified integrity metadata.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* IntegrityMetadata.stringify({
|
* IntegrityMetadata.stringify({
|
||||||
* alg: "sha256",
|
* alg: "sha256",
|
||||||
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
|
@ -199,7 +199,7 @@ export class IntegrityMetadata implements IntegrityMetadataLike {
|
||||||
* @param opt Optional additional attributes.
|
* @param opt Optional additional attributes.
|
||||||
* @returns A promise that resolves to an `IntegrityMetadata` object.
|
* @returns A promise that resolves to an `IntegrityMetadata` object.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* const res = new Response("Hello, world!");
|
* const res = new Response("Hello, world!");
|
||||||
* const data = await res.arrayBuffer();
|
* const data = await res.arrayBuffer();
|
||||||
* const integrityMetadata = await createIntegrityMetadata("sha256", data);
|
* const integrityMetadata = await createIntegrityMetadata("sha256", data);
|
||||||
|
@ -251,7 +251,7 @@ export class IntegrityMetadataSet {
|
||||||
* @param integrity The integrity metadata or an array of integrity metadata.
|
* @param integrity The integrity metadata or an array of integrity metadata.
|
||||||
* @param options Optional configuration options for hash algorithm prioritization.
|
* @param options Optional configuration options for hash algorithm prioritization.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* new IntegrityMetadataSet(`
|
* new IntegrityMetadataSet(`
|
||||||
* sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=
|
* sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=
|
||||||
* sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r
|
* sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r
|
||||||
|
@ -261,7 +261,7 @@ export class IntegrityMetadataSet {
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* ```
|
* ```js
|
||||||
* new IntegrityMetadataSet([
|
* new IntegrityMetadataSet([
|
||||||
* "sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
* "sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
* "sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r",
|
* "sha384-VbxVaw0v4Pzlgrpf4Huq//A1ZTY4x6wNVJTCpkwL6hzFczHHwSpFzbyn9MNKCJ7r",
|
||||||
|
@ -321,7 +321,7 @@ export class IntegrityMetadataSet {
|
||||||
* Enables iteration over the set of integrity metadata.
|
* Enables iteration over the set of integrity metadata.
|
||||||
* @returns A generator that yields each IntegrityMetadata object.
|
* @returns A generator that yields each IntegrityMetadata object.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* [...integrityMetadataSet]
|
* [...integrityMetadataSet]
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
@ -354,7 +354,7 @@ export class IntegrityMetadataSet {
|
||||||
* @param integrity The integrity metadata to match.
|
* @param integrity The integrity metadata to match.
|
||||||
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
* @returns `true` if the integrity metadata matches, `false` otherwise.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* integrityMetadataSet.match({
|
* integrityMetadataSet.match({
|
||||||
* alg: "sha256",
|
* alg: "sha256",
|
||||||
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
* val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||||||
|
@ -363,7 +363,7 @@ export class IntegrityMetadataSet {
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* ```
|
* ```js
|
||||||
* integrityMetadataSet.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
* integrityMetadataSet.match("sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=")
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
@ -407,7 +407,7 @@ export class IntegrityMetadataSet {
|
||||||
* @param options Optional configuration options for the metadata set.
|
* @param options Optional configuration options for the metadata set.
|
||||||
* @returns A promise that resolves to an `IntegrityMetadataSet` object.
|
* @returns A promise that resolves to an `IntegrityMetadataSet` object.
|
||||||
* @example
|
* @example
|
||||||
* ```
|
* ```js
|
||||||
* const res = new Response("Hello, world!");
|
* const res = new Response("Hello, world!");
|
||||||
* const data = await res.arrayBuffer();
|
* const data = await res.arrayBuffer();
|
||||||
* const set = await createIntegrityMetadataSet(["sha256", "sha384", "sha512"], data);
|
* const set = await createIntegrityMetadataSet(["sha256", "sha384", "sha512"], data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue