Skip to content

Commit

Permalink
Update util.js (#3)
Browse files Browse the repository at this point in the history
* Update util.js

Two small changes to 'entries':
- regexp search for whitespace, instead of search for ' ', to support tabs
- added a conditional for '@unwrap' and '@Noframes' so that these will be seen as valid entries

* Update util.js

Made suggested changes:
#3 (review)
  • Loading branch information
drygoatair authored Nov 12, 2023
1 parent d5478ce commit a1fe4c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export function getMetadata(metaFileContent, additionalGrantList) {
.map(line => {
if (!line.startsWith('// ')) return;
line = line.slice(3).trim();
const i = line.indexOf(' ');
if (i < 0) return;
const key = line.slice(0, i);
const value = line.slice(i + 1).trim();
const matches = line.match(/^(\S+)(\s.*)?$/);
if (!matches) return;
const key = matches[1];
const value = (matches[2] || '').trim();
if (key === '@grant') {
grantSet.add(value);
return;
Expand Down

0 comments on commit a1fe4c7

Please sign in to comment.