packages/plugin/index.js
function noncifyAttrs(element, getValue, attrs) {
      if (nonceValueExpression) {
        if (element === 'script' || element === 'style' ||
            (element === 'link' && (getValue('rel') || '').toLowerCase() === 'stylesheet')) {
          if (attrs.findIndex(({ name }) => name === 'nonce') < 0) {
            attrs[attrs.length] = {
              name: 'nonce',
              val: nonceValueExpression,
              mustEscape: true,
            };
          }
        }
      }
    }
function noncifyAttrs(element, getValue, attrs) {
      if (nonceValueExpression) {
        if (element === 'script' || element === 'style' ||
            (element === 'link' && (getValue('rel') || '').toLowerCase() === 'stylesheet')) {
          if (attrs.findIndex(({ name }) => name === 'nonce') < 0) {
            attrs[attrs.length] = {
              name: 'nonce',
              val: nonceValueExpression,
              mustEscape: true,
            };
          }
        }
      }
    }
function noncifyAttrs ( element , getValue , attrs ) { if ( nonceValueExpression ) { if ( element === 'script' || element === 'style' || ( element === 'link' && ( getValue ( 'rel' ) || '' ) . toLowerCase ( ) === 'stylesheet' ) ) { if ( attrs . findIndex ( ( { name } ) => name === 'nonce' ) < 0 ) { attrs [ attrs . length ] = { name : 'nonce' , val : nonceValueExpression , mustEscape : true , } ; } } } }
Add nonce attributes to attribute sets as needed.
Add nonce attributes to attribute sets as needed .