Skip to content

Commit

Permalink
Improve JSDoc documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Feb 10, 2024
1 parent a051a85 commit 1776e99
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ const ASCII = /^[\x00-\x7f]*$/;
* [0]: https://w3c.github.io/webappsec-csp/#parse-serialized-policy
*
* @param policy The serialized Content Security Policy to parse.
* @returns A Map of Content Security Policy directives.
* @example
* parseContentSecurityPolicy(
* "default-src 'self'; script-src 'unsafe-eval' scripts.example; object-src; style-src styles.example",
* );
* // => Map(4) {
* // "default-src" => ["'self'"],
* // "script-src" => ["'unsafe-eval'", "scripts.example"],
* // "object-src" => [],
* // "style-src" => ["styles.example"],
* // }
*/
export default function parseContentSecurityPolicy(
policy: string,
Expand Down

0 comments on commit 1776e99

Please sign in to comment.