notification-i18n-loader.js 367 B

123456789101112
  1. // This somewhat mysterious module will load a json string
  2. // and then extract only the 'notifications' part. This is
  3. // meant to be used to load the partial i18n we need for
  4. // the service worker.
  5. module.exports = function (source) {
  6. var object = JSON.parse(source)
  7. var smol = {
  8. notifications: object.notifications || {}
  9. }
  10. return JSON.stringify(smol)
  11. }