in toolings/tfjs-debugger/src/app/data_model/tfjs_release.ts [40:67]
export function releaseJsonToTfjsRelease(json: ReleaseJson): TfjsRelease|
undefined {
// Example: 'tfjs-v3.12.0'.
const tagName = json.tag_name;
// Only keep the main tfjs releases.
if (!tagName.startsWith('tfjs-v') || tagName.startsWith('tfjs-vis')) {
return undefined;
}
// Remove 'tfjs-v' prefix.
const version = tagName.replace('tfjs-v', '');
// Only keep >= 3.x releases.
const majorVersion = Number(version.split('.')[0]);
if (majorVersion < 3) {
return undefined;
}
// The original date string is in the form of 2021-10-22T02:07:40Z.
// Re-format it to "Fri, Oct 22, 2021".
const date = dateFormat(new Date(json.published_at), 'ddd, mmm dd, yyyy');
return {
version,
date,
};
}