This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'node:fs/promises'; | |
import chokidar form 'chokidar'; | |
const watchState = { | |
running: false, | |
}; | |
export class MySkillProvider extends SkillProvider { | |
constructor(init: ProviderInit) { | |
super(init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@typescript-eslint/adjacent-overload-signatures": "error", | |
"@typescript-eslint/array-type": ["error", {"default": "array-simple", "readonly": "generic"}], | |
"@typescript-eslint/await-thenable": "error", | |
"@typescript-eslint/ban-ts-comment": [ | |
"error", | |
{ | |
"ts-expect-eror": "allow-with-description", | |
"ts-ignore": true, | |
"ts-nocheck": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
“工程规范治理”包括工程相关的规范制定与落地(Lint、UT、供应链等),工具研发与支持(各类命令行、框架、库等),平台化(Devops、依赖管理、技术中台等)。 | |
Q:贵公司的名称? | |
Q:贵公司如何看待工程规范治理这件事?上层视角?基层管理者视角?业务员工视角? | |
Q:贵公司工程规范治理这件事的重视度和投入,主要推动方? | |
Q:开展过哪些工程规范治理的工作?如何开展的? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import fs from 'fs/promises'; | |
import {memoizeWith, always} from 'ramda'; | |
import {Plugin} from 'vite'; | |
const CSS_LANGS = new Set(['.less']); | |
export default function styleResourcePlugin(patterns: string[]): Plugin { | |
const readContent = memoizeWith( | |
always(''), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function optimizedRemove<T>(sets: Array<Set<T>>, value: T): void { | |
// 如果N个数组中都有这个元素,那么我们只保留长度最短的数组中的那一份,其它的都删掉 | |
const containedSets = sets.filter(s => s.has(value)); | |
const setWithMinSize = containedSets.reduce((out, current) => (current.size <= out.size ? current : out)); | |
containedSets.filter(s => s !== setWithMinSize).forEach(s => s.delete(value)); | |
} | |
function makeBalancedUnique<T>(values: T[][]): T[][] { | |
// 转成Set,这样判断元素是否存在、删除元素性能更高 | |
const sets = values.map(v => new Set(v)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isApproximateInteger = value => { | |
const min = Math.floor(value); | |
const max = Math.ceil(value); | |
return value - min <= 0.01 || max - value <= 0.01; | |
}; | |
const MAX_TRY = 120; | |
const computeToRatio = (width, height) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useReducer, useCallback} from 'react'; | |
import {union, without, difference, range} from 'lodash'; | |
interface Action { | |
type: 'single' | 'multiple' | 'range'; | |
payload: number; | |
} | |
export interface SelectionMethods { | |
selectIndex(index: number, e: ClickContext): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useRef, useLayoutEffect} from 'react'; | |
interface PerformanceTiming { | |
firstRender: number; | |
firstLayout: number; | |
firstMeaningfulRender: number; | |
firstMeaningfulLayout: number; | |
} | |
const usePerformanceRecord = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Options { | |
readonly maxIdleTime?: number; | |
} | |
type AttentionState = 'active' | 'inactive' | 'unknown'; | |
interface AttentionChangeEvent { | |
readonly state: AttentionState; | |
readonly active: boolean; | |
readonly lastAction: number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | |
!function (e, n) { | |
"object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? n(exports) : "function" == typeof define && define.amd ? define(["exports"], n) : n(e.unidiff = {}); | |
}(void 0, function (e) { | |
"use strict"; | |
function n(e) { |
NewerOlder