Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
/ object-policy Public archive

Convert an object to a policy-type header, for use in Content-Security-Policy or Feature-Policy.

License

Notifications You must be signed in to change notification settings

zacanger/object-policy

Repository files navigation

object-policy

Convert an object to a policy-type header, for use in Content-Security-Policy or Feature-Policy.

Support with PayPal Patreon ko-fi


Installation

npm i object-policy

Usage

const policy = require('object-policy')

objectPolicy({
  fooBar: [ 'a', 'b' ],
  'baz-quux': [ 'one', 'two' ]
})
// => `foo-bar: a b; baz-quux: one two;`

LICENSE