本文主要作为平时在 TypeScript 代码中编写类型以及对 TypeScript 代码进行 review 时候的参考手册,并非强制执行的规范,也不涉及纯代码风格以及代码逻辑上的指导。
本文内容参考了下面几个手册,所以强烈建议能够同时阅读完这几个手册。如果大家对 TypeScript 的一些基础用法和特性还不熟悉,也建议先阅读第一个 TypeScript 手册。
/* | |
MIT License | |
Copyright (c) 2024 Michael Joyce | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
const fetch = require('node-fetch'); | |
const MILESTONE_NUMBER = 15; | |
function assembleIssues(issues) { | |
return issues.map(issue => { | |
if (issue.state === 'open') { | |
return '#' + issue.number + ' ' + issue.title; | |
} |
var trimCanvas = (function() { | |
function rowBlank(imageData, width, y) { | |
for (var x = 0; x < width; ++x) { | |
if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; | |
} | |
return true; | |
} | |
function columnBlank(imageData, width, x, top, bottom) { | |
for (var y = top; y < bottom; ++y) { |
[ | |
{ | |
"timezones": [ | |
"America/Aruba" | |
], | |
"latlng": [ | |
12.5, | |
-69.96666666 | |
], | |
"name": "Aruba", |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for: