@budarin/pluggable-serviceworker 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"claimOnMessage.d.ts","sourceRoot":"","sources":["../../src/plugins/claimOnMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EACnB,mBAAmB,EAEtB,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,cAAc,EAAE,mBAAmB,CAAC,mBAAmB,CASnE,CAAC"}
1
+ {"version":3,"file":"claimOnMessage.d.ts","sourceRoot":"","sources":["../../src/plugins/claimOnMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,mBAAmB,EACnB,mBAAmB,EAEtB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,cAAc,EAAE,mBAAmB,CAAC,mBAAmB,CASnE,CAAC"}
@@ -1,8 +1,8 @@
1
- const DEFAULT_CLAIM_MESSAGE_TYPE = 'SW_ACTIVATE';
1
+ import { SW_MSG_SKIP_WAITING } from '@budarin/http-constants';
2
2
  export const claimOnMessage = {
3
3
  name: 'claimOnMessage',
4
4
  message: (event, context) => {
5
- const type = context.claimMessageType ?? DEFAULT_CLAIM_MESSAGE_TYPE;
5
+ const type = context.claimMessageType ?? SW_MSG_SKIP_WAITING;
6
6
  if (event.data?.type !== type)
7
7
  return;
8
8
  self.skipWaiting();
@@ -1 +1 @@
1
- {"version":3,"file":"claimOnMessage.js","sourceRoot":"","sources":["../../src/plugins/claimOnMessage.ts"],"names":[],"mappings":"AAMA,MAAM,0BAA0B,GAAG,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAA6C;IACpE,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,CAAC,KAAqB,EAAE,OAAO,EAAE,EAAE;QACxC,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,IAAI,0BAA0B,CAAC;QAEpE,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;YAAE,OAAO;QAEtC,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;CACJ,CAAC"}
1
+ {"version":3,"file":"claimOnMessage.js","sourceRoot":"","sources":["../../src/plugins/claimOnMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAO9D,MAAM,CAAC,MAAM,cAAc,GAA6C;IACpE,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,CAAC,KAAqB,EAAE,OAAO,EAAE,EAAE;QACxC,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,IAAI,mBAAmB,CAAC;QAE7D,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;YAAE,OAAO;QAEtC,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budarin/pluggable-serviceworker",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Extensible via plugins service worker",
5
5
  "keywords": [
6
6
  "serviceworker",