瀏覽代碼

Fixes lint issues

main
Eric Amodio 5 年之前
父節點
當前提交
1e59b2ee22
共有 3 個文件被更改,包括 5 次插入5 次删除
  1. +2
    -2
      generateEmojiShortcodeMap.js
  2. +2
    -2
      src/system/function.ts
  3. +1
    -1
      src/system/promise.ts

+ 2
- 2
generateEmojiShortcodeMap.js 查看文件

@ -22,7 +22,7 @@ async function generate() {
if (emoji.shortcodes == null || emoji.shortcodes.length === 0) continue;
for (let code of emoji.shortcodes) {
if (code[0] === ':' && code[code.length - 1] === ':') {
if (code.startsWith(':') && code.endsWith(':')) {
code = code.substring(1, code.length - 2);
}
@ -48,7 +48,7 @@ async function generate() {
// eslint-disable-next-line import/no-dynamic-require
const gitmojis = require(path.join(process.cwd(), 'gitmojis.json')).gitmojis;
for (const emoji of gitmojis) {
if (emoji.code[0] === ':' && emoji.code[emoji.code.length - 1] === ':') {
if (emoji.code.startsWith(':') && emoji.code.endsWith(':')) {
emoji.code = emoji.code.substring(1, emoji.code.length - 2);
}

+ 2
- 2
src/system/function.ts 查看文件

@ -166,7 +166,7 @@ export namespace Functions {
}
}
};
timer = setInterval(fn, ms);
timer = global.setInterval(fn, ms);
return disposable;
}
@ -174,7 +174,7 @@ export namespace Functions {
export function progress<T>(promise: Promise<T>, intervalMs: number, onProgress: () => boolean): Promise<T> {
return new Promise((resolve, reject) => {
let timer: NodeJS.Timer | undefined;
timer = setInterval(() => {
timer = global.setInterval(() => {
if (onProgress()) {
if (timer !== undefined) {
clearInterval(timer);

+ 1
- 1
src/system/promise.ts 查看文件

@ -23,7 +23,7 @@ export namespace Promises {
let fulfilled = false;
let timer: NodeJS.Timer | undefined;
if (typeof timeoutOrToken === 'number') {
timer = setTimeout(() => {
timer = global.setTimeout(() => {
if (typeof options.onDidCancel === 'function') {
options.onDidCancel(resolve, reject);
} else {

Loading…
取消
儲存