Skip to content

Commit

Permalink
Omit undefined properties (#8582)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed May 25, 2023
1 parent d42c4a0 commit e9c814a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 4 additions & 2 deletions scripts/build/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ const build = async () => {
escape(icon.path),
escape(icon.source),
escape(icon.hex),
icon.guidelines ? `'${escape(icon.guidelines)}'` : undefined,
licenseToObject(icon.license),
icon.guidelines ? `\n guidelines: '${escape(icon.guidelines)}',` : '',
licenseToObject(icon.license)
? `\n license: ${JSON.stringify(licenseToObject(icon.license))},`
: '',
);
};
const writeJs = async (filepath, rawJavaScript, opts = null) => {
Expand Down
4 changes: 1 addition & 3 deletions scripts/build/templates/icon-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
},
path: '%s',
source: '%s',
hex: '%s',
guidelines: %s,
license: %s,
hex: '%s',%s%s
}
4 changes: 2 additions & 2 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export interface SimpleIcon {
path: string;
source: string;
hex: string;
guidelines: string | undefined;
license: License | undefined;
guidelines?: string;
license?: License;
}

0 comments on commit e9c814a

Please sign in to comment.