bananas-commerce-admin 0.17.12 → 0.17.13

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.
@@ -14,6 +14,8 @@
14
14
  * contribute(Bananas.subscription.contrib.dashboard, "dashboard:stats:subscription:events", "dashboard:stats:subscription:count");
15
15
  */
16
16
  export const contribute = (map, ...filter) => {
17
+ if (map == null)
18
+ return [];
17
19
  if (filter && filter.length > 0) {
18
20
  return filter
19
21
  .filter((tag) => tag in map)
@@ -1 +1 @@
1
- {"version":3,"file":"contribute.js","sourceRoot":"","sources":["../../../src/util/contribute.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,GAAwB,EACxB,GAAG,MAAgB,EACS,EAAE;IAC9B,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,MAAM;aACV,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC;aAC3B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACb,GAAG;YACH,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC;SAClB,CAAC,CAAC,CAAC;IACR,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QAClD,GAAG;QACH,OAAO;KACR,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"contribute.js","sourceRoot":"","sources":["../../../src/util/contribute.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,GAA2C,EAC3C,GAAG,MAAgB,EACS,EAAE;IAC9B,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC3B,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,MAAM;aACV,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC;aAC3B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACb,GAAG;YACH,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC;SAClB,CAAC,CAAC,CAAC;IACR,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QAClD,GAAG;QACH,OAAO;KACR,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -14,4 +14,4 @@ import { ContribComponentListItem, ContribComponentMap } from "../types";
14
14
  * // Get specific contribs in order
15
15
  * contribute(Bananas.subscription.contrib.dashboard, "dashboard:stats:subscription:events", "dashboard:stats:subscription:count");
16
16
  */
17
- export declare const contribute: (map: ContribComponentMap, ...filter: string[]) => ContribComponentListItem[];
17
+ export declare const contribute: (map: ContribComponentMap | null | undefined, ...filter: string[]) => ContribComponentListItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bananas-commerce-admin",
3
- "version": "0.17.12",
3
+ "version": "0.17.13",
4
4
  "description": "What's this, an admin for apes?",
5
5
  "keywords": [
6
6
  "admin",
@@ -16,9 +16,10 @@ import { ContribComponentListItem, ContribComponentMap } from "../types";
16
16
  * contribute(Bananas.subscription.contrib.dashboard, "dashboard:stats:subscription:events", "dashboard:stats:subscription:count");
17
17
  */
18
18
  export const contribute = (
19
- map: ContribComponentMap,
19
+ map: ContribComponentMap | null | undefined,
20
20
  ...filter: string[]
21
21
  ): ContribComponentListItem[] => {
22
+ if (map == null) return [];
22
23
  if (filter && filter.length > 0) {
23
24
  return filter
24
25
  .filter((tag) => tag in map)