aboutsummaryrefslogtreecommitdiff
path: root/src/lib/notification-i18n-loader.js
blob: 71f9156a87594b589035451c0f91656d602bccd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// This somewhat mysterious module will load a json string
// and then extract only the 'notifications' part. This is
// meant to be used to load the partial i18n we need for
// the service worker.
module.exports = function (source) {
  var object = JSON.parse(source)
  var smol = {
    notifications: object.notifications || {}
  }

  return JSON.stringify(smol)
}