repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
my-msblog/msblog-vite | src/locales/lang/module/constants/index.ts | export default {
zh: {
year: '年',
month: '月',
day: '日',
week: '周',
hour: '时',
minute: '分',
seconds: '秒',
all: '全部',
},
en: {
year: 'Year',
month: 'Month',
day: 'Day',
week: 'Week',
hour: 'Hour',
minute: 'Minute',
seconds: 'Seconds',
all: 'All',
}
}... |
my-msblog/msblog-vite | src/api/model/custom.ts |
export interface IdDTO{
id?: number;
idList?: Array<number>;
}
export interface UserVO {
id: number;
username: string;
phone: string;
email: string;
token: string;
introduction: string;
sex: number;
createTime: string;
}
|
my-msblog/msblog-vite | src/hooks/useModalContext.ts | import { InjectionKey } from 'vue';
import { useContext } from './core/useContext';
export interface ModalContextProps {
redoModalHeight: () => void;
}
const key: InjectionKey<ModalContextProps> = Symbol();
export function useModalContext() {
return useContext<ModalContextProps>(key);
}
|
my-msblog/msblog-vite | src/locales/index.ts | import { createI18n } from 'vue-i18n';
import type { App } from 'vue';
import zh from './lang/zh';
import en from './lang/en';
import ElementPlus from 'element-plus';
import ZhLocale from 'element-plus/lib/locale/lang/zh-cn'; // 中文
import EhLocale from 'element-plus/lib/locale/lang/en'; // 英文
export const i18nOption =... |
my-msblog/msblog-vite | src/constant/StoreOption.ts | export interface TabOption {
label: string;
name: string;
path: string;
}
export interface MenuOptions{
path: string;
nameZh: string;
component: any;
icon: string;
children: Array<MenuOptions>;
}
|
my-msblog/msblog-vite | src/views/client/article/data.ts | import { RecommendVO } from '@/api/model/client/article';
import { TagVO } from '@/api/model/client/home';
export interface IData{
commentList: Array<any>;
article: IArticle;
nouns: Array<TitleElement>;
like: number;
recommendList: Array<RecommendVO>;
}
export interface TitleElement{
title: any... |
my-msblog/msblog-vite | src/views/admin/user-manage/userProfile/components/data.ts | <reponame>my-msblog/msblog-vite
import { FormRulesMap} from 'element-plus/es/components/form/src/form.type';
import { BaseOptions } from '@/constant/Type';
import { useI18n } from '@/hooks/useI18n';
import { RoleString } from '@/constant/enums/role';
const { t } = useI18n();
export const editFormRule: FormRulesMap = {... |
my-msblog/msblog-vite | src/store/mutations.ts | export default {
setCodeKey(state: any, code: string) {
state.code_key = code;
},
clearUser(state: any) {
sessionStorage.clear();
state.user.user_id = 0;
state.user.username = '';
state.user.user_token = '';
state.user.user_email = '';
state.user.user_phone = '';
state.user.user_in... |
my-msblog/msblog-vite | src/constant/enums/sex.ts |
const sexEnum = {
0: '女',
1: '男',
};
export enum Sex {
FEMALE = 0,
MALE = 1,
}
export function getSex(id: number):string {
return sexEnum[id];
}
|
my-msblog/msblog-vite | src/locales/lang/en.ts | <filename>src/locales/lang/en.ts
import { module } from './module';
export default {
message: {
language: 'English',
successful_logout: 'Successful logout',
login_success: 'Login success',
enter_email: 'Please enter your email',
enter_username: 'Please enter your username',
input_phone: 'Pleas... |
my-msblog/msblog-vite | src/api/admin/context/write/index.ts | <reponame>my-msblog/msblog-vite<filename>src/api/admin/context/write/index.ts
import { BaseOptions, CustomOptions } from '@/constant/Type';
import request from '@/utils/axios/request';
enum API {
categoryList = '',
tags = '',
}
export function categoryList(){
return request.get<Array<CustomOptions>>({
... |
my-msblog/msblog-vite | src/api/admin/api-list/index.ts | <filename>src/api/admin/api-list/index.ts
import request from '@/utils/axios/request';
import { RequestItemVO } from '@/api/model/admin/api-list';
enum Api {
getApi = '/sys/all/interface',
}
export function getAllApi(){
return request.get<Array<RequestItemVO>>({
url: Api.getApi,
});
} |
my-msblog/msblog-vite | src/api/model/client/login-model.ts | <filename>src/api/model/client/login-model.ts
export interface CaptchaVO{
key: string;
img: string;
}
export interface LoginDTO{
code: string;
key: string;
password: string;
username: string;
}
|
my-msblog/msblog-vite | src/locales/lang/module/role/index.ts | export default {
zh: {
SYSTEM_ADMIN: '系统管理员',
CONTENT_MANAGER: '内容管理员',
VISITOR: '访客',
},
en: {
SYSTEM_ADMIN: 'SYSTEM ADMIN',
CONTENT_MANAGER: 'CONTENT MANAGER',
VISITOR: 'VISITOR',
}
};
|
my-msblog/msblog-vite | src/utils/axios/type.ts | <gh_stars>0
import { AxiosRequestConfig } from 'axios';
interface requestOption{
url: string;
data?: any;
config?: AxiosRequestConfig;
}
// 泛型接口
export interface Get {
<T>(option: requestOption): Promise<T>;
}
export interface Post {
<T>(option: requestOption): Promise<T>;
}
export interface Put {
<T>(opti... |
my-msblog/msblog-vite | src/store/modules/index.ts | import { ModuleTree } from 'vuex';
import tagView from './members/tag-views';
import user from '@/store/modules/members/user';
import permission from '@/store/modules/members/permission';
import list from './members/list';
export const modules: ModuleTree<any> = {
tagView,
user,
permission,
list,
};
|
my-msblog/msblog-vite | src/store/modules/members/list.ts | import { CategoryVO } from '@/api/model/client/category';
import { ActionTree, GetterTree } from 'vuex';
import { arryIsEmpty, strIsEmpty } from '@/utils';
interface ListState{
categoryList: Array<CategoryVO>;
category: string;
tag: string;
}
const state: ListState = {
categoryList: [],
category: '',
tag: '... |
my-msblog/msblog-vite | src/layout/client/components/data.ts | interface BarMenuItem {
route: string;
icon: string;
text: string;
}
export const menuBarItem: BarMenuItem[]= [
{
route: '/',
icon: 'HomeFilled',
text: 'homepage',
},
{
route: '/archive',
icon: 'FolderOpened',
text: 'archive',
},
{
route: '/categories',
icon: 'Menu',
... |
my-msblog/msblog-vite | src/api/client/login/index.ts | <reponame>my-msblog/msblog-vite<filename>src/api/client/login/index.ts
import request from '@/utils/axios/request';
import { CaptchaVO, LoginDTO } from '@/api/model/client/login-model';
import { UserVO } from '@/api/model/custom';
enum Api {
login = '/login',
spec = '/code/captcha/spec',
arithmetic = '/code/capt... |
my-msblog/msblog-vite | src/api/model/sys-model.ts |
export interface PhoneDTO{
phone: string;
}
export interface MenuVO{
path: string;
nameZh: string;
component: string;
icon: string;
children: Array<MenuVO>;
}
|
my-msblog/msblog-vite | src/api/sys/index.ts | <filename>src/api/sys/index.ts
import request from '@/utils/axios/request';
import { MenuVO, PhoneDTO } from '@/api/model/sys-model';
enum Api {
sms = '/code/sms',
authentication = 'api/authentication',
menu = '/info/menu',
logout = '/logout',
}
export function getSMS(dto: PhoneDTO) {
return request.post<st... |
my-msblog/msblog-vite | src/views/admin/dashboard/components/data.ts | <filename>src/views/admin/dashboard/components/data.ts
export interface GrowCardItem {
icon: string;
title: string;
value: number;
total: number;
color: string;
action: string;
}
export interface CardValue {
visit: number;
user: number;
articles: number;
comments: number;
}
|
my-msblog/msblog-vite | src/plugins/vm-editor.ts | <reponame>my-msblog/msblog-vite
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@... |
my-msblog/msblog-vite | src/store/index.ts | import { createStore } from 'vuex';
import { modules } from './modules';
import actions from './actions';
import getters from './getters';
import mutations from '@/store/mutations';
export default createStore({
state: {
code_key: '',
},
mutations,
actions,
modules,
getters,
});
|
my-msblog/msblog-vite | src/store/getters.ts | export default {
getCodeKey(state: any) {
return state.code_key;
},
};
|
my-msblog/msblog-vite | src/views/client/links/data.ts | <gh_stars>0
export interface ILink{
url?: string;
name: string;
desc: string;
}
export const mock: ILink[] = [
{
url: 'https://crazywong.com/img/avatar.png',
name: 'dd',
desc: 'i am dd',
},
{
url: 'https://crazywong.com/img/avatar.png',
name: 'dd',
desc: 'i am dd',
},
{
url:... |
my-msblog/msblog-vite | src/api/admin/system/menu-manage/index.ts | import request from '@/utils/axios/request';
import { MenuTreeVO } from '@/api/model/admin/system';
enum Api {
getMenuTress = '',
}
export function getMenuTrees(){
return request.get<MenuTreeVO[]>({
url: Api.getMenuTress,
});
} |
my-msblog/msblog-vite | src/locales/lang/zh.ts | <reponame>my-msblog/msblog-vite
import { module } from './module';
export default {
message: {
language: '中文',
successful_logout: '成功登出',
login_success: '登录成功',
input_phone: '请输入手机号',
enter_email: '请输入邮箱',
enter_username: '请输入用户名',
sms_send_success: '验证码发送成功',
modified_successfully: '修... |
my-msblog/msblog-vite | src/api/admin/user-profile/index.ts | <reponame>my-msblog/msblog-vite
import request from '@/utils/axios/request';
import { IdDTO } from '@/api/model/custom';
import { BaseDTO, PageInfo } from '@/api/model/core';
import { UserProfileVO, StatusDTO } from '@/api/model/admin/user-profile';
import { UserTableChangeDTO } from '@/api/model/user-info-model';
enum... |
my-msblog/msblog-vite | src/api/model/client/article.ts | <reponame>my-msblog/msblog-vite<filename>src/api/model/client/article.ts
import { TagVO } from "./home";
export interface CommentItemVO{
id: number;
articleId: number;
parentId: number;
publishTime: Date;
children: CommentItemVO[];
context: string;
like: number;
commenterId: number;
... |
my-msblog/msblog-vite | src/api/client/acrhive/index.ts | import request from '@/utils/axios/request';
import { BaseDTO, PageInfo } from '@/api/model/core';
import { AcrhiveVO } from'@/api/model/client/acrhive';
enum Api {
page = '/article/date/page',
}
export function getArchivePage(dto: BaseDTO){
return request.post<PageInfo<AcrhiveVO>>({
url: Api.page,
data: d... |
nukeguys/thenueye | src/pages/index.tsx | import { Meta } from '../layout/Meta';
import { Main } from '../main';
import PostCard from '../main/PostCard';
import { Post } from '../type';
const POSTS: Post[] = [
{
topic: { id: 'sports', name: 'Sports' },
title: 'One-Hit Wonders in Sports',
description: `The greatest single-season anomalies in the ... |
Bhaskers-Blu-Org2/monaco-json | src/jsonWorker.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*------------------------------------------------------------... |
Bhaskers-Blu-Org2/monaco-json | src/languageFeatures.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*------------------------------------------------------------... |
Bhaskers-Blu-Org2/monaco-json | src/jsonMode.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*------------------------------------------------------------... |
Bhaskers-Blu-Org2/monaco-json | src/monaco.contribution.ts | <filename>src/monaco.contribution.ts
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*-----------------------... |
Modelata/fire | src/decorators/deletion-mode.decorator.ts | import 'reflect-metadata';
import { MFDeleteMode } from '../enums/mf-delete-mode.enum';
/**
* Sets default deletion mode of the targetted DAO
*
* @param mode hard or soft mode (default: hard)
*/
export function DeletionMode(mode: MFDeleteMode): any {
// eslint-disable-next-line @typescript-eslint/ban-types
ret... |
Modelata/fire | src/interfaces/tool-types.ts | <reponame>Modelata/fire
// eslint-disable-next-line @typescript-eslint/ban-types
export declare type NonFunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T];
export declare type MFOmit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
Modelata/fire | config/angular.exports.ts | <gh_stars>0
import firebase from 'firebase/compat/app';
import { Observable } from 'rxjs';
export declare type OrderByDirection = firebase.firestore.OrderByDirection;
export declare type WhereFilterOp = firebase.firestore.WhereFilterOp;
export declare type DocumentReference<M> = firebase.firestore.DocumentReference;
e... |
Modelata/fire | src/helpers/object.helper.ts | import { MFLogger } from '../mf-logger';
/**
* creates an hidden property in the given object
*
* @param obj the object to create the attribute on
* @param propName the name of the property
* @param propVal the value of the property
*/
export function createHiddenProperty(obj: { [key: string]: any }, propName: s... |
Modelata/fire | src/decorators/users-collection-path.decorator.ts | <reponame>Modelata/fire
import 'reflect-metadata';
/**
* Sets userCollectionPath attribute of the targetted AuthDAO
*
* @param path user collection path
*/
export function UsersCollectionPath(path: string): any {
// eslint-disable-next-line @typescript-eslint/ban-types
return (target: Object) => {
Reflect.... |
Modelata/fire | src/helpers/model.helper.ts | <gh_stars>0
/* eslint-disable no-prototype-builtins */
import { IMFLocation, IMFModel } from '../interfaces';
import { mustache } from './string.helper';
import 'reflect-metadata';
import { MFLogger } from '../mf-logger';
/**
* Returns the path from a collection mustache path ad a location object.
*
* @param mustac... |
Modelata/fire | src/helpers/firestore.helper.ts | <filename>src/helpers/firestore.helper.ts
import { DocumentData } from './../specifics/exports';
export function convertDataFromDb(data: DocumentData): DocumentData {
if (data) {
for (const key in data) {
// eslint-disable-next-line no-prototype-builtins
if (data.hasOwnProperty(key) && data[key]) {
... |
Amirhoseinpg/myshoppingapi | src/http-exception.filter.ts | import { ArgumentsHost, Catch, ExceptionFilter, HttpException ,HttpStatus} from '@nestjs/common';
@Catch()
export class HttpExceptionFilter implements ExceptionFilter {
catch(exception: HttpException, host: ArgumentsHost) {
const ctx = host.switchToHttp();
const response = ctx.getResponse();
const sta... |
Amirhoseinpg/myshoppingapi | test/constant.ts | import 'dotenv/config';
export const app=`http://localhost:${process.env.PORT}`
export const database=process.env.MONGO_TEST; |
Amirhoseinpg/myshoppingapi | src/interfaces/product.ts | import { Document } from 'mongoose';
export interface Product extends Document {
title: string;
image: string;
description: string;
price: number;
created: Date;
} |
Amirhoseinpg/myshoppingapi | src/app.controller.ts | import { Controller, Get, Render } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
@Render("index.ejs")
mainroot(){
return {pageTitle:"محصولات"}
}
@Get("/create")
@Render("... |
Amirhoseinpg/myshoppingapi | test/product.e2e-spec.ts | import { CreateProductDTO } from './../dist/product/product.dto.d';
import * as mongoose from 'mongoose'
import axios from 'axios'
import * as request from 'supertest'
import { app, database } from './constant'
import { HttpStatus } from '@nestjs/common';
beforeAll(async () => {
await mongoose.connect(database);
... |
Amirhoseinpg/myshoppingapi | test/app.e2e-spec.ts | <reponame>Amirhoseinpg/myshoppingapi<filename>test/app.e2e-spec.ts<gh_stars>0
import 'dotenv/config'
import * as request from 'supertest';
import {app} from './constant'
describe('ROOT', () => {
it('should connect and ping', () => {
return request(app)
.get('/')
.expect(200)
.expect('Content-... |
Amirhoseinpg/myshoppingapi | src/product/product.dto.ts | export interface CreateProductDTO {
title: string;
image: string;
description: string;
price: number;
}
export type UpdateProductDTO = Partial<CreateProductDTO>; |
Amirhoseinpg/myshoppingapi | src/product/product.service.ts | <reponame>Amirhoseinpg/myshoppingapi<filename>src/product/product.service.ts<gh_stars>0
import { CreateProductDTO, UpdateProductDTO } from './product.dto';
import { Product } from './../interfaces/product';
import { HttpException, HttpStatus, Injectable, NotFoundException,} from '@nestjs/common';
import { InjectModel }... |
Amirhoseinpg/myshoppingapi | src/product/product.controller.ts | <reponame>Amirhoseinpg/myshoppingapi
import {
Body,
Controller,
Delete,
Get,
Param,
Post,
Put,
} from '@nestjs/common';
import { Product } from '../interfaces/product';
import { CreateProductDTO, UpdateProductDTO } from './product.dto';
import { ProductService } from './product.s... |
SproutProject/sptoj-web | src/api.ts | <reponame>SproutProject/sptoj-web<filename>src/api.ts
import axios from 'axios'
import * as _ from 'lodash'
import * as moment from 'moment-timezone'
import { User, UserCategory } from './user-service'
export interface PartialList<T> {
data: T[]
count: number
}
export interface Profile {
uid: number
name: str... |
SproutProject/sptoj-web | src/user-service.ts | <reponame>SproutProject/sptoj-web<filename>src/user-service.ts
export enum UserLevel {
user = 3,
kernel = 0,
}
export enum UserCategory {
universe = 0,
algo = 1,
clang = 2,
pylang = 3,
}
export interface User {
uid: number
mail: string
name: string
level: UserLevel
category: UserCategory
}
expo... |
gurwinderiam/Semantic-UI-React | src/modules/Modal/index.d.ts | <reponame>gurwinderiam/Semantic-UI-React
import { SemanticSIZES } from '../..';
import * as React from 'react';
interface ModalProps {
/** An element type to render as (string or function). */
as?: any;
/** A modal can reduce its complexity */
basic?: boolean;
/** Primary content. */
children?: React.Re... |
gurwinderiam/Semantic-UI-React | src/collections/Form/index.d.ts | <filename>src/collections/Form/index.d.ts
import { ButtonProps } from '../../elements/Button';
import {
ReactFocusEvents,
ReactFormEvents,
SemanticFormOnClick,
SemanticGenericOnClick,
SemanticWIDTHS
} from '../..';
import * as React from 'react';
import { InputProps } from '../../elements/Input/inde... |
gurwinderiam/Semantic-UI-React | src/modules/Popup/index.d.ts | import { SemanticPOSITIONING, SemanticSIZES } from '../..';
import { PortalProps } from '../../addons/Portal';
export type PopupPropOn = 'hover' | 'click' | 'focus';
interface PopupProps extends PortalProps {
/** Display the popup without the pointing arrow */
basic?: boolean;
/** Primary content. */
childr... |
gurwinderiam/Semantic-UI-React | src/elements/Flag/index.d.ts | <filename>src/elements/Flag/index.d.ts
import * as React from 'react';
import { SemanticCOUNTRY } from '../..';
interface FlagProps {
[key: string]: any;
/** An element type to render as (string or function). */
as?: any;
/** Additional classes. */
className?: string;
/** Flag name, can use the two digi... |
gurwinderiam/Semantic-UI-React | src/collections/Menu/index.d.ts | <reponame>gurwinderiam/Semantic-UI-React
import * as React from 'react';
import { SemanticCOLORS, SemanticWIDTHS } from '../..';
export interface MenuProps {
[key: string]: any;
/** An element type to render as (string or function). */
as?: any;
/** Index of the currently active item. */
activeIndex?: numb... |
gurwinderiam/Semantic-UI-React | src/addons/Confirm/index.d.ts | import * as React from 'react';
interface ConfirmProps {
/** The cancel button text */
cancelButton?: string;
/** The OK button text */
confirmButton?: string;
/** The ModalContent text. */
content?: string;
/** The ModalHeader text */
header?: string;
/** Called when the Cancel button is clicke... |
gurwinderiam/Semantic-UI-React | src/addons/Select/index.d.ts | import * as React from 'react';
import {
DropdownDivider,
DropdownHeader,
DropdownItem,
DropdownMenu,
DropdownProps
} from '../../modules/Dropdown';
interface SelectProps extends DropdownProps {
selection: true;
}
interface SelectComponent extends React.StatelessComponent<SelectProps> {
Divider: typeof ... |
gurwinderiam/Semantic-UI-React | src/views/Card/index.d.ts | <reponame>gurwinderiam/Semantic-UI-React
import * as React from 'react';
import { SemanticCOLORS, SemanticWIDTHS } from '../..';
interface CardProps {
[key: string]: any;
/** An element type to render as (string or function). */
as?: any;
/** A Card can center itself inside its container. */
centered?: boo... |
wcordewiner/joker-jailbreak | src/Stack.tsx | import React from "react";
import { Card, Deck } from "./Model";
import { TopCard } from "./TopCard";
import "./Stack.css";
export type StackProps = {
stack: Deck;
onCardClick: (card: Card) => void;
selectedCards: Set<Card>;
};
export const Stack = ({ stack, onCardClick, selectedCards }: StackProps) => {
retu... |
wcordewiner/joker-jailbreak | src/version.ts | <gh_stars>0
export const LIB_VERSION = "1.0.3";
|
wcordewiner/joker-jailbreak | src/TopCard.tsx | <reponame>wcordewiner/joker-jailbreak<filename>src/TopCard.tsx
import React from "react";
import { Card, SuitColor, SuitKind } from "./Model";
import "./common.css";
import "./TopCard.css";
export type TopCardProps = {
card?: Card;
onCardClick: (card: Card) => void;
nrOfCards: number;
selectedCards: Set<Card>;... |
wcordewiner/joker-jailbreak | src/Controller.tsx | import React from "react";
import { Card, Deck, GameState, SuitColor } from './Model';
import Button from "react-bootstrap/Button";
import "./common.css";
import "./Controller.css";
export type ControllerProps = {
gameState: GameState;
onNewGame: () => void;
selectedCards: Set<Card>;
onRemoveSelectedCards: () ... |
wcordewiner/joker-jailbreak | src/Model.tsx | export enum GameState {
Playing,
Win,
}
export enum SuitKind {
Clubs,
Diamonds,
Hearts,
Spades,
Joker,
}
export enum SuitColor {
Red,
Black,
}
export interface Suit {
kind: SuitKind;
color: SuitColor;
symbol: String;
}
export const Clubs: Suit = {
kind: SuitKind.Clubs,
color: SuitColor.B... |
wcordewiner/joker-jailbreak | src/JokerJailBreak.tsx | <filename>src/JokerJailBreak.tsx
import React, { useEffect, useState } from "react";
import { Card, Deck, GameState, SuitKind } from "./Model";
import { Stack } from "./Stack";
import { Controller } from "./Controller";
// import discardImage from './card-discard.svg';
import "./JokerJailBreak.css";
export type JokerJ... |
wcordewiner/joker-jailbreak | src/index.tsx | <gh_stars>0
import React from "react";
import ReactDOM from "react-dom";
import { LIB_VERSION } from "./version";
import { Deck, JokerCard } from "./Model";
import { JokerJailBreak } from "./JokerJailBreak";
import { create52CardDeck, shuffleDeck } from "./Utils";
// import reportWebVitals from "./reportWebVitals";
imp... |
wcordewiner/joker-jailbreak | src/Utils.tsx | import { Card, Clubs, Deck, Diamonds, Hearts, Spades } from "./Model";
export const create52CardDeck = (): Deck => {
let cards: Array<Card> = [];
[Clubs, Diamonds, Hearts, Spades].forEach((cardSuit) => {
for (let cardValue = 1; cardValue <= 13; cardValue++) {
cards.push({ suit: cardSuit, value: cardValue... |
Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/aws-lambda-eventbridge/test/aws-lambda-eventbridge.test.ts | /**
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or ... |
Conrad2134/aws-solutions-constructs | source/patterns/@aws-solutions-constructs/aws-s3-step-function/lib/index.ts | /**
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or ... |
yujin97/nestjs-task-management | src/tasks/tasks.controller.ts | <filename>src/tasks/tasks.controller.ts
import { Body, Controller, Delete, Get, Param, Patch, Post, Query, UsePipes, ValidationPipe } from '@nestjs/common';
import { Task } from './task.model';
import { TasksService } from './tasks.service';
import { CreateTaskDto } from './dto/create-task-dto';
import { UpdateTaskDto ... |
yujin97/nestjs-task-management | src/tasks/dto/update-task-dto.ts | import { TaskStatus } from '../task.model';
export class UpdateTaskDto {
status: TaskStatus;
} |
pobo380/vscode-proto3 | src/proto3SyntacticScopeGuesser.ts | <gh_stars>100-1000
import { ITokenizerHandle, tokenize } from "protobufjs";
import * as vscode from "vscode";
class position {
constructor(public line: number, public col: number) {}
static from(pos: position): position {
return Object.assign(new position(0, 0), pos);
}
}
class token {
constructor(public... |
pobo380/vscode-proto3 | src/proto3Configuration.ts | 'use strict';
import vscode = require('vscode');
import path = require('path');
import fs = require('fs');
import os = require('os');
export class Proto3Configuration {
private readonly _configSection: string = 'protoc';
private _config: vscode.WorkspaceConfiguration;
private _configResolver: Configurati... |
BogdanMihaiciuc/ThingTransformer | src/transformer/ThingTransformer.ts | <gh_stars>1-10
import * as ts from 'typescript';
import { TWEntityKind, TWPropertyDefinition, TWServiceDefinition, TWEventDefinition, TWSubscriptionDefinition, TWBaseTypes, TWPropertyDataChangeKind, TWFieldBase, TWPropertyRemoteBinding, TWPropertyRemoteFoldKind, TWPropertyRemotePushKind, TWPropertyRemoteStartKind, TWPr... |
BogdanMihaiciuc/ThingTransformer | src/transformer/DebugTypes.ts | /**
* Describes a breakpoint locationr.
*/
export interface Breakpoint {
/**
* Start line of breakpoint location.
*/
line: number;
/**
* Optional start column of breakpoint location.
*/
column?: number;
/**
* Optional end line of breakpoint location if the locatio... |
BogdanMihaiciuc/ThingTransformer | src/transformer/TWCoreTypes.ts | export interface TWInfoTable {
dataShape: {
fieldDefinitions: Record<string, TWFieldBase>;
};
rows: Record<string, unknown>[];
}
export interface TWFieldBase<T = any> {
name: string;
baseType: string;
description: string;
aspects: TWFieldAspects<T>;
ordinal: number;
}
export ... |
skimah/skimah | packages/ds-json/src/index.ts | <filename>packages/ds-json/src/index.ts
export { default } from "./json";
export { Config } from "./json";
|
skimah/skimah | packages/ds-json/test/json.test.ts | <reponame>skimah/skimah
import { generate, SkimahConfig } from "@skimah/api";
import { graphql } from "graphql";
import Records from "../src/json";
const typeDefs = `
type Customer @datasource(name: "customers") {
id: ID @named(as: "CustomerId")
firstName: String @named(as: "FirstName")
lastName: S... |
skimah/skimah | packages/api/test/datasource.test.ts | <reponame>skimah/skimah
import { Datasource } from "../src/types";
import generate from "../src/generate";
describe("Schema Datasource", () => {
const typeDefs = `
type SpecialUser @datasource(name: "users") {
userid: Int @unique
}
type Profile @datasource(name: "profiles") {
... |
skimah/skimah | packages/api/src/relations.ts | import {
getPluralName,
ObjectTypeComposer,
SchemaComposer
} from "graphql-compose";
import { Model } from "./types";
export const isFieldRelation = (fieldName: string, tc: ObjectTypeComposer) => {
const isDefined = !!tc.getFieldDirectiveByName(fieldName, "relation");
return isDefined;
};
export const const... |
skimah/skimah | packages/api/src/models/selection.ts | <filename>packages/api/src/models/selection.ts<gh_stars>1-10
import { ResolveTree } from "graphql-parse-resolve-info";
import {
Attribute,
Criteria,
CriteriaFilter,
Model,
QueryModel,
Relation
} from "../types";
/**
* Converts graphql arguments criteria and criteria filter
*
* 1. { where: { and : [ { na... |
skimah/skimah | packages/api/test/readonly.test.ts | <filename>packages/api/test/readonly.test.ts
import { graphql } from "graphql";
import { ObjectTypeComposer, schemaComposer } from "graphql-compose";
import generate from "../src/generate";
import { Datasource } from "../src/types";
const typeDefs = `
type User {
userid: Int
username: String
... |
skimah/skimah | packages/api/src/resolvers/create.ts | import { getPluralName } from "graphql-compose";
import createCreation from "../models/creation";
import { ResolverDefinition } from "./index";
/**
* @internal
*/
export default ({
models,
datasources,
type: tc,
composer
}: ResolverDefinition): string => {
const name = getPluralName(`create${tc.getTypeName... |
skimah/skimah | packages/api/test/relation.test.ts | import generate from "../src/generate";
import { Datasource, SkimahResult } from "../src/types";
import { graphql } from "graphql";
const typeDefs = `
type User {
userid: ID
email: String
age: Int
height: Float
videos: [Video] @relation(field: "publisher")
}
type V... |
skimah/skimah | packages/api/src/filter.ts | <reponame>skimah/skimah<filename>packages/api/src/filter.ts
import {
getPluralName,
InputTypeComposerFieldConfigAsObjectDefinition,
ObjectTypeComposer,
SchemaComposer
} from "graphql-compose";
const TYPE_OPERATORS = {
Boolean: ["eq", "ne"],
Int: ["eq", "ne", "lte", "lt", "in", "nin", "gte", "gt"],
Float:... |
skimah/skimah | packages/ds-csv/test/csv.test.ts | <filename>packages/ds-csv/test/csv.test.ts
import { generate, SkimahConfig } from "@skimah/api";
import { graphql } from "graphql";
import CSVSource from "../src/csv";
const typeDefs = `
type Album @datasource(name: "albums") {
id: ID @named(as: "AlbumId")
title: String @named(as: "Title")
artist: Artis... |
skimah/skimah | packages/api/src/index.ts | export { default as generate } from "./generate";
export * from "./datasource";
export * from "./types";
|
skimah/skimah | packages/api/test/resolvers/delete.test.ts | <reponame>skimah/skimah<filename>packages/api/test/resolvers/delete.test.ts<gh_stars>1-10
import generate from "../../src/generate";
import { Datasource } from "../../src/types";
import { graphql } from "graphql";
const typeDefs = `
type User {
userid: ID
age: Int
height: Float
avat... |
skimah/skimah | packages/api/src/models/creation.ts | import { Model, MutationModel, MutationAttribute } from "../types";
interface CreationArg {
baseModel: Model;
models: { [key: string]: Model };
/* eslint-disable @typescript-eslint/no-explicit-any */
values: any;
parentType?: string;
}
/**
* Create a creation model with the arg value mapped to the attribut... |
skimah/skimah | packages/api/test/models/creation.test.ts | import { graphql } from "graphql";
import generate from "../../src/generate";
import { Datasource } from "../../src/types";
const typeDefs = `
type User {
userid: ID
email: String
username: String
profile: Profile @relation
}
type Profile {
id: ID
type: String
}
`;
... |
skimah/skimah | packages/api/test/resolvers/find.test.ts | <filename>packages/api/test/resolvers/find.test.ts
import generate from "../../src/generate";
import { Datasource } from "../../src/types";
import { graphql } from "graphql";
const typeDefs = `
type User @datasource(name: "users") {
userid: ID
email: String
age: Int
height: Float
... |
skimah/skimah | packages/api/src/generate.ts | <reponame>skimah/skimah<filename>packages/api/src/generate.ts<gh_stars>1-10
import {
ObjectTypeComposer,
SchemaComposer,
InterfaceTypeComposer
} from "graphql-compose";
import { nullSource } from "./datasource";
import createInputFilter from "./filter";
import createInput from "./inputs";
import createModel from ... |
skimah/skimah | packages/api/test/resolvers/create.test.ts | import generate from "../../src/generate";
import { Datasource } from "../../src/types";
import { graphql } from "graphql";
const typeDefs = `
type User {
userid: ID
age: Int
height: Float
avatar: Avatar @relation
}
type Avatar {
id: ID
url: String
}
`;
de... |
skimah/skimah | packages/api/test/models/base.test.ts | import { schemaComposer } from "graphql-compose";
import createModel from "../../src/models/base";
const typeDefs = `
directive @datasource(
name: String
) on OBJECT
directive @relation(
field: String
) on FIELD_DEFINITION
directive @unique on FIELD_DEFINITION
directive @named(as... |
skimah/skimah | packages/api/src/resolvers/index.ts | <gh_stars>1-10
import { SchemaComposer, ObjectTypeComposer } from "graphql-compose";
import { Datasource, Model } from "../types";
import findResolver from "./find";
import createResolver from "./create";
import updateResolver from "./update";
import deleteResolver from "./delete";
/**
* @internal
*/
export interfa... |
skimah/skimah | packages/api/src/datasource.ts | <filename>packages/api/src/datasource.ts
import {
Datasource,
Model,
MutationModel,
Criteria,
QueryModel
} from "./types";
export const noopSource = (): Datasource => {
return {
initialize: (_: Model[]) => Promise.resolve(null),
select: (_: QueryModel) => Promise.resolve([]),
create: (_: Muta... |
skimah/skimah | packages/api/test/filter.test.ts | <gh_stars>1-10
import { schemaComposer, ObjectTypeComposer } from "graphql-compose";
import createInputFilter from "../src/filter";
const typeDefs = `
type User {
userid: ID
username: String
online: Boolean
height: Float
age: Int
status: Status
comments: [Comment]
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.