@hero-design/snowflake-guard 1.0.12 → 1.0.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.
@@ -36,4 +36,8 @@ describe('getDiffLocs', () => {
36
36
  [41, 41],
37
37
  ]);
38
38
  });
39
+ it('returns empty for empty patches', () => {
40
+ const filePatch = '';
41
+ expect((0, getDiffLocs_1.getDiffLocs)(filePatch)).toEqual([]);
42
+ });
39
43
  });
@@ -5,6 +5,9 @@ const DIFF_LOCS_REGEX = /@@(.*)@@/g;
5
5
  const getDiffLocs = (filePatch) => {
6
6
  const locs = [];
7
7
  const patches = {};
8
+ if (!filePatch) {
9
+ return locs;
10
+ }
8
11
  // Split file patch into lines
9
12
  const splitPatch = filePatch.split('\n');
10
13
  // Get patches
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/snowflake-guard",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "A hero-design bot detecting snowflake usage",
5
5
  "author": "Hau Dao",
6
6
  "license": "ISC",