type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
TypeAliasDeclaration |
type PageName = string | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
TypeAliasDeclaration |
type FilePath = string | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
async clean () {
const tempPath = this.tempPath
const outputPath = this.outputPath
try {
await pRimraf(tempPath)
await pRimraf(outputPath)
} catch (e) {
console.log(e)
}
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
copyFiles () {} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
classifyFiles (filename) {
const pages = this.pages
const appPath = this.appPath
const entryFilePath = this.entryFilePath
const relPath = path.normalize(
path.relative(appPath, filename)
)
if (path.relative(filename, entryFilePath) === '') return FILE_TYPE.ENTRY
let relSrcPath = pat... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
buildTemp () {
const tempPath = this.tempPath
const sourcePath = this.sourcePath
const appPath = this.appPath
fs.ensureDirSync(tempPath)
const readPromises: any[] = []
function readFiles (sourcePath, originalFilePath) {
readPromises.push(new Promise((resolve, reject) => {
klaw(so... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
async buildDist ({ watch, port }: IBuildOptions, { modifyWebpackChain, modifyBuildAssets, onBuildFinish }: IBuildHooks) {
const isMultiRouterMode = get(this.h5Config, 'router.mode') === 'multi'
const entryFileName = this.entryFileName
const projectConfig = this.projectConfig
/** 不是真正意义上的IH5Config对象 */
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
watchFiles () {
const sourcePath = this.sourcePath
const appPath = this.appPath
const watcher = chokidar.watch(path.join(sourcePath), {
ignored: /(^|[/\\])\../,
persistent: true,
ignoreInitial: true
})
watcher
.on('add', filePath => {
const relativePath = path.relati... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
enter (astPath: NodePath<t.ClassDeclaration> | NodePath<t.ClassExpression>) {
const node = astPath.node
if (!node.superClass) return
if (isTaroClass(astPath)) {
resetTSClassProperty(node.body.body)
}
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ClassMethod>) {
if (isMultiRouterMode) return
const node = astPath.node
const key = node.key
const keyName = toVar(key)
const isRender = keyName === 'render'
const isComponentWillMount = keyName === 'componentWillMount'
c... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ClassBody>) {
const node = astPath.node
if (hasComponentDidShow && !hasComponentDidMount) {
node.body.push(t.classMethod(
'method', t.identifier('componentDidMount'), [],
t.blockStatement([callComponentDidShowNode]), false, false))
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
ObjectProperty (astPath: NodePath<t.ObjectProperty>) {
const node = astPath.node
const key = node.key
const value = node.value
const keyName = toVar(key)
if (keyName === 'pages' && t.isArrayExpression(value)) {
const subPackageParent = astPath.findParent(isUnderSubPack... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
enter (astPath: NodePath<t.ClassProperty>) {
const node = astPath.node
const key = node.key
const keyName = toVar(key)
if (keyName === 'state') {
stateNode = node
} else if (keyName === 'config') {
astPath.traverse(classPropertyVisitor)
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
enter (astPath: NodePath<t.CallExpression>) {
const node = astPath.node
const callee = node.callee
const calleeName = toVar(callee)
const parentPath = astPath.parentPath
const arg0 = node.arguments[0]
if (calleeName === 'require' && t.isStringLiteral(arg0)) ... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ClassMethod>) {
const node = astPath.node
const key = node.key
const keyName = toVar(key)
if (keyName === 'constructor') {
hasConstructor = true
} else if (keyName === 'componentWillMount') {
hasComponentWillMount = tru... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
enter (astPath: NodePath<t.JSXOpeningElement>) {
const node = astPath.node
if (toVar(node.name) === 'Provider') {
for (const v of node.attributes) {
if (v.name.name !== 'store') continue
if (!t.isJSXExpressionContainer(v.value)) return
storeName... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.Program>) {
const node = astPath.node
const lastImportIndex = findLastIndex(astPath.node.body, t.isImportDeclaration)
const lastImportNode = astPath.get(`body.${lastImportIndex > -1 ? lastImportIndex : 0}`) as NodePath<t.ImportDeclaration>
const firstPa... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ClassMethod>) {
const node = astPath.node
const key = node.key
const keyName = toVar(key)
const isRender = keyName === 'render'
const isComponentWillMount = keyName === 'componentWillMount'
const isComponentD... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.Program>) {
const node = astPath.node
node.body.forEach((bodyNode) => {
if (t.isExpressionStatement(bodyNode)
&& t.isCallExpression(bodyNode.expression)
&& t.isIdentifier(bodyNode.expression.callee)
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
enter (astPath: NodePath<t.ClassDeclaration> | NodePath<t.ClassExpression>) {
const node = astPath.node
if (!node.superClass) return
if (isTaroClass(astPath)) {
resetTSClassProperty(node.body.body)
if (t.isClassDeclaration(astPath)) {
if (node.id === null) {
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.JSXElement>) {
hasJSX = true
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.JSXOpeningElement>) {
const node = astPath.node
const tagName = toVar(node.name)
const componentName = componentnameMap.get(tagName)
const componentId = getComponentId(componentName, node)
const componentRef = getComponentRef(node)
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.JSXClosingElement>) {
const node = astPath.node
const tagName = toVar(node.name)
if (tagName === BLOCK_TAG_NAME) {
node.name = t.jSXMemberExpression(
t.jSXIdentifier('Nerv'),
t.jSXIdentifier('Fragment')
)
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.CallExpression>) {
const node = astPath.node
const callee = node.callee
const calleeName = toVar(callee)
let needToAppendThis = false
let funcName = ''
const arg0 = node.arguments[0]
if (calleeName === 'require' && t.isSt... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
AssignmentExpression (astPath) {
const node = astPath.node
const left = node.left
if (t.isMemberExpression(left) && t.isIdentifier(left.object)) {
if (left.object.name === componentClassName
&& t.isIdentifier(left.property)
&& left.property.name === 'config... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.Program>) {
const node = astPath.node
if (hasJSX) {
if (!importNervNode) {
importNervNode = t.importDeclaration(
[t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))],
t.stringLiteral('nervjs')
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
ClassBody (astPath) {
if (needSetConfigFromHooks) {
const classPath = astPath.findParent((p: NodePath<t.Node>) => p.isClassExpression() || p.isClassDeclaration()) as NodePath<t.ClassDeclaration>
classPath.node.body.body.unshift(
t.classProperty(
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
enter (astPath: NodePath<t.ClassProperty>) {
const node = astPath.node
const key = toVar(node.key)
if (key === 'config') {
pageConfig = toVar(node.value)
}
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ClassMethod>) {
const node = astPath.node
const key = node.key
const keyName = toVar(key)
if (keyName === 'componentDidMount') {
componentDidMountNode = node
} else if (keyName === 'componentDidShow') {
componentDidShow... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (returnAstPath: NodePath<t.ReturnStatement>) {
renderReturnStatementPaths.push(returnAstPath)
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ClassBody>) {
const node = astPath.node
if (!componentDidMountNode) {
componentDidMountNode = t.classMethod('method', t.identifier('componentDidMount'), [],
t.blockStatement([
toAst('super.componentDidMount && super.componentDidMou... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ExportDefaultDeclaration>) {
exportDefaultDeclarationNode = astPath.node
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.ExportNamedDeclaration>) {
exportNamedDeclarationPath = astPath
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
exit (astPath: NodePath<t.Program>) {
if (hasOnPullDownRefresh) {
// 增加PullDownRefresh组件
if (!importTaroComponentNode) {
importTaroComponentNode = t.importDeclaration(
[],
t.stringLiteral('@tarojs/components')
)
... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
getTempDir (filePath, originalFilePath) {
const appPath = this.appPath
const sourcePath = this.sourcePath
const tempDir = this.tempDir
let dirname = path.dirname(filePath)
if (filePath.indexOf(sourcePath) < 0) {
dirname = path.extname(originalFilePath) ? path.dirname(originalFilePath) : orig... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
transformToTempDir (filePath: string) {
const sourcePath = this.sourcePath
const isAbsolute = path.isAbsolute(filePath)
if (!isAbsolute) return filePath
const relPath = path.relative(sourcePath, filePath)
return relPath.startsWith('..')
? filePath
: path.resolve(this.tempPath, relPath)... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
processFiles (filePath, originalFilePath) {
const original = fs.readFileSync(filePath, { encoding: 'utf8' })
const extname = path.extname(filePath)
const distDirname = this.getTempDir(filePath, originalFilePath)
const isScriptFile = REG_SCRIPTS.test(extname)
const distPath = this.getDist(distDirnam... | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
MethodDeclaration |
getDist (distDirname, filename, isScriptFile) {
return isScriptFile
? path.format({
dir: distDirname,
ext: '.js',
name: path.basename(filename, path.extname(filename))
})
: path.format({
dir: distDirname,
base: path.basename(filename)
})
} | CooperFu/taro | packages/taro-cli/src/h5/index.ts | TypeScript |
ArrowFunction |
responsePriceData => {
this.estates = responsePriceData;
console.log('success', this.estates);
} | v786/Koya | koya-app/src/app/compare-rent/compare-rent.component.ts | TypeScript |
ArrowFunction |
responsePriceError => {
this.estates = null;
console.log('fail')
} | v786/Koya | koya-app/src/app/compare-rent/compare-rent.component.ts | TypeScript |
ArrowFunction |
() => console.log('get scraps method executed') | v786/Koya | koya-app/src/app/compare-rent/compare-rent.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-compare-rent',
templateUrl: './compare-rent.component.html',
styleUrls: ['./compare-rent.component.css']
})
export class CompareRentComponent implements OnInit {
public barChartOptions: ChartOptions = {
responsive: true,
// We use these empty structures as placeholders for ... | v786/Koya | koya-app/src/app/compare-rent/compare-rent.component.ts | TypeScript |
MethodDeclaration |
getScrapper() {
this._scrapper.getScraps('gokulam').subscribe(
responsePriceData => {
this.estates = responsePriceData;
console.log('success', this.estates);
},
responsePriceError => {
this.estates = null;
console.log('fail')
},
() => console.log('get s... | v786/Koya | koya-app/src/app/compare-rent/compare-rent.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.getScrapper();
} | v786/Koya | koya-app/src/app/compare-rent/compare-rent.component.ts | TypeScript |
ArrowFunction |
async () => {
const input = parseInt("foo", 10);
await expect(wait(input)).rejects.toThrow("milliseconds not a number");
} | halvardssm/typescript-action | lib/main.test.ts | TypeScript |
ArrowFunction |
async () => {
const start = new Date();
await wait(500);
const end = new Date();
var delta = Math.abs(end.getTime() - start.getTime());
expect(delta).toBeGreaterThan(450);
} | halvardssm/typescript-action | lib/main.test.ts | TypeScript |
ArrowFunction |
() => {
process.env["INPUT_MILLISECONDS"] = "500";
const np = process.execPath;
const ip = path.join(__dirname, "..", "dist", "index.js");
const options: cp.ExecFileSyncOptions = {
env: process.env
};
console.log(cp.execFileSync(np, [ip], options).toString());
} | halvardssm/typescript-action | lib/main.test.ts | TypeScript |
ArrowFunction |
params => {
const artistId = params['id'];
return this.artistService.getById(artistId);
} | sevgin0954/Spotify | src/app/artist/artist/artist.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-artist',
templateUrl: './artist.component.html',
styleUrls: ['./artist.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ArtistComponent implements OnInit {
artist$: Observable<Artist>;
@ViewChild('albums')
albumsElement: ElementRef;
@ViewCh... | sevgin0954/Spotify | src/app/artist/artist/artist.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.artist$ = this.route.params.pipe(
concatMap(params => {
const artistId = params['id'];
return this.artistService.getById(artistId);
})
);
} | sevgin0954/Spotify | src/app/artist/artist/artist.component.ts | TypeScript |
MethodDeclaration |
onShowButtonClick(): void {
this.renderer2.addClass(this.albumsElement.nativeElement, ALBUMS_EXPANDED_CLASS);
this.renderer2.addClass(this.artistsElement.nativeElement, SIMILAR_ARTISTS_SHRINKED_CLASS);
} | sevgin0954/Spotify | src/app/artist/artist/artist.component.ts | TypeScript |
MethodDeclaration |
onHideButtonClick(): void {
this.renderer2.removeClass(this.albumsElement.nativeElement, ALBUMS_EXPANDED_CLASS);
this.renderer2.removeClass(this.artistsElement.nativeElement, SIMILAR_ARTISTS_SHRINKED_CLASS);
} | sevgin0954/Spotify | src/app/artist/artist/artist.component.ts | TypeScript |
FunctionDeclaration |
function AdapterGitHubButton(props: { repo: Repository; user: User }) {
const { repo, user } = props;
const [counts, setCounts] = useState(`${repo.open_issues} open issues/PRs`);
const [color, setColor] = useState<"primary" | "error">("primary");
useEffect(() => {
const loadPullRequests = async () => {
if (!... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
function AdapterSentryButton(props: { projects: ProjectInfo[] }) {
const { projects } = props;
const [tooltip, setTooltip] = useState("Sentry available for this adapter");
const [errorCount, setErrorCount] = useState<number[]>();
const [errorCounts, setErrorCounts] = useState<number[][]>([]);
const [open, setOpe... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
function AddWatchDialog(props: AddWatchDialogProps) {
const { user, open, onClose } = props;
const [repoNames, setRepoNames] = useState<string[]>([]);
const [repoName, setRepoName] = useState("");
const [error, setError] = useState("");
const [validating, setValidating] = useState(false);
useEffect(() => {
i... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
async function getDiscoveryLink(adapterName: string) {
return (await hasDiscoverySupport(adapterName))
? `https://github.com/ioBroker/ioBroker.discovery/blob/master/lib/adapters/` +
`${uc(adapterName)}.js`
: "";
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
async function getWeblateLink(adapterName: string) {
try {
const components = await getWeblateAdapterComponents();
const component = components.results.find(
(c: any) => c.name === adapterName,
);
if (component) {
return (
`https://weblate.iobroker.net/projects/adapters/` +
`${uc(component.slug)... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
async function getSentryProjects(adapterName: string) {
const allProjects = await getSentryProjectInfos();
return allProjects.filter((p) => p.adapterName === adapterName);
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
async function getAdapterCard(
infos: AdapterInfos,
history: H.History<AdapterCheckLocationState>,
user: User,
onClose?: () => void,
): Promise<DashboardCardProps | undefined> {
const { repo, info } = infos;
if (!info) {
return;
}
const [discoveryLink, weblateLink, sentryProjects, ratings] =
await Promise.... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
FunctionDeclaration |
export default function Dashboard(props: DashboardProps) {
const { user, onAdapterListChanged } = props;
const history = useHistory<AdapterCheckLocationState>();
const [categories, setCategories] = useState<Record<string, CardGridProps>>(
{
Resources: { cards: resourcesCards },
Social: { cards: socialCards... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => {
const loadPullRequests = async () => {
if (!repo.open_issues) {
setCounts("no open PRs / no open issues");
return;
}
const gitHub = GitHubComm.forToken(user.token);
const pullRequests = await gitHub
.getRepo(repo)
.getPullRequests("open");
const prCount = pullRequests.length;
... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async () => {
if (!repo.open_issues) {
setCounts("no open PRs / no open issues");
return;
}
const gitHub = GitHubComm.forToken(user.token);
const pullRequests = await gitHub
.getRepo(repo)
.getPullRequests("open");
const prCount = pullRequests.length;
const issueCount = repo.open_iss... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(value: number, type: string) => {
return `${value || "no"} open ${type}${value === 1 ? "" : "s"}`;
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(props: { errors: number[]; children: any }, ref: any) => {
const { errors, children } = props;
const errorCount = errors[0] || errors[1];
const color = errors[0] ? "error" : "primary";
return (
<Badge badgeContent={errorCount} color={color} { | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => {
if (projects.length === 0) {
return;
}
const loadProjectInfos = async () => {
const stats24h = await getSentryStats(
projects.map((p) => p.id),
"24h",
);
const stats30d = await getSentryStats(
projects.map((p) => p.id),
"30d",
);
const errors = [
stats24h.map(
... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async () => {
const stats24h = await getSentryStats(
projects.map((p) => p.id),
"24h",
);
const stats30d = await getSentryStats(
projects.map((p) => p.id),
"30d",
);
const errors = [
stats24h.map(
(stat) => stat.stats.reduce((old, num) => old + num[1], 0),
0,
),
sta... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(stat) => stat.stats.reduce((old, num) => old + num[1], 0) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old, num) => old + num[1] | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(e) =>
e.reduce((old, err) => old + err, 0) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old, err) => old + err | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(project: ProjectInfo) => {
window.open(
`https://sentry.iobroker.net/organizations/iobroker/issues/?project=${project.id}`,
"_blank",
);
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(project, index) => (
<ListItem
button | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => {
if (!open) {
return;
}
const loadData = async () => {
const latest = await getLatest();
const names = Object.keys(latest).map((adapterName) =>
latest[adapterName].meta.replace(
/^\w+:\/\/[^/]+\/([^/]+\/[^/]+)\/.+$/,
"$1",
),
);
setRepoNames(names);
};
loadData().catch... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async () => {
const latest = await getLatest();
const names = Object.keys(latest).map((adapterName) =>
latest[adapterName].meta.replace(
/^\w+:\/\/[^/]+\/([^/]+\/[^/]+)\/.+$/,
"$1",
),
);
setRepoNames(names);
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(adapterName) =>
latest[adapterName].meta.replace(
/^\w+:\/\/[^/]+\/([^/]+\/[^/]+)\/.+$/,
"$1",
) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async () => {
setValidating(true);
try {
const gitHub = GitHubComm.forToken(user.token);
const [owner, repo] = repoName.split("/", 2);
const latest = await getLatest();
const infos = await getAdapterInfos(
await gitHub.getRepo(owner, repo).getRepo(),
latest,
);
if (!infos.info) {
thro... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => onClose() | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(c: any) => c.name === adapterName | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(p) => p.adapterName === adapterName | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => {
history.push("/adapter-check", {
repoFullName: repo.full_name,
});
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(index: number) => {
setCollapsed((old) => {
const result = [...old];
result[index] = !result[index];
localStorage.setItem(
COLLAPSED_CATEGORIES_KEY,
JSON.stringify(result),
);
return result;
});
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => {
const result = [...old];
result[index] = !result[index];
localStorage.setItem(
COLLAPSED_CATEGORIES_KEY,
JSON.stringify(result),
);
return result;
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async (user: User) => {
setCategories((old) => ({
...old,
[WATCHED_ADAPTERS_CATEGORY]: { cards: [] },
})); // clear the list (and show the spinner)
let adapters: DashboardCardProps[] = [];
try {
const infos = await getWatchedAdapterInfos(user.token);
const cards = await Promise.all(
infos.map(... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => ({
...old,
[WATCHED_ADAPTERS_CATEGORY]: { cards: [] },
}) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(info) =>
getAdapterCard(info, history, user, () =>
handleRemoveWatch(info).catch(console.error),
).catch(console.error) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() =>
handleRemoveWatch(info).catch(console.error) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(c) => !!c | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(c) => c as DashboardCardProps | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => ({
...old,
[WATCHED_ADAPTERS_CATEGORY]: {
cards: [...adapters],
onAdd: () => setShowAddWatch(true),
},
}) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => setShowAddWatch(true) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => {
const loadMyAdapters = async (user: User) => {
setCategories((old) => ({
...old,
[MY_ADAPTERS_CATEGORY]: { cards: [] },
})); // clear the list (and show the spinner)
const infos = await getMyAdapterInfos(user.token);
const cards = await Promise.all(
infos.map((info) =>
getAdapte... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async (user: User) => {
setCategories((old) => ({
...old,
[MY_ADAPTERS_CATEGORY]: { cards: [] },
})); // clear the list (and show the spinner)
const infos = await getMyAdapterInfos(user.token);
const cards = await Promise.all(
infos.map((info) =>
getAdapterCard(info, history, user).catch(... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => ({
...old,
[MY_ADAPTERS_CATEGORY]: { cards: [] },
}) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(info) =>
getAdapterCard(info, history, user).catch(console.error) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => ({
...old,
Tools: { cards: getToolsCards(true) },
[MY_ADAPTERS_CATEGORY]: { cards: [...adapters] },
}) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(type: string) => ({
title: "Login Required",
img: "images/github.png",
text: `You must be logged in to see your ${type}.`,
buttons: [<CardButton text="Login" onClick={handleLogin} />],
}) | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => {
const result = { ...old };
result.Tools = { cards: getToolsCards(false) };
result[MY_ADAPTERS_CATEGORY] = {
cards: [loginCard("adapters")],
};
delete result[WATCHED_ADAPTERS_CATEGORY];
return result;
} | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
() => {
const updateBlogIcon = async () => {
const url =
"https://raw.githubusercontent.com/ioBroker/ioBroker.docs/master/engine/front-end/public/blog.json";
const { data: blog } = await axios.get<{
pages: Record<
string,
{
date: string;
title: Record<string, string>;
logo: ... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
async () => {
const url =
"https://raw.githubusercontent.com/ioBroker/ioBroker.docs/master/engine/front-end/public/blog.json";
const { data: blog } = await axios.get<{
pages: Record<
string,
{
date: string;
title: Record<string, string>;
logo: string;
}
>;
}>(url);... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
ArrowFunction |
(old) => {
const res = old.Resources;
const index = res.cards.findIndex((c) => c.title === "Blog");
if (index >= 0) {
const card = res.cards[index];
const date = page.date.replace(
/^(\d{4})\.(\d{2})\.(\d{2})$/,
"$3.$2.$1",
);
res.cards[index] = {
...card,
img: `... | UncleSamSwiss/iobroker-dev-portal | express/frontend/src/components/Dashboard.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.