repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
renovate-reproductions/typescript-eslint-issue-4689 | index.ts | <reponame>renovate-reproductions/typescript-eslint-issue-4689
export function getFutureVersion(baseVersion?: string): number[] {
const toRelease: number[] = [];
const baseRelease: number[] = [];
return baseRelease.map((_, index) => {
const toPart = toRelease[index] ?? 0;
if (index < 1) {
return toPa... |
Azordev/frontend-template | src/pages/Error500.tsx | function Error500() {
return <div>Error500</div>
}
export default Error500
|
Azordev/frontend-template | src/main.tsx | import React from 'react'
import ReactDOM from 'react-dom'
import Router from './pages/router'
import { css, Global } from '@emotion/react'
import 'css-maid'
ReactDOM.render(
<React.StrictMode>
<Router />
<Global
styles={css`
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wg... |
Azordev/frontend-template | src/components/ErrorBoundary.tsx | import React from 'react'
import Error from './Error'
interface ErrorBoundaryProps {
children: React.ReactNode
}
type ErrorBoundaryState = {
error: Error | null
errorInfo: React.ErrorInfo | null
hasError: boolean
}
class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
// Con... |
Azordev/frontend-template | src/components/Error.tsx | <filename>src/components/Error.tsx
import React from 'react'
import PropTypes from 'prop-types'
interface ErrorProps {
errorInfo: React.ErrorInfo | null
errorId?: string
}
const Error = ({ errorInfo = { componentStack: 'error' }, errorId }: ErrorProps) => (
<div>
<p>
There was an error in loading this... |
Azordev/frontend-template | src/pages/Error404.tsx | <reponame>Azordev/frontend-template<gh_stars>0
function Error404() {
return <div>Error404</div>
}
export default Error404
|
Azordev/frontend-template | src/pages/router.tsx | import { BrowserRouter, Routes, Route } from 'react-router-dom'
import ErrorBoundary from '../components/ErrorBoundary'
import Home from './Home'
import Error404 from './Error404'
import Error500 from './Error500'
const Router = () => (
<ErrorBoundary>
<BrowserRouter>
<Routes>
<Route path="/" eleme... |
Azordev/frontend-template | src/types.d.ts | <filename>src/types.d.ts
// export interfaces
|
Azordev/frontend-template | src/pages/Home.tsx | <reponame>Azordev/frontend-template
import React, { useLayoutEffect } from 'react'
const Counter = () => {
const [count, setCount] = React.useState(0)
useLayoutEffect(() => {
if (count > 3) throw new Error('Crashed!!!!')
}, [count])
return <button onClick={() => setCount(count + 1)}>{count}</button>
}
c... |
Azordev/frontend-template | src/config/breakpoints.ts | const breakpoints = ['768', '1024', '1280']
const mq = breakpoints.map(bp => `@media(max-width: ${bp}px)`)
export default mq
|
inabagumi/animare-shindan | components/progress-bar.tsx | <filename>components/progress-bar.tsx<gh_stars>1-10
import styled from 'styled-components'
import type { VFC } from 'react'
const Container = styled.div`
background-color: rgba(0, 0, 0, 0.3);
border-radius: 6px;
height: 12px;
`
const Bar = styled.div`
background-color: #fff263;
border-radius: 6px;
height... |
inabagumi/animare-shindan | components/avatar.tsx | import styled from 'styled-components'
import type { VFC } from 'react'
const Image = styled.img`
border: solid #14b9ff 2px;
border-radius: 50%;
box-sizing: border-box;
display: block;
height: 56px;
width: 56px;
@media (min-width: 500px) {
border-width: 4px;
height: 80px;
text-align: center... |
inabagumi/animare-shindan | components/seo.tsx | import Head from 'next/head'
import mainVisual from '../assets/main-visual.jpg'
import pkg from '../package.json'
import type { VFC } from 'react'
const defaultTitle = 'あなたのオタクタイプ診断 by あにまーれ'
interface Props {
description?: string
image?: string
pathname?: string
title?: string
}
const SEO: VFC<Props> = ({... |
inabagumi/animare-shindan | pages/404.tsx | import styled from 'styled-components'
import Header from '../components/header'
import Layout from '../components/layout'
import Message from '../components/message'
import SEO from '../components/seo'
import type { NextPage } from 'next'
const Title = styled.h1`
font-size: 2rem;
font-weight: 900;
margin: 10p... |
inabagumi/animare-shindan | pages/list.tsx | import { format } from 'date-fns'
import { MDXRemote } from 'next-mdx-remote'
import styled from 'styled-components'
import Header from '../components/header'
import Layout from '../components/layout'
import Message from '../components/message'
import SEO from '../components/seo'
import { getAllReleases } from '../lib... |
inabagumi/animare-shindan | components/graph.tsx | <reponame>inabagumi/animare-shindan<gh_stars>1-10
import styled, { keyframes } from 'styled-components'
import GraphBar from './graph-bar'
import type { ResultParameter } from '../lib/analysis'
import type { VFC } from 'react'
const Container = styled.section`
margin: 0 0 20px;
`
const Title = styled.h3`
backgr... |
inabagumi/animare-shindan | components/message-window.tsx | import styled from 'styled-components'
import nanashi from '../assets/nanashi.svg'
import type { ReactNode, VFC } from 'react'
const Root = styled.div`
background-color: #fff;
border: solid #000 3px;
border-radius: 20px;
box-sizing: border-box;
margin-top: 52px;
position: relative;
::before {
back... |
inabagumi/animare-shindan | lib/releases.ts | import { Octokit } from '@octokit/rest'
import { serialize } from 'next-mdx-remote/serialize'
import type { MDXRemoteSerializeResult } from 'next-mdx-remote'
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN
})
export type Release = {
contentSource: MDXRemoteSerializeResult
date: string
slug: stri... |
inabagumi/animare-shindan | pages/_app.tsx | <reponame>inabagumi/animare-shindan
import Head from 'next/head'
import { useRouter } from 'next/router'
import { useCallback, useEffect } from 'react'
import favicon192x192 from '../assets/favicon-192x192.png'
import favicon512x512 from '../assets/favicon-512x512.png'
import type { AppProps } from 'next/app'
import ... |
inabagumi/animare-shindan | lib/analysis.ts | <filename>lib/analysis.ts
import prisma from './prisma'
export type Question = {
answers: string[]
title: string
}
export async function getQuestions(): Promise<Question[]> {
const questions = await prisma.question.findMany({
orderBy: {
id: 'desc'
},
select: {
answers: {
select: ... |
inabagumi/animare-shindan | pages/index.tsx | import Link from 'next/link'
import styled from 'styled-components'
import Header from '../components/header'
import Layout from '../components/layout'
import Message from '../components/message'
import SEO from '../components/seo'
import type { NextPage } from 'next'
const Content = styled.main`
padding-top: 30px... |
inabagumi/animare-shindan | components/graph-bar.tsx | <reponame>inabagumi/animare-shindan
import styled, { keyframes } from 'styled-components'
import type { VFC } from 'react'
const Container = styled.div`
position: absolute;
width: 100%;
`
const show = keyframes`
0% {
opacity: 0;
}
100% {
opacity: 1;
}
`
const progress = keyframes`
0% {
wi... |
inabagumi/animare-shindan | pages/questions.tsx | <reponame>inabagumi/animare-shindan
import Head from 'next/head'
import { useRouter } from 'next/router'
import { useCallback, useState } from 'react'
import styled, { keyframes } from 'styled-components'
import Layout from '../components/layout'
import ProgressBar from '../components/progress-bar'
import SEO from '..... |
inabagumi/animare-shindan | lib/share.ts | <gh_stars>1-10
const LINE_SHARE_BASE_URL = 'https://social-plugins.line.me'
const TWEET_BASE_URL = 'https://twitter.com'
const SHARE_HASHTAG = 'あにまーれオタクタイプ診断'
export function createLineShareURL(url: string): string {
const shareURL = new URL('/lineit/share', LINE_SHARE_BASE_URL)
shareURL.searchParams.set('url', u... |
inabagumi/animare-shindan | components/message.tsx | <filename>components/message.tsx<gh_stars>1-10
import styled from 'styled-components'
import type { ReactNode, VFC } from 'react'
const Container = styled.div`
background-color: #fff;
border: solid #000 4px;
border-radius: 20px;
box-sizing: border-box;
color: #000;
margin: 0 auto;
max-width: 680px;
pa... |
inabagumi/animare-shindan | pages/_document.tsx | <filename>pages/_document.tsx
import Document, { Head, Html, Main, NextScript } from 'next/document'
import { ServerStyleSheet } from 'styled-components'
import type {
DocumentContext,
DocumentInitialProps,
DocumentProps
} from 'next/document'
const MyDocument = (props: DocumentProps): JSX.Element => {
return... |
inabagumi/animare-shindan | components/layout.tsx | <filename>components/layout.tsx
import styled, { createGlobalStyle } from 'styled-components'
import Footer from './footer'
import type { ReactNode, VFC } from 'react'
const GlobalStyle = createGlobalStyle`
html {
background-color: #0588f7;
background-image: repeating-linear-gradient(
150deg,
r... |
inabagumi/animare-shindan | pages/s/[slug].tsx | import Link from 'next/link'
import { useEffect, useState } from 'react'
import styled from 'styled-components'
import nanashiAvatar from '../../assets/avatar.svg'
import Avatar from '../../components/avatar'
import Graph from '../../components/graph'
import Layout from '../../components/layout'
import MessageWindow f... |
inabagumi/animare-shindan | components/footer.tsx | <filename>components/footer.tsx
import Link from 'next/link'
import styled from 'styled-components'
import pkg from '../package.json'
import type { VFC } from 'react'
const Content = styled.footer`
align-items: center;
background-color: #fff;
border-top: solid #000 6px;
display: flex;
flex-direction: colum... |
inabagumi/animare-shindan | components/header.tsx | import Link from 'next/link'
import styled from 'styled-components'
import lineLogo from '../assets/line.svg'
import twitterLogo from '../assets/twitter.svg'
import { createLineShareURL, createTweetURL } from '../lib/share'
import pkg from '../package.json'
import type { VFC } from 'react'
const Container = styled.h... |
inabagumi/animare-shindan | additional.d.ts | <gh_stars>1-10
declare module '*.svg' {
const content: StaticImageData
export default content
}
|
st0ven/blog | src/components/app-link.tsx | import React, { useCallback, useRef } from "react"
import cx from "classnames"
import { Link, GatsbyLinkProps } from "gatsby"
import styles from "~components/app-link.module.scss"
interface AppLinkProps extends GatsbyLinkProps<any>{
target?: string
className?: string
children: React.ReactNode
icon?: React.Reac... |
st0ven/blog | src/components/topic-card.tsx | /*
Topic Cards
------------
This component is meant to render a preview/peek at the nature
of an existing article/blog post. The card itself should display
some basic information about that content, such as the date,
title/subtitle, any associated tags with it, and other meta content.
A user should be able to interact... |
st0ven/blog | src/components/slices/code-block.tsx | <filename>src/components/slices/code-block.tsx
import React, { useState, useLayoutEffect } from "react"
import { RichText } from "prismic-reactjs"
import SyntaxHighlighter from "react-syntax-highlighter/dist/esm/prism-light"
import css from "react-syntax-highlighter/dist/esm/languages/prism/css"
import scss from "react... |
st0ven/blog | src/components/slices/section-title.tsx | <reponame>st0ven/blog<gh_stars>0
import React from "react"
import {RichText} from "prismic-reactjs"
import styles from "~slices/section-title.module.scss"
export interface SectionTitleProps {
title: any
}
export function SectionTitle({title}: any){
return (
<h3 className={styles.sectionTitle}>
{RichText.a... |
st0ven/blog | src/components/article-group.tsx | <gh_stars>0
import React from "react"
import { TopicCard } from "~components/topic-card"
import { ChronologicalArticleGroup } from "~resources/chronology"
import styles from "~components/article-group.module.scss"
export function ArticleGroup({
month,
year,
articles,
}: ChronologicalArticleGroup) {
return (
<div... |
st0ven/blog | src/pages/index.tsx | import React, { useLayoutEffect, useState } from "react"
import { StaticQuery, graphql } from "gatsby"
import { getBlogPosts } from "~api/prismic"
import Layout from "~components/layout"
import SEO from "~components/seo"
import { ArticleGroup } from "~components/article-group"
import {
ChronologicalArticleGroup,
us... |
st0ven/blog | src/components/slices/index.tsx | <gh_stars>0
export { Blockquote } from "~slices/blockquote"
export { CallOut } from "~slices/call-out"
export { CodeBlock } from "~slices/code-block"
export { SectionTitle } from "~slices/section-title" |
st0ven/blog | src/templates/blog-post.tsx | <gh_stars>0
import React from "react"
import Layout from "~components/layout"
import { Blockquote, CallOut, CodeBlock, SectionTitle } from "~slices"
import { RichText } from "prismic-reactjs"
import { PublishedDate } from "~components/published-date"
import { ArrowLeftCircle, ArrowUpCircle } from "react-feather"
import... |
st0ven/blog | src/resources/chronology.tsx | export interface ChronologicalArticleGroup {
year: number
month: string
articles: Array<any>
}
/*
Given an array of ChronologicalArticleGroup, and an ArticleDate,
recursively cycle through the group and return the group that matches the
supplied date by both year and month. If none is found, return void/undef... |
st0ven/blog | src/components/slices/call-out.tsx | import React from "react"
import { RichText } from "prismic-reactjs"
import styles from "~slices/call-out.module.scss"
export interface CallOutProps {
title?: string
body: Array<any>
}
export function CallOut({ body, title }: CallOutProps) {
return (
<section className={styles.callOutWrapper}>
<RichTe... |
st0ven/blog | src/components/published-date.tsx | import React from "react"
import { getFormalDateFromString } from "~resources/chronology"
import styles from "~components/published-date.module.scss"
interface PublishedDateProps {
title?: string
date: string
}
export function PublishedDate({
title = "Date published",
date,
}: PublishedDateProps) {
const da... |
st0ven/blog | src/components/slices/blockquote.tsx | <reponame>st0ven/blog
import React from "react"
import styles from "~slices/blockquote.module.scss"
interface BlockquoteProps {
text: string
}
export function Blockquote({ text }: BlockquoteProps) {
return (
<div className={styles.container}>
<blockquote>“{text}”</blockquote>
</div>
)
... |
st0ven/blog | src/components/layout.tsx | <reponame>st0ven/blog<gh_stars>0
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from "react"
import styles from "~components/layout.module.scss"
export default function Layout({ children }) {
return ... |
icooper/pegjs-tracer | src/TextQuoter.ts | <reponame>icooper/pegjs-tracer<filename>src/TextQuoter.ts
/*
* text-quoter.ts
*
* Utility class for quoting from source files. Originally written by <NAME>.
*
* <NAME>
* 06 Sept 2018
*
*/
// import the TextUtil class for text styling
import { TextUtil, TextUtilStyle } from './TextUtil';
// interfaces
expor... |
icooper/pegjs-tracer | src/Tracer.ts | <filename>src/Tracer.ts
/*
* index.ts
*
* Backtrace formatter for PEG.js parser debugging. Originally written by <NAME>.
*
* <NAME>
* 06 Sept 2018
*
*/
// imports
import { TextQuoter, TextQuoterOptions } from './TextQuoter';
import { TextUtil, TextUtilStyle } from './TextUtil';
import { TextGraph, TextGraph... |
icooper/pegjs-tracer | src/TextUtil.ts | <filename>src/TextUtil.ts
/*
* text-util.ts
*
* Static utility class for text formatting. Originally written by <NAME>.
*
* <NAME>
* 06 Sept 2018
*
*/
// interfaces
export interface TextUtilStyle {
color?: string;
background?: string;
attribute?: string;
}
// classes
export class TextUtil {
... |
icooper/pegjs-tracer | src/TextGraph.ts | /*
* graph.ts
*
* ASCII-art style parser backtrace formatting class. Originally written by <NAME>.
*
* <NAME>
* 06 Sept 2018
*
*/
// import the TextUtil class for text styling
import { TextUtil, TextUtilStyle } from './TextUtil';
import { TracerNode } from './Tracer';
// interfaces
export interface TextGra... |
aicacia/ts-state-react | src/createHook.ts | import { State } from "@aicacia/state";
import { RecordOf } from "immutable";
import { useState, useEffect, useRef } from "react";
import { shallowEqual } from "shallow-equal-object";
export function createHook<T>(state: State<T>) {
return function useMapStateToProps<TProps>(
mapStateToProps: (state: RecordOf<T>... |
aicacia/ts-state-react | src/Connect.test.tsx | <gh_stars>0
import { State, IStateTypeOf } from "@aicacia/state";
import { render } from "@testing-library/react";
import { Simulate } from "react-dom/test-utils";
import { JSDOM } from "jsdom";
import { PureComponent } from "react";
import * as tape from "tape";
import { Record as ImmutableRecord, RecordOf } from "imm... |
aicacia/ts-state-react | src/returnsEmptyObject.ts | export function returnsEmptyObject() {
return {};
}
|
aicacia/ts-state-react | src/createConnect.ts | <reponame>aicacia/ts-state-react<filename>src/createConnect.ts
import { State } from "@aicacia/state";
import { RecordOf } from "immutable";
import {
Component,
createElement,
ComponentClass,
ComponentType,
PureComponent,
} from "react";
import { shallowEqual } from "shallow-equal-object";
import type { IMapS... |
aicacia/ts-state-react | src/IMapStateToFunctions.ts | export type IMapStateToFunctions<
TState,
TStateProps,
TFunctionProps,
TOwnProps
> = (
state: TState,
ownProps: TOwnProps,
stateProps: TStateProps
) => TFunctionProps;
|
aicacia/ts-state-react | examples/shared/stores/todos/selectors.ts | import { IState } from "../../state";
import { STORE_NAME } from "./definitions";
export const selectAll = (state: IState) =>
state.get(STORE_NAME).todos.valueSeq().toList();
export const selectText = (state: IState) => state.get(STORE_NAME).text;
|
aicacia/ts-state-react | examples/shared/stores/todos/definitions.ts | <reponame>aicacia/ts-state-react<filename>examples/shared/stores/todos/definitions.ts
import { IJSONObject } from "@aicacia/json";
import { OrderedMap, Record, RecordOf } from "immutable";
export interface ITodo {
id: number;
text: string;
}
export const Todo = Record<ITodo>({
id: 0,
text: "",
});
export int... |
aicacia/ts-state-react | src/IMapStateToProps.ts | export type IMapStateToProps<TState, TStateProps, TOwnProps> = (
state: TState,
ownProps: TOwnProps
) => TStateProps;
|
aicacia/ts-state-react | examples/shared/components/Todo.tsx | <gh_stars>0
export interface ITodoProps {
text: string;
onRemove();
}
export const Todo = (props: ITodoProps) => (
<li>
<span>{props.text}</span>
<button onClick={props.onRemove}>X</button>
</li>
);
|
aicacia/ts-state-react | examples/shared/state.ts | import { IStateTypeOf, State, initReduxDevTools } from "@aicacia/state";
import {
INITIAL_STATE as todos,
TodosFromJSON,
} from "./stores/todos/definitions";
export const state = new State(
{
todos,
},
{
todos: TodosFromJSON,
}
);
export type IState = IStateTypeOf<typeof state>;
if (process.env.NO... |
aicacia/ts-state-react | src/Hooks.test.tsx | <reponame>aicacia/ts-state-react<filename>src/Hooks.test.tsx
import { State, IStateTypeOf } from "@aicacia/state";
import { render } from "@testing-library/react";
import { Simulate } from "react-dom/test-utils";
import { JSDOM } from "jsdom";
import * as tape from "tape";
import { Record as ImmutableRecord, Record, Re... |
aicacia/ts-state-react | src/index.ts | <filename>src/index.ts<gh_stars>0
export type { IConnectProps } from "./createConnect";
export { Connect, createConnect } from "./createConnect";
export { createHook } from "./createHook";
export type { IMapStateToProps } from "./IMapStateToProps";
export type { IMapStateToFunctions } from "./IMapStateToFunctions";
|
aicacia/ts-state-react | examples/todolist-hooks/lib/components/TodoList.tsx | <gh_stars>0
import { ChangeEvent, FormEvent } from "react";
import { useMapStateToProps } from "../connect";
import { create, remove, setText } from "../../../shared/stores/todos/actions";
import { selectText, selectAll } from "../../../shared/stores/todos/selectors";
import { Todo } from "../../../shared/components/To... |
aicacia/ts-state-react | examples/todolist-connect/lib/components/TodoList.tsx | <reponame>aicacia/ts-state-react
import { PureComponent, ChangeEvent, FormEvent } from "react";
import { connect, IState } from "../connect";
import { create, remove, setText } from "../../../shared/stores/todos/actions";
import { ITodo } from "../../../shared/stores/todos/definitions";
import { selectText, selectAll }... |
aicacia/ts-state-react | examples/shared/stores/todos/actions.ts | <reponame>aicacia/ts-state-react
import { state } from "../../state";
import { STORE_NAME, Todo } from "./definitions";
export const store = state.getStore(STORE_NAME);
let ID = 0;
export const setText = (text: string) =>
store.update((state) => state.set("text", text), "setText");
export const create = (text: st... |
thoroc/cravate-doree | src/setupTests.ts | import 'jest-extended/all'
import '@testing-library/react'
import '@testing-library/jest-dom'
|
loulouleloup/Primaa | angular-client/node_modules/@angular/platform-browser-dynamic/testing/testing.d.ts | <gh_stars>0
/**
* @license Angular v13.0.2
* (c) 2010-2021 Google LLC. https://angular.io/
* License: MIT
*/
import * as i0 from '@angular/core';
import * as i1 from '@angular/platform-browser/testing';
import { PlatformRef } from '@angular/core';
import { StaticProvider } from '@angular/core';
import { TestCo... |
customrealms/cli-default-template | src/main.ts | import { PlayerChatEvent, ServerCommands, ServerEvents } from '@customrealms/core';
// Listen for player chat events
ServerEvents.register(PlayerChatEvent, event => {
const player = event.getPlayer();
const message = event.getMessage();
// Log something to the server console
console.log(`Player "${pl... |
abanoubEssam/nestjs-realtime | src/conversation/conversation.controller.ts | <gh_stars>1-10
import { Body, Controller, Get, Post } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { SubscribeMessage } from '@nestjs/websockets';
import { CurrentUser } from 'src/shared/decorators/current-user';
import { User } from 'src/user/interfaces/user.interface';
impor... |
abanoubEssam/nestjs-realtime | src/conversation/conversation.module.ts | import { Module } from '@nestjs/common';
import { ConversationService } from './conversation.service';
import { ConversationController } from './conversation.controller';
import { ConversationSchema } from './schemas/conversation.schema';
import { CONVERSATION_MODEL_NAME } from 'src/shared/constants';
import { Mongoose... |
abanoubEssam/nestjs-realtime | src/user/user.controller.ts | import { Controller, Get } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { CurrentUser } from 'src/shared/decorators/current-user';
import { Public } from 'src/shared/decorators/is-public';
import { User } from './interfaces/user.interface';
import { UserService } from './user.... |
abanoubEssam/nestjs-realtime | src/socket.gateway.ts |
import {
SubscribeMessage,
WebSocketGateway,
OnGatewayInit,
WebSocketServer,
OnGatewayConnection,
OnGatewayDisconnect,
WsResponse,
} from '@nestjs/websockets';
import { Logger } from '@nestjs/common';
import { Socket, Server, } from 'socket.io';
@WebSocketGateway({ namespace: '/' })
export class Socket... |
abanoubEssam/nestjs-realtime | src/conversation/schemas/conversation.schema.ts | <reponame>abanoubEssam/nestjs-realtime
import { Schema, Types } from 'mongoose';
import { USER_MODEL_NAME } from 'src/shared/constants';
export const ConversationSchema: Schema = new Schema({
participants: [
{
user: {
type: Types.ObjectId,
ref: USER_MODEL_NAME
... |
abanoubEssam/nestjs-realtime | src/auth/strategies/jwt.strategy.ts | import { Injectable, UnauthorizedException } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { UserService } from 'src/user/user.service';
import { jwtConstants } from '../../shared/constants';
import { IJwtPayload } from '../interf... |
abanoubEssam/nestjs-realtime | src/user/user.service.ts | import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { USER_MODEL_NAME } from 'src/shared/constants';
import { User } from './interfaces/user.interface';
@Injectable()
export class UserService {
constructor(@InjectModel(USER_MODEL_NAM... |
abanoubEssam/nestjs-realtime | src/shared/constants.ts | export const USER_MODEL_NAME = "user";
export const CONVERSATION_MODEL_NAME = 'conversation';
export const jwtConstants = {
secret: 'secretKey',
}; |
abanoubEssam/nestjs-realtime | src/shared/utils/hash-password.ts | import * as bcrypt from 'bcryptjs';
export async function hashPassword(password: string) {
const salt = bcrypt.genSaltSync();
return await bcrypt.hash(password, salt);
}
|
abanoubEssam/nestjs-realtime | src/conversation/conversation.service.ts | <reponame>abanoubEssam/nestjs-realtime<gh_stars>1-10
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { CONVERSATION_MODEL_NAME } from 'src/shared/constants';
import { User } from 'src/user/inter... |
abanoubEssam/nestjs-realtime | src/auth/auth.service.ts | <filename>src/auth/auth.service.ts
import { Injectable, UnauthorizedException } from '@nestjs/common';
import { UserService } from '../user/user.service';
import { JwtService } from '@nestjs/jwt';
import { User } from 'src/user/interfaces/user.interface';
import { SignUpDto } from './dtos/sign-up.dto';
import { hashPas... |
abanoubEssam/nestjs-realtime | src/auth/dtos/sign-up.dto.ts | import { ApiProperty } from '@nestjs/swagger';
import { IsDefined, IsEmail, IsOptional, Matches } from 'class-validator';
export class SignUpDto {
@ApiProperty()
@IsDefined()
name: string;
@ApiProperty()
@IsDefined()
@IsOptional()
@IsEmail()
email: string;
@ApiProperty()
@IsDefined()
@Matches(n... |
abanoubEssam/nestjs-realtime | src/conversation/interfaces/conversation.interface.ts | <reponame>abanoubEssam/nestjs-realtime
import { Document } from "mongoose";
import { User } from "src/user/interfaces/user.interface";
export interface Conversation extends Document {
participants: string[] | User[];
}
|
abanoubEssam/nestjs-realtime | src/auth/auth.controller.ts | <filename>src/auth/auth.controller.ts
import { Body, Controller, Post, Req, Request, UseGuards } from '@nestjs/common';
import { LocalAuthGuard } from './guards/local-auth.guard';
import { AuthService } from './auth.service';
import { ApiTags } from '@nestjs/swagger';
import { SignUpDto } from './dtos/sign-up.dto';
imp... |
abanoubEssam/nestjs-realtime | src/user/schemas/user.schema.ts | <filename>src/user/schemas/user.schema.ts
import { Schema } from 'mongoose';
export const UserSchema: Schema = new Schema({
email: {
type: String,
required: true
},
name: {
type: String,
required: true
},
password: {
type: String,
required: true
}
},... |
sasha240100/gulp-browser-basedir | dist/index.d.ts | import "typings-global";
export import browserify = require("./gulpbrowser.browserify");
|
sasha240100/gulp-browser-basedir | dist/gulpbrowser.browserify.d.ts | <filename>dist/gulpbrowser.browserify.d.ts
import "typings-global";
declare let browserify: (transforms?: any[]) => any;
export = browserify;
|
sasha240100/gulp-browser-basedir | test/test.d.ts | <reponame>sasha240100/gulp-browser-basedir
import "typings-test";
import "should";
|
sasha240100/gulp-browser-basedir | dist/gulpbrowser.plugins.d.ts | import "typings-global";
export declare let beautylog: any;
export declare let through: any;
export declare let path: any;
export declare let browserify: any;
|
sasha240100/gulp-browser-basedir | ts/gulpbrowser.browserify.ts | import "typings-global";
import plugins = require("./gulpbrowser.plugins");
let browserify = function(transforms = []) {
if (!Array.isArray(transforms)) {
transforms = [transforms];
}
let forEach = function(file, enc, cb){ // do this with every chunk (file in gulp terms)
let bundleCall... |
sasha240100/gulp-browser-basedir | ts/index.ts | <reponame>sasha240100/gulp-browser-basedir
import "typings-global";
export import browserify = require("./gulpbrowser.browserify");
|
sasha240100/gulp-browser-basedir | test/test.ts | <reponame>sasha240100/gulp-browser-basedir
import "typings-test"
let plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
import "should";
describe("gulpBrowser", function () {
describe(".browserify"... |
sasha240100/gulp-browser-basedir | ts/gulpbrowser.plugins.ts | <filename>ts/gulpbrowser.plugins.ts
import "typings-global";
export let beautylog = require("beautylog");
export let through = require("through2");
export let path = require("path");
export let browserify = require("browserify");
|
dulsi/gamerzilla.net | frontend/src/GameListData.ts | import { http } from "./http";
export interface GameSummary {
currentPage: number;
pageSize: number;
totalPages: number;
games: GameListData[];
}
export interface GameListData {
shortname: string;
name: string;
earned: number;
total: number;
}
export interface GameData {
shortname: string;
name: ... |
dulsi/gamerzilla.net | frontend/src/App.tsx | import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { SignInPageWithRouter as SignInPage } from './SignInPage';
import { HomePage } from './HomePage';
import { GamePage } from './GamePage';
import { NotFoundPage } from './NotFoundPage';
import { Header } from './Header';
i... |
dulsi/gamerzilla.net | frontend/src/PageSelect.tsx | import { FC } from 'react';
import { Link } from 'react-router-dom';
import './PageSelect.css';
interface Props {
userName: string
currentPage: number;
totalPages: number;
setGameListLoading: () => void;
}
export const PageSelect: FC<Props> = ({userName, currentPage, totalPages, setGameListLoading}) => (
<di... |
dulsi/gamerzilla.net | frontend/src/GamePage.tsx | <gh_stars>1-10
import { useEffect, useState, FC, Fragment } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import { Page } from './Page';
import { PageTitle } from './PageTitle';
import { getGame, GameData } from './GameListData';
import { relativeAPIUrl } from './AppSettings';
import './GamePage... |
dulsi/gamerzilla.net | frontend/src/User.ts | import { http } from "./http";
export interface LoginData {
username: string;
password: string;
}
export interface UserData {
userName: string;
password: string;
admin: boolean;
visible: boolean;
}
const userDataEmpty: UserData = {
userName: "",
password: "",
admin: false,
visible: false
};
expo... |
dulsi/gamerzilla.net | frontend/src/Icons.tsx | <filename>frontend/src/Icons.tsx
import React from 'react';
import user from './user.svg';
export const UserIcon = () =>
<img src={user} alt="User" width="12px" />; |
dulsi/gamerzilla.net | frontend/src/RegisterPage.tsx | import { ChangeEvent, FC, FormEvent, useState, useEffect } from 'react';
import {
RouteComponentProps,
withRouter,
Link
} from 'react-router-dom';
import { Page } from './Page';
import { userRegister, UserData } from './User';
export const RegisterPage: FC<RouteComponentProps> = ({
history,
location,
}) =>... |
dulsi/gamerzilla.net | frontend/src/SignInPage.tsx | <reponame>dulsi/gamerzilla.net
import { ChangeEvent, FC, FormEvent, useState, useEffect } from 'react';
import {
RouteComponentProps,
withRouter,
Link
} from 'react-router-dom';
import { Page } from './Page';
import { userLogin, UserData, canRegister } from './User';
export const SignInPage: FC<RouteComponentP... |
dulsi/gamerzilla.net | frontend/src/GamesPage.tsx | import { useEffect, useState, FC } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import './GamesPage.css';
import { GameList } from './GameList';
import { Page } from './Page';
import { PageTitle } from './PageTitle';
import { PageSelect } from './PageSelect';
import { getGameList, GameSummary }... |
dulsi/gamerzilla.net | frontend/src/http.ts | <filename>frontend/src/http.ts
import { webAPIUrl } from './AppSettings';
export interface HttpRequest<REQB> {
path: string;
method?: string;
body?: REQB;
accessToken?: string;
}
export interface HttpResponse<RESB> extends Response {
parsedBody?: RESB;
}
export const http = <REQB, RESB>(
config: HttpReque... |
dulsi/gamerzilla.net | frontend/src/Styles.ts | <gh_stars>1-10
export const grey1 = '#383737';
export const grey2 = '#5c5a5a';
export const grey3 = '#857c81';
export const grey4 = '#b9b9b9';
export const grey5 = '#e3e2e2';
export const grey6 = '#f7f8fa';
export const primary1 = '#681c41';
export const primary2 = '#824c67';
export const accent1 = '#dbb365';
export co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.