本文整理匯總了TypeScript中gh-got.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: changelogTemplate
.then(() => {
const markdown: string = changelogTemplate({
...args,
include: (x: string, v: {}) => require('./' + path.join('templates', x)).default(v),
commits,
});
if (args.stdout || !githubToken) {
console.log(markdown);
process.exit(0);
}
// Check if we need to edit or create a new one.
return ghGot('repos/angular/angular-cli/releases').then((x: JsonObject) => [x, markdown]);
})
示例2: ghGot
.then(([body, markdown]) => {
const json = body.body;
const maybeRelease = json.find((x: JsonObject) => x.tag_name == args.to);
const id = maybeRelease ? `/${maybeRelease.id}` : '';
const semversion = (args.to && semver.parse(args.to)) || { prerelease: '' };
return ghGot('repos/angular/angular-cli/releases' + id, {
body: {
body: markdown,
draft: !maybeRelease,
name: args.to,
prerelease: semversion.prerelease.length > 0,
tag_name: args.to,
...(toSha ? { target_commitish: toSha } : {}),
},
token: githubToken,
});
});