blob_id large_stringlengths 40 40 | language large_stringclasses 1
value | repo_name large_stringlengths 5 119 | path large_stringlengths 4 271 | score float64 2.52 4.84 | int_score int64 3 5 | text stringlengths 26 4.09M |
|---|---|---|---|---|---|---|
d19a4f831e4157241a16ac0136c918320d46f07b | TypeScript | jasper7466/mf.messenger.praktikum.yandex | /src/modules/Component.ts | 2.8125 | 3 | import EventBus from './EventBus';
import Store from './Store';
import {PlainObject} from "../types";
type Property = Record<string, any>;
interface Meta {
tagName: string;
props: Property;
storePath: string | null;
}
const store = new Store();
export default class Component {
static EVENTS = {
... |
4e978c402beea00472030a4082e7772b716317e2 | TypeScript | HerrLoesch/ionic-rc2-workshop-devmedia | /src/providers/movies.ts | 2.65625 | 3 | import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import { forEach } from 'lodash';
import { Movie } from '../domain/Movie';
import {MovieConverter} from '../domain/MovieConverter';
@Injectable()
export class Movies {
constructor(public http: Http) {
... |
f72f23079ae39cc371c32c04f2157c6a949eefba | TypeScript | kacchan6/grid-layout | /src/tokenizer/track.ts | 3.078125 | 3 | import { Tokenizer } from './base';
const trackListSplitChars = '()[],/';
export class TrackTokenizer extends Tokenizer {
getTokens(): string[] {
const tokens: string[] = [];
let token: string = '';
let index: number = 0;
while (index < this.length) {
const char = this.text[index];
const... |
d5f116e01a839eb314cd3b849887b40fc7b5b08e | TypeScript | Jhonatangiraldo/statistics-people | /src/app/people-presentation/people-presentation.component.ts | 2.703125 | 3 | import { PeopleState } from './../reducer/appStates';
import { SETPEOPLE } from './../reducer/reducer';
import { Person } from './../models/person';
import { PeopleService } from './../services/people.service';
import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
const MALE = 'Male';... |
0c0f26f9c7996d266d673de71f30b3423a6ec586 | TypeScript | jpdenford/advent-of-code-2020 | /src/day4/passportProcessing.ts | 2.9375 | 3 | import R from 'ramda'
import { readFile, readFileLines } from '../fileUtils'
const passportDetails = (contents: string) =>
R.pipe(R.split(/\s+/), R.map(R.split(':')), Object.fromEntries)(contents)
const REQUIRED_FIELDS = ['ecl', 'pid', 'eyr', 'hcl', 'byr', 'iyr', 'hgt']
const chunkPassports = (fileContents: string... |
b6c6ad52049fb5f62ace4616be315d2cbdc37d29 | TypeScript | vittorfigueiredo/crud-nestjs | /src/user/create-user-dto.ts | 2.546875 | 3 | /**
* DTO são os dados modelados e prontos que são passados pela rede,
* mais especificamente, ente o service e o controller.
*/
export class CreateUserDto {
name: string;
email: string;
}
|
d4ab928824f733750ff91902b6491378db2874d9 | TypeScript | zimejin/SlagalicaGame | /apps/slagalica-api/src/app/models/multiplayer-game-result.model.ts | 2.59375 | 3 | import { model, Schema, Document } from 'mongoose';
import {
MultiplayerGame as IMultiplayerGame,
PlayerRole
} from '@slagalica/data';
import moment from 'moment';
type MultiplayerGameResult = IMultiplayerGame & Document;
export const MultiplayerGameResultSchema = new Schema({
red: { type: Schema.Types.ObjectId... |
2aae72344334f2d4f4ea44e4a9ac226d74c0ad11 | TypeScript | hive-lang/hive-lang | /src/functional/collections/assoc-lists/lookup.spec.ts | 2.609375 | 3 | import { expect } from "chai";
import { lookup } from './lookup';
import { assocFromObject } from "./assoc-list";
describe('function/collections/asssoc-lists/lookup', function() {
it('finds nothing in null', function() {
expect(lookup(null, 'a')).equals(null);
});
it('finds nothing if key missing', function... |
196283abc7a76df014a95c00cdf0bf4c11d33d61 | TypeScript | felipeneuhauss/tech-challenge-backend | /src/lib/actors.ts | 2.984375 | 3 | import { knex } from '../util/knex'
import { Movie } from './movies'
import Knex from "knex";
export interface Actor {
id: number
name: string
bio: string
born_at: Date
}
export interface FavouriteGenre {
name: string
appearances: number
}
export function list(): Promise<Actor[]> {
return knex.from('ac... |
6f9c8fb36854c324871c2b87de498da9439f0826 | TypeScript | LloydTDavies/angular-fitness | /src/app/store/actions/training.actions.ts | 2.703125 | 3 | import { Action } from '@ngrx/store';
import { Exercise } from 'src/app/training/exercise.model';
export enum TrainingActionTypes {
SetAvailableTraining = '[Training] Set Available Training',
SetFinishedTraining = '[Training] Set Finished Training',
StartTraining = '[Training] Start Training',
StopTrai... |
ddd26e4901483b4d3bf209d19c6e04e07ef78640 | TypeScript | atsumaru/mv-plugins | /src/AtsumaruGlobalServerVariable.ts | 3.171875 | 3 | /*:
* @plugindesc RPGアツマールのグローバルサーバー変数のためのプラグインです
* @author RPGアツマール開発チーム
*
* @param value
* @type variable
* @text 現在値
* @desc グローバルサーバー変数の取得時に、現在値を代入する変数の番号を指定します。
* @default 0
*
* @param minValue
* @type variable
* @text 最小値
* @desc グローバルサーバー変数の取得時に、最小値を代入する変数の番号を指定します。
* @default 0
*
* @param maxVal... |
ca403a696a0ae9ac2e1a767b8980b39170c35d91 | TypeScript | FabricioHQ/Comfeco-Sapper | /src/components/Auth/signup_validate.ts | 3.21875 | 3 | export const validateEmail = (email: string) => {
const regex = /^(?:[^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*|"[^\n"]+")@(?:[^<>()[\].,;:\s@"]+\.)+[^<>()[\]\.,;:\s@"]{2,63}$/i
if (regex.test(email)) {
return { valid: true, message: 'El correo es uno válido.' };
} else {
return {valid: false, message: '... |
b9407e1f47e198204f7ff4561a7a21f947844a8f | TypeScript | adhywiranata-tiketdotcom/rest-query | /src/utils/cachePersistor.ts | 3.140625 | 3 | import { CachedData, StoreHashMap } from '../interfaces';
const CACHE_PERSISTOR_KEY_PREFIX = 'tix_rest_query_persisted_cache';
const INITIAL_CACHE_VAL = '{}';
const storageEngine = window.localStorage;
/**
* CachePersistor works as a single source of truth - engine on cache persistence
* This pattern avoids any dir... |
ec089c0ea0e4d080851a76047f0af7b3d5d8953e | TypeScript | n0uk/glorio-client | /src/services/hatservice.ts | 2.578125 | 3 | import {Service} from "./servicemanager";
import Game from "../states/game";
import {Protocol} from "../protocol/protocol";
import MessageType = Protocol.MessageType;
import Message = Protocol.Message;
import HatComponent from "../factory/components/hat";
import {EventEmitter} from "events";
import HatType = Protocol.H... |
9425d5dd56fbeb5003ffc68f3bc53c63f2b5f178 | TypeScript | curuvijam/frontPoslovna | /poslovna-front/src/app/services/valute.service.ts | 2.5625 | 3 | import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { catchError, map, tap } from 'rxjs/operators';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Valuta } from '../modeli/valuta';
import { NovaValuta } from ... |
a27f3b84dc021080e2de4c16867126d149e9a569 | TypeScript | ehab180hb/tessel2framework | /src/test/handlers/button.handler.test.ts | 2.6875 | 3 | import * as five from 'johnny-five'
import { buttonHandler } from '../../button/button.handler'
import { PIN } from '../../board/board.model'
import { DeviceButton } from '../../button/button.model'
let buttonOnSpy: string[] = []
let buttonRemoveListenerSpy: string[] = []
let createdButtons: DeviceButton[] = []
befor... |
78583db77c2652db2a20703a0717cb984ce56edb | TypeScript | edipoelwes/sonhos-de-ninar-web | /src/rules/schemas/schemasValidation.ts | 2.640625 | 3 | import * as Yup from 'yup'
export const registerForm = Yup.object().shape({
name: Yup.string().required('Nome obrigatório!'),
email: Yup.string()
.required('E-mail obrigatório!')
.email('Digite um e-mail válido!'),
password: Yup.string().min(6, 'No minimo 6 dígitos!'),
social_name: Yup.string().require... |
2e8b47f629c72295e2797bd0225fb46e7ae8184a | TypeScript | EduardoKO/RentxServer | /src/modules/cars/repositories/ISpecificationsRepository.ts | 2.65625 | 3 | import Specification from "../entities/Specification";
export interface ICreateSpecificationDTO {
name:string;
description:string;
}
export interface ISpecificationsRepository {
create({name, description}: ICreateSpecificationDTO): Promise<Specification>;
findByName(name: string): Promise<Specification>;
}
|
bdb5b20d6197d2c3bd90ddf24d3b4dc01e951c85 | TypeScript | CivicDataLab/cheyyali | /frontend/repositories/tasks/sequenceLabeling/apiRelationRepository.ts | 2.53125 | 3 | import ApiService from '@/services/api.service'
import { RelationRepository } from "~/domain/models/tasks/relationRepository"
import { RelationItem } from "~/domain/models/tasks/relation"
export class ApiRelationRepository implements RelationRepository {
constructor(
private readonly request = ApiService
... |
54ade2c5c1d421eaf73d21dc2211fedab2b21bfd | TypeScript | huytq000605/mapAsyncAction | /mapAsyncAction.ts | 3.453125 | 3 | // Idea: Muốn thực hiện hàm map async song song với nhau và có limit
function *createGeneratorFromArray (arr: any[]) {
for(let i = 0; i < arr.length; i++) {
yield [arr[i], i, arr]
}
}
/**
*
* @param arr Array muốn truyền vào
* @param fn Một hàm async muốn thực hiện với mỗi phần tử của mảng
* @param... |
7bda9a9baf38fb58dcd668b21bf97dd4961b6379 | TypeScript | yiyb0603/CoCode_Web | /src/stores/CommunityStore/CommunityStore.ts | 2.53125 | 3 | import { observable, action } from 'mobx';
import { autobind } from 'core-decorators';
import CommunityRepository from './CommunityRepository';
import {
IPostListTypes,
IPostWriteTypes,
IPostCommentTypes,
} from 'interface/PostTypes';
@autobind
class CommunityStore {
@observable pageCount = 0;
@observable postLis... |
71c13b3fa1da49a2b399198a7f9b824d7ba7af0a | TypeScript | flarum/framework | /framework/core/js/src/common/helpers/textContrastClass.ts | 2.546875 | 3 | import isDark from '../utils/isDark';
export default function textContrastClass(hexcolor: string | null | undefined): string {
if (!hexcolor) return 'text-contrast--unchanged';
return isDark(hexcolor) ? 'text-contrast--light' : 'text-contrast--dark';
}
|
54bd3c513694e21482c7a4e9c0c19a177c5b0fef | TypeScript | skumar4120/nwsearch | /src/main/typescript/_string.ts | 2.765625 | 3 | // Module: _string.ts
// Description: String-handling helper functions.
// Also-see:
// Tab-stops: 4
// Author: DR
// Language: js
// Creation Date: 07/18/2018
// Description:
// Revisions:
//
//
// ==========================================================================
// See global.d.ts for... |
ccfbfb52e4805079c925feb1792a6a74771cde46 | TypeScript | buttercubz/chat-realtime-deno | /chat.ts | 2.71875 | 3 | import {
WebSocket,
isWebSocketCloseEvent,
} from "https://deno.land/std/ws/mod.ts";
import { v4 } from "https://deno.land/std/uuid/mod.ts";
interface usersList {
userId: string;
name: string;
groupName: string;
ws: WebSocket;
}
interface IMessage {
userId: string;
name: string;
mess... |
40e9c840fac52dc37a7fb84befa1e847580c3a10 | TypeScript | codehub0x/TypeScript-DeFi | /src/gambling-strategies/archive/buy-low-sell-high2.ts | 2.96875 | 3 | import { BinanceConnector } from "../../binance/binance-connector"
const pair = process.argv[2] // e.g. ETHUSDT or BTCUSDT
const binanceApiKey = process.argv[3] // check your profile on binance.com --> API Management
const binanceApiSecret = process.argv[4] // check your profile on binance.com --> API Management
exp... |
d31b1c06d63551372f4f15d25178a91f2ef56397 | TypeScript | dingfengquek/dingfengquek-pelago-assessment-20200308 | /src/dataSource/wwwReader/index.ts | 2.71875 | 3 | import path from 'path';
import stream from 'stream';
import tar from 'tar';
import axios from 'axios';
import * as rr from '../../result';
const getListURL = `https://cran.r-project.org/src/contrib/PACKAGES`;
const getItemURL = (name: string, version: string) =>
`https://cran.r-project.org/src/contrib/${name}... |
04b85e45a2cebbb346c9c8d674f44ff8a5813d83 | TypeScript | vladimir-tikhonov/string-to-argv | /src/state_machine/states/empty.ts | 2.671875 | 3 | import baseState, { State, StateHandle } from 'src/state_machine/states/state';
const emptyState: State = {
...baseState,
stateHandle: StateHandle.Empty,
onCharacter(character: string) {
return [character, StateHandle.InsideToken];
},
onSingleQuote() {
return [null, StateHandle.Ins... |
b9b156850d2f35ddcfe4a0c2711cc9ddb67017a7 | TypeScript | arpitparmar5739/uemail | /uemail_backend/src/models/User.ts | 2.671875 | 3 | import * as bcrypt from 'bcrypt';
import * as SequelizeStatic from 'sequelize';
import { DataTypes, Sequelize } from 'sequelize';
import { UserAttributes, UserInstance } from './interfaces/UserInterface';
const saltRounds = 10;
export default function (sequelize: Sequelize, dataTypes: DataTypes): SequelizeStatic.Mode... |
f102caa53ad3dc52bb32b7f73f06798a9099ef28 | TypeScript | liuyics15/RPGGame | /src/game/role/ActionStatusDic.ts | 2.640625 | 3 | import {KeyPropertyDic} from "../property/KeyPropertyDic";
import {IKeyPropertyHandle, IKeyPropertyLock} from "../property/Interface";
import {EEntityAction, EEntityStatus} from "../../define/GameDefine";
//行动状态
export interface IActionStatusDic {
//是否允许行为
isAllowed(action:EEntityAction):boolean;
//设置是否允许
... |
88264cd9b337ff283f516bb972966ba8be6fcdc5 | TypeScript | dp28/constraints | /json-constraints/src/constraints/variable.spec.ts | 3 | 3 | import 'mocha';
import { expect } from 'chai';
import {
buildDecisionVariable,
buildConstant,
toVariableReference,
combine,
add,
subtract,
multiply,
divide
} from './variable';
describe('buildConstant', () => {
const constant = buildConstant(1);
it('should have an id', () => {
expect(constant... |
a90f8318671e608a84a258ffc5f82f41d4083971 | TypeScript | Mmalikov1337/led-vled-frontend | /src/helpers/localStorageHelper.ts | 2.8125 | 3 | import DeliveryDataDTO from "@src/types/DeliveryDataDTO";
import OrderDataDTO from "@src/types/OrderDataDTO";
import PaymentDataDTO from "@src/types/PaymentDataDTO";
import React from "react";
import { productStorageName, productsQuantity, tempItems, tempDeliveryData } from "./../config";
class LocalStorageHepler {
s... |
d6adcded9b7991bfedb5cb2f4a3f68d77ffb5467 | TypeScript | frank-26/ts | /src/tips.ts | 3.609375 | 4 | // https://medium.com/@tomsu/typescript-tips-tricks-c8fdef998d50
// # 使用字面量类型
// 泛型 Id 类型
type Id<T extends string> = {
type: T;
value: string;
};
// 特殊的 Id 类型
type FooId = Id<'foo'>;
type BarId = Id<'bar'>;
// 可选:构造函数
const createFoo = (value: string): FooId => ({ type: 'foo', value });
const createBar = (value:... |
c68a7f8aaaa8e3f213f7242224836fea03471a36 | TypeScript | sliker/angular2starter | /src/app/counter/counter.reducer.ts | 2.9375 | 3 | import { Actions } from './counter.actions';
import {
counterIncrement,
counterDecrement,
counterReset
} from './counter.action-types';
import { CounterState } from './counter.model';
export const initialState: CounterState = {
count: 0
};
export const counterReducer = (state = initialState, action: A... |
51122c0ab72e84532b8ebe01d2fc85e692416ccc | TypeScript | akky-xxxx/boilerplate-nunjucks-scss-ts | /src/ts/modules/validationMain.ts | 2.6875 | 3 | import { combine } from 'favalid'
import {
checkBlank,
checkNumber,
checkMax,
checkMin,
checkEqual,
checkRadio,
checkCheckbox,
checkSelect,
} from './validationRules'
export default (targetElement: HTMLInputElement) => {
const isRequired = targetElement.hasAttribute('required')
if (!isRequired && !... |
8c405afa675456d32050c759dd6cf68e97acbeda | TypeScript | oozcitak/util | /test/CompareCache.test.ts | 3.015625 | 3 | import * as util from "../src"
describe('NodeCompareCache', () => {
test('check()', () => {
for (let i = 0; i < 100; i++) {
const cache = new util.CompareCache<string>()
const str1 = "a"
const str2 = "b"
const val1 = cache.check(str1, str2)
const val2 = cache.check(str2, str1)
... |
4766b8912146694250d077a36c08e0c9ec7b004f | TypeScript | daryl-cecile/Tasty-Treats-Inquiry-Form | /src/public/scripts/Modal.ts | 2.890625 | 3 |
interface IMessageOptions {
message:string;
timeout?:number;
buttons:{
text:string;
type?:"primary"|"negative"|"default";
callback?:()=>{};
}[]
}
class Modal extends HTMLElement{
public open(options:IMessageOptions){
this.innerHTML = [
`<div class="moda... |
ebf41ef5d3ec4bf65c3163c3506dbe896eec01dd | TypeScript | Ulisseruiz/node-auth | /api/src/validation.ts | 2.65625 | 3 | import { celebrate, SchemaOptions, Modes, Segments, Joi } from "celebrate";
import { PWD_RESET_TOKEN_BYTES } from "./config";
export const validate = (schema: SchemaOptions) =>
celebrate(
schema,
{
abortEarly: false, // validate all fields in the segment
},
{
mode: Modes.FULL, // validate... |
d830404bca9e58a5d2d0ae3ac4e64c76d218cecf | TypeScript | shujathkhan/fluentui | /packages/react-checkbox/src/components/Checkbox/Checkbox.types.ts | 2.953125 | 3 | import * as React from 'react';
import { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
import { LabelProps } from '@fluentui/react-label';
/**
* TODO:
* - Remove as from Omit. Currently it's needed since checkbox Commons shouldn't have as.
* - Instead of exte... |
0ae6750a3d3101c471ca6652cb704adef06547f5 | TypeScript | redaktor/widgets | /src/common/activityPub.ts | 2.765625 | 3 | function apObj(prev: any, cur: any) {
prev[cur.name] = {
...cur,
id: `https://www.w3.org/ns/activitystreams#${cur.name}`,
url: `https://www.w3.org/TR/activitystreams-vocabulary/#dfn-${cur.name.toLowerCase()}`
};
return prev
}
const actors = [
{
name: 'Application',
summary: `Describes a software applicati... |
b0389066b369d59ed086e0a943d5eff96f5e21e9 | TypeScript | DanielMSchmidt/cdktf-local-docker | /src/dockerImage.ts | 2.5625 | 3 |
import { Construct, } from "constructs";
import { Resource, TerraformResource } from 'cdktf';
import { CustomDataSource } from './custom-data-source'
export interface IImage {
digest: string;
}
export interface DockerImageConfig {
name: string,
dependsOn?: TerraformResource[];
}
interface CustomDockerIma... |
a266df43bcf3a4958b10913e01fbc6f0823456a7 | TypeScript | dconyers/TypeScriptPlayground | /other.ts | 2.984375 | 3 | function dougTest() {
return "Doug is Cool";
}
// This works, but throws errors in Typescript
// dougTest = function() {
// return "Doug is Cool";
// };
|
6de10376127f944abcf34b6bb246214e976d6574 | TypeScript | mhreza76/one_month_skill_test | /ES2015/methods.ts | 3.71875 | 4 | class Person{
constructor(name){
this.name = name;
console.log(name + " Constructor");
}
static staticMethod(){
console.log("Static Method Called")
}
greeetPerson(){
console.log("Hello " + this.name);
}
}
let p1 = new Person("Reza");
Person.staticMethod();
p1.g... |
18196120880f65b7de15a01ded629a79cc320e92 | TypeScript | Pokonelakokode/VodafonePhoneBookTest | /src/utils.test.ts | 3.078125 | 3 | import {getHash, isObject, loadFromStorage, saveToStorage, setHash, validateEmail} from "./utils";
import JSONusers from './users.json';
describe("setHash",() => {
it('should return an empty string for an empty object', function () {
setHash();
expect(window.location.hash).toBe("")
});
it('... |
0eaf4510ab1864b2676c52e01361e2f2a5d17d78 | TypeScript | GabrielPinedo/PrimeropasosTS | /src/ejercicios/06-desestructurandoFunciones.ts | 3.109375 | 3 | export interface Producto {
desc: string;
precio: number;
}
const telefono : Producto = {
desc: 'Nokia V3',
precio: 2000000,
}
const tableta : Producto = {
desc: 'samsung tap 3',
precio: 4000000
}
export function calculaISV(productos: Producto[]) :[number, number]{
let ... |
ba616076c7804a4c4231e7d0f9e2d1511a99b55f | TypeScript | jobayersarkar/ivr-tester | /packages/cli/src/options/config/json/validateJsonConfig.spec.ts | 2.53125 | 3 | import { JsonConfig } from "./JsonConfig";
import { validateConfig } from "./validateJsonConfig";
const validConfig: JsonConfig = {
transcriber: {
name: "test",
options: {},
},
recording: {
audio: {
filename: "/test-filename",
outputPath: "/test/path",
},
transcript: {
filen... |
bd91bdfddc8ddeed8a04ceae4223b60b69ee9330 | TypeScript | teraSurfer/software-temp | /packages/rent-app-server/src/entities/roles.ts | 2.546875 | 3 | import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { Field, ID, ObjectType, } from 'type-graphql';
@ObjectType()
@Entity('roles')
export class Role extends BaseEntity {
@Field(() => ID)
@PrimaryGeneratedColumn('increment')
id: number;
@Field()
@Column('varchar',... |
d5a92f357caeafd85b55c2b568ca7e5e836d3fa7 | TypeScript | animesh-code/my_town_app_backend | /src/auth/domain/User.ts | 2.515625 | 3 | export default class User {
constructor(
public readonly id: string,
public readonly place_id: string,
public readonly number: string,
public readonly name: string,
public readonly gender?: string,
public readonly age?: Date,
public readonly donor?: boolean,
public readonly bloodGroup?... |
8d0de81e5dda67cc6959dfe9ef523b6daa698ea5 | TypeScript | Anmol-dev/instantsearch.js | /src/lib/routers/history.ts | 3.03125 | 3 | import qs from 'qs';
import { Router, RouteState } from '../../types';
type CreateURL = ({
qsModule,
routeState,
location,
}: {
qsModule: typeof qs;
routeState: RouteState;
location: Location;
}) => string;
type ParseURL = ({
qsModule,
location,
}: {
qsModule: typeof qs;
location: Location;
}) => ... |
6d5232978c258d40040d1b9b8ecb3a64b9bfb65b | TypeScript | 3askaal/3oilerplate | /src/core/style/utils/color.ts | 2.640625 | 3 | import chroma from 'chroma-js'
export function darken (color: string, amount: number = 0.2) {
return chroma(color).darken(amount).hex()
}
export function brighten (color: string, amount: number = 0.2) {
return chroma(color).brighten(amount).hex()
}
export function rgba (color: string, amount: number = 0.2) {
r... |
85d449a6d5c74955228dfda27b398dfa5c24aeb8 | TypeScript | olehcambel/telegram-bot-tours | /src/modules/winston-telegram.ts | 2.59375 | 3 | import Telegraf from 'telegraf';
import Transport /* , { TransportStreamOptions } */ from 'winston-transport';
import config from '../config';
const pre = '```';
const logLevel = (level: string): string => {
switch (level) {
case '[31merror[39m':
return 'ERROR';
case '[33mwarn[39m':
return '... |
63db01673655a7925fd1d59f4169cc56863c935a | TypeScript | Nick-Mazuk/traveling-salesman | /_javascript/Road.ts | 3 | 3 | import { City } from './City'
export class Road {
cityA: City
cityB: City
#color = '#757575'
#realityColor = '#FCCE00'
static width = 3
constructor(cityA: City, cityB: City) {
this.cityA = cityA
this.cityB = cityB
}
draw(ctx: CanvasRenderingContext2D, cityGrid: boolean... |
849ff405e432289b4f39f86ad15b9947aedb01f4 | TypeScript | one-fwk/owe-cli | /src/util/filter-async.ts | 2.9375 | 3 | import { pipe, from, MonoTypeOperatorFunction } from 'rxjs';
import { map, filter, concatMap } from 'rxjs/operators';
export function filterAsync<T>(predicate: (value: T, index: number) => Promise<boolean>): MonoTypeOperatorFunction<T> {
let count = 0;
return pipe(
// Convert the predicate Promise<boolean> to ... |
55688d3e5991718a708bb6203d3ee317c8c28765 | TypeScript | mariyanuzunov/nest-api-blindoor | /src/auth/auth.service.ts | 2.59375 | 3 | import {
Injectable,
BadRequestException,
UnauthorizedException,
} from '@nestjs/common';
import { RegisterUserDto } from './dto/register-user.dto';
import * as bcrypt from 'bcrypt';
import { UserService } from 'src/user/user.service';
import { LoginCredentialsDto } from './dto/login-credentials.dto';
import { Jw... |
62e01e6d375c32dbdb593f873f9473bc9f4d21bc | TypeScript | pitaj/nodebb-plugin-calendar | /src/lib/translatorModule.ts | 2.84375 | 3 | import moment, { RelativeTimeKey } from 'moment';
import { NodebbTranslator } from 'translator';
const justDate = 'dddd, LL';
const justTime = 'LT';
const dateAndTime = 'LLLL';
const formatDates = (
s: number,
e: number,
allday: boolean,
lang: string,
utc: boolean
): string => {
const mom = utc ? moment.u... |
982e05ac3c200c267649ae57267e6579a642c95f | TypeScript | elrancid/easylib-log | /lib/loggable.component.d.ts | 2.71875 | 3 | import { Loggable } from './loggable';
/**
* Extend `Loggable` in components and set boolean `logs` property
* to enable logs. Use `this.log()` and the other methods to print to console
* if `logs` is `true`.
*/
export declare class LoggableComponent extends Loggable {
logs: boolean;
constructor();
}
|
8b2430332496ac882631398d23dd8ec0a7079fd3 | TypeScript | RafaelSalguero/linqjs | /src/nullsafe.ts | 3.140625 | 3 | import { pipe } from "./pipe";
export type NonNullable<T> = T extends null | undefined ? never : T;
export type ExtractNullType<T> =
T extends null | undefined ? T : never;
type NSF<I, O> = (x: NonNullable<I>) => O;
export function nullsafe<T1, T2, T3, T4, T5, T6>(value: T1, m1: NSF<T1, T2>, m2: NSF<T2, T3>, m3:... |
9b69e08a9c9a9e89d9b2da1c1cfe177b1d0d489a | TypeScript | Joshimcse/bongo | /tests/1-anagram.test.ts | 3.59375 | 4 | import { assert } from "chai";
import isAnagram from "../anagram/anagram";
/**
* @test :: Unit testing for Q.1 - Is Anagram or Not
* @passingData ::
*
* expected case - 1: should return true when two string is anagram - ['table', 'bleat']
* expected case - 2: should return false when two string are not anagram - ... |
c7a63dc561e34e28ce37c0af0e29d95f7598359e | TypeScript | iamgilvan/ImageRotation | /src/test/index.test.ts | 3.09375 | 3 | import { PixelArrayRotator } from './../index';
// BB
// WW
// WW
const uArr = new Uint8Array([
0,
0,
0,
255,
0,
0,
0,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
255,
]);
// WWB
// WWB
const uArr2 = new Uint8Array([
255,
255,
2... |
aea170660ee4890bd18d59896abd6a8569a62b54 | TypeScript | JasonWeinzierl/simple-chatroom | /src/client.ts | 2.953125 | 3 | /**
* TCP client uses Node.js net module
* to chat with TCP server over command line
*/
import { Socket } from 'net';
import { createInterface } from 'readline';
import ora from 'ora';
export default function startClient() {
// spinner for console notifications
const spinner = ora().start('Connecting...');
... |
379e9a571f4316e7b146166a9c7fdbd337bd71f1 | TypeScript | pokemondev/smogon-stats-discord | /src/commands/setsCommand.ts | 2.78125 | 3 | import Discord = require('discord.js');
import { CommandBase } from "./command";
import { AppDataSource } from "../appDataSource";
import { ColorService } from '../pokemon/colorService';
import { FormatHelper } from '../smogon/formatHelper';
import { ImageService } from '../pokemon/imageService';
export class SetsComm... |
58254811075363157772deb4013000d20ca4c31f | TypeScript | lichenchen-lcc/lcc_resource | /example-3d-master/simple-fps/assets/TS/levelscol1.ts | 2.65625 | 3 | import { _decorator, Component, Node } from "cc";
const { ccclass, property } = _decorator;
import { Con } from './Constants';
@ccclass("levelscol1")
export class levelscol1 extends Component {
/* class member could be defined like this */
// dummy = '';
/* use `property` decorator if your want the member ... |
8a599bc03dce9ec45489037f73ed302bb8402fdc | TypeScript | kemila/Kemila | /06知识积累/react/redux原子化实现/redux-实现/define.ts | 2.71875 | 3 | import { KV } from '../../lib';
export type Class<T> = {
new(...args: any[]): T,
[k: string]: any;
};
export type ActionKV = {
type: string;
module?: string;
payload?: any
};
export type PrepareFn = (payload: KV, moduleState: KV) => Promise<KV>;
export type ReducerFn = (action: ActionKV, moduleSta... |
93cd940c20f484fb35e2a5e74c10615eda58b485 | TypeScript | WesleyCristiano/makelist-backend | /src/modules/lists/infra/typeorm/repository/ListRepository.ts | 2.671875 | 3 | import IListRepository from "@modules/lists/repositories/IListRepository";
import ICreateListDTO from "@modules/lists/dtos/ICreateListDTO";
import { Repository, getRepository } from "typeorm";
import List from "../entities/List";
import IFindListDTO from "@modules/lists/dtos/IFindListDTO";
class ListRepository impleme... |
553bcfe5be431429938bff99083ab1a4baeb8062 | TypeScript | darkman2040/HonestProject | /src/app/screens/time-sheet/timeEntry.ts | 2.5625 | 3 | export class TimeEntry {
constructor(
public name: string,
public timeInHours: number
) {}
} |
69129d0375742ca2f184a56a808a25e84db5d7ce | TypeScript | immybo/Recipes | /mobile/src/model/Category.ts | 2.890625 | 3 | export interface Category {
id: number,
name: string
}
export interface CategoryState {
allCategories: Category[]
}
export function getBlankCategory(): Category {
return {
id: getUniqueCategoryId(),
name: "",
};
}
var nextUniqueId: number = 0;
export function ge... |
c8a0fcbf362993901f524662d596a18636482b6c | TypeScript | hien-cao/Game-online-shop | /game/src/interface/End.ts | 2.640625 | 3 | import { Button } from "../controls/Button";
import Game from "../Game";
import Overlay, { OverlayUpdateState } from "./Overlay";
export interface EndArgs {
game: Game;
}
export default class End extends Overlay {
public prevState: {
buttons: Button[]
};
constructor({ game, ...args }: EndArgs) {
supe... |
958635b27fd39b7574854b5aa74e5b202251454d | TypeScript | green-fox-academy/juditvarro | /week_4/day_01/student.ts | 3.109375 | 3 | import { Person } from "./person";
'use strict'
export class Student extends Person {
private previousOrganization: string;
private skippedDays: number;
constructor(name: string = 'Jane Doe', age: number = 30,
gender: string = 'female', previousOrganization: string = 'School of Life') {
super(name, age,... |
cb7cce8538feae94b04ff98915a2d958b73752c7 | TypeScript | moonpyk/gitfetcher | /lib/util.ts | 2.59375 | 3 | /*
* gitfetcher
* https://github.com/moonpyk/gitfetcher
*
* Copyright (c) 2014 Clément Bourgeois
* Licensed under the MIT license.
*/
///<reference path="../typings/tsd.d.ts"/>
"use strict";
import path = require('path');
import _ = require('lodash');
export function replaceFileExtension(val:string, newExt:st... |
83d18b86a6d045ee74a134c1a86bd115e818199f | TypeScript | exxcellent/swt2-bsa-frontend | /bogenliga/src/app/modules/shared/pipes/truncation.pipe.ts | 2.65625 | 3 | import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'truncation'
})
export class TruncationPipe implements PipeTransform {
transform(input: string, truncationLength: number): string {
if (input.length > truncationLength) {
return input.substring(0, truncationLength) + '...';
} else {
... |
18a6d5f03adaa901255b2e9bb56a9899945fe89e | TypeScript | 1ncounter/util-libs | /packages/dsa/linked-list/has-cycle.ts | 3.15625 | 3 | import { INode } from './linked-list.interface';
export function hasCycle(head: INode<number>) {
const set = new Set<INode<number>>();
while (head) {
if (set.has(head)) {
return true;
} else {
set.add(head);
}
head = head.next;
}
return false;
}
export function hasCycle2(head: I... |
8bc0e47ee7c30b9a59edc30ed0f6df22d4dca36b | TypeScript | leon740727/types | /build/src/index.d.ts | 2.84375 | 3 | import { Optional } from './optional';
export { Optional } from './optional';
import { Result } from './result';
export { Result } from './result';
export declare type Primitive = string | number | boolean | null;
export declare type Json = Primitive | Primitive[] | {
[field: string]: Json;
} | {
[field: string... |
41b13b037d2ea93b4a4f2b838fc6c513022abd0e | TypeScript | JonathanWilbur/preql | /source/APIObjectKinds/UniqueIndex/spec.ts | 2.8125 | 3 | /**
* The `spec` section of a PreQL `UniqueIndex`.
*
* @see /source/APIObjectKinds/UniqueIndex/kind.
*/
export default
interface Spec {
/**
* The DBMS-friendly name of this index.
*/
name: string;
/**
* The DBMS-friendly name of the `Struct` to which this index applies.
... |
24a2f712509e5b3c61c516857354b81266f248cd | TypeScript | 981377660LMT/algorithm-study | /17_模式匹配/最小表示法/最小表示法.ts | 3.828125 | 4 | /* eslint-disable @typescript-eslint/no-non-null-assertion */
// 字符串最小表示法 O(n)算法
// 有一个首位相连的字符串,我们要寻找一个位置,从这个位置向后形成一个新字符串,我们需要使这个字符串字典序最小。
// 我们这里要i = 0,j = 1,k = 0,表示从i开始k长度和从j开始k长度的字符串相同(i,j表示当前判断的位置)
// 当我们str[i] == str[j]时,根据上面k的定义,我们的需要进行k+1操作
// !当str[i] > str[j]时,我们发现i位置比j位置上字典序要大,那么不能使用i作为开头了,我们要将i向后移动,移... |
c7abc918fd76a4bb22f80ff0b31ee0a83f1099f8 | TypeScript | onomemineadamu/smart-storage | /src/storage/memory.ts | 3.1875 | 3 | /* eslint-disable no-unused-vars */
interface ISmartStorageMemory {
smartStorageMemory: {
[x: string]: any;
};
setItem: Function;
getItem: Function;
removeItem: Function;
clearItems: Function;
}
const SmartStorageMemory: InstanceType<any> = function (this: ISmartStorageMemory) {
if (!new.target) {
... |
84722ceb3995108d54e0259fc0bbf9ff5921ab66 | TypeScript | cgolobic/ng-nest-starter | /shared/utilities/logger.ts | 2.546875 | 3 | export function logMessage(label: string, message: string) {
console.log(`[${label}] ${message}`);
} |
3452bfab273e1995b5ea7d5ffe003c82edb7414d | TypeScript | BartlomiejDarocha/AngularModelsTrain | /angularMaterials/src/app/components/angular/validation/validation-form-group/validation-form-group.component.ts | 2.546875 | 3 | import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators, ValidatorFn, AbstractControl } from '@angular/forms';
import { GetterSetterService } from 'src/app/providers/getter-setter.service';
const AGEPATTERN = /^\d+$/;
@Component({
selector: 'app-validation-form-group',
templ... |
957a5761572d80575bb1c88a58af18e18a4abd29 | TypeScript | checkupjs/checkup | /packages/core/src/utils/exec.ts | 3.21875 | 3 | import util from 'util';
import { exec as cpExec } from 'child_process';
const execAsPromise = util.promisify(cpExec);
/**
* @param {string} cmd - The command to run
* @param {any} options - Options passed to the command
* @param {string|number} defaultValue - Default value returned if the command returns no value
... |
ca14245814c40c23a6b8aabc28d13b74151d8547 | TypeScript | ksanjaykumar1/fabric-gateway | /scenario/node/src/fabricski.ts | 2.546875 | 3 | import * as crypto from 'crypto';
import * as jsrsa from 'jsrsasign';
export function getSKIFromCertificate(pem: string): Buffer {
const key = jsrsa.KEYUTIL.getKey(pem);
const uncompressedPoint = getUncompressedPointOnCurve(key as jsrsa.KJUR.crypto.ECDSA);
const hashBuffer = crypto.createHash('sha256');
... |
5b6720678fe13b683cd7b59241f635f07bc97832 | TypeScript | hoddy3190/github_project_daily_report | /src/formatter.ts | 2.796875 | 3 | import * as Octokit from '@octokit/rest'
export default class Formatter {
private data: Octokit.IssuesListForRepoResponseItem[]
private repoName: string
public constructor(
repo: string,
data: Octokit.IssuesListForRepoResponseItem[]
) {
this.data = data
this.repoName = ... |
b041b4c79588d4f7d717533b2e3d09cd19a6b5e1 | TypeScript | eulincon/fsfc2-desafio2 | /nest-api/src/app.service.ts | 2.671875 | 3 | import { Injectable } from '@nestjs/common';
export type Route = {
title: String,
startPosition: {"lat": String, "long": String},
endPosition: {"lat": String, "long": String}
}
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!';
}
getRoutes(): Route[] {
let routes: ... |
a8037498b5a95e83150e13a444bed92a48d070fd | TypeScript | srsantosdev/gostack-database-relations | /src/modules/products/repositories/fakes/FakeProductsRepository.ts | 2.84375 | 3 | import { uuid } from 'uuidv4';
import Product from '@modules/products/infra/typeorm/entities/Product';
import ICreateProductDTO from '@modules/products/dtos/ICreateProductDTO';
import IUpdateProductsQuantityDTO from '@modules/products/dtos/IUpdateProductsQuantityDTO';
import IProductsRepository from '../IProductsRepos... |
3e53ffb865e3f91daf7181611fdf70709f90de4f | TypeScript | kyawswarthwin/capacitor-app-shortcuts | /src/definitions.ts | 2.671875 | 3 | //@ts-ignore
declare module "@capacitor/core" {
interface PluginRegistry {
AppShortcuts: IAppShortcutsPlugin;
}
}
export interface IAppShortcutsPlugin {
/**
* Resolves promise, if dynamic shortcuts are supported
*/
supportsDynamic(): Promise<void>;
/**
* Resolves promise, i... |
3e6a92d1db5fdb455a94fe1787c060109d859885 | TypeScript | GnafGnaf/ngEnigma | /src/enigma/cyphers/simpleSubstitution.ts | 3.140625 | 3 | import {InvalidArgumentError} from "../../app/shared/errors/invalidArgumentError";
import {Cypher} from "./cypher";
import {ALPHABET} from "../constants";
export class SimpleSubstitution implements Cypher {
private readonly substitutionAlphabet: string;
public constructor(substitutionAlphabet: string) {
this.... |
b8c123e6df33261d7b3ff4b71f7e012adb3dd174 | TypeScript | sargis56/sargis56.github.io | /Portfolio_test/TypeScript/BloodBoil2D/Scripts/managers/collisions.ts | 2.921875 | 3 | module managers {
export class Collision {
public static Check(obj1: objects.GameObjectAtlas, obj2: objects.GameObjectAtlas):boolean {
let boundsWall: number = 50;
if (((obj1.x > (obj2.x - boundsWall) ) && (obj1.x < (obj2.x + boundsWall) ))
&& ((obj1.y > (obj2.y - boundsWa... |
6bbb8845d07218496f45a88026137aebafe7b6cd | TypeScript | MasashiFukuzawa/design-patterns-learned-in-typescript | /chap21-proxy/src/main.ts | 2.84375 | 3 | import { PrinterProxy } from "./printer/printerProxy";
class Main {
main(): void {
const p = new PrinterProxy('Alice');
console.log(`Current name is ${p.getPrinterName()}.`)
p.setPrinterName('Bob');
console.log(`Current name is ${p.getPrinterName()}.`)
p.print('Hello, world.');
}
}
const m = n... |
130351dbf4e29438a828796577a2405bb6ca2ebc | TypeScript | chubozeko/CHAP | /src/app/home/resizer.ts | 2.609375 | 3 | export class Resizer {
constructor() {}
public resizeSymbols(symbol) {
if (
symbol.parentElement.parentElement.classList.contains("if_div") ||
symbol.parentElement.classList.contains("if_div")
) {
this.resizeIfCaseBlocks(symbol);
} else if (
symbol.parentElement.parentElement.c... |
5802cf2faf53eb6773ff3a0c423147dd3099fa11 | TypeScript | emilia98/SoftUni-JSWeb-OLD | /Angular Fundamentals/03. Observables & Routing/Demo/Dependency Injection/with_DI.ts | 3.203125 | 3 | /*
WITH DEPENDENCY INJECTION
In this case, we do not need to use
an instance of Engine class. Whatever
changes we made of it, none of the
classes with depend on it will need
to be changed. All of these classes
will have an access to the updates
made to the class Engine.
*/
class Engine {
co... |
27504669dac98fb8660a026b3ee22cf525fff360 | TypeScript | AndreySotnikov/angular2-systemjs-rollup | /app/app.component.ts | 2.59375 | 3 | import {Component, OnInit} from '@angular/core';
import {Subject} from "rxjs";
@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>`,
})
export class AppComponent implements OnInit {
private subject : Subject<string> = new Subject();
public name: string = undefined;
ngOnInit(): void {
th... |
b8bd51dd053d518db066eb57d05bcf87c5436836 | TypeScript | Ckearns1210/star_wars_angular2 | /src/app/home/api_service/api.service.ts | 2.6875 | 3 | import {Component, Injectable, OnInit, ElementRef, EventEmitter, Inject} from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs';
import { MovieResult } from '../../models/movie-result'
import 'rxjs/Rx'
@Injectable()
export class ApiService {
constructor(public http: ... |
001c382574e0598179ede211b8ff345e4b906587 | TypeScript | khle/monadness-js | /lib/maybe.d.ts | 3 | 3 | import { Monad, FunctorFunc, ApplicativeFunc } from "./interfaces";
import { Either } from "./either";
export declare abstract class Maybe<T> implements Monad<T> {
abstract map<U>(f: (a: T) => U): Maybe<U>;
abstract fmap<U>(f: FunctorFunc<T, U>): Maybe<U>;
abstract applies<U, V>(f: ApplicativeFunc<T, U, V>)... |
d5a592cf3245efbc2059d821bcd35a0919084d6b | TypeScript | cloudhubs/prophet-web | /src/state/initState.ts | 2.671875 | 3 | import {State} from "./state";
import {defaultState} from "./defaultState";
export const LOCAL_STORAGE_KEY = "prophetkey2020";
export const parseState = (str: string | null): State | null => {
try {
const state = JSON.parse(str || "");
return state as State;
} catch (e) {
return null;
... |
e62ca60dddbc04e78c48378737b6d4f05695365c | TypeScript | zpapoo/ncha-frontend | /__tests__/features/playerSaga.test.ts | 2.71875 | 3 | import { FetchStatusCode } from 'api'
import { playerToggleSaga, playerUpdateTimeSaga } from 'features/playerSaga'
import { PLAYER_PREFIX, playerActions, playerSelectors } from 'features/playerSlice'
import { delay, put, select } from 'redux-saga/effects'
const initialState = {
movie: {
id: 0,
title: '',
... |
9440be8720f31ee4c1251bb688c7cbd31a19899c | TypeScript | lucascaro/ts-monads | /src/monads/Result.ts | 3.765625 | 4 | import { none, Option, some } from './Option';
export type Result<T, E> = Ok<T, E> | Err<T, E>;
export enum ResultKind {
ok = 'ok',
err = 'err',
}
export interface Ok<T, E> extends IResult<T, E> {
kind: ResultKind.ok;
isOk: true;
isErr: false;
}
export interface Err<T, E> extends IResult<T, E> {
kind: Res... |
7e1e3408678842b037fd1daf067c1f5f0f51ad47 | TypeScript | la-guirlande/spotifind-frontend | /src/hooks/authentication-hook.ts | 2.515625 | 3 | import randomString from 'crypto-random-string';
import _ from 'lodash';
import { useEffect } from 'react';
import { Config } from '../util/configuration';
import crypto from '../util/crypto';
import { LocalStorageKey } from '../util/local-storage';
import { AccessTokenResponse, SpotifyTokenResponse } from '../util/res... |
3a1bc9ac62f60735f0bf92b979f7a7efdf0aaf42 | TypeScript | Tcheikovski/express-simple-decorator | /src/__tests__/paramsResolve/ParamResolve.specs.ts | 2.625 | 3 | import * as assert from "assert";
import {ParamResolve} from "../../paramsResolve/ParamResolve";
import {Request} from "express";
describe("Test resolve param", () => {
it('Haven\'t value', async () => {
let resolve = new ParamResolve();
let request = {
params: {}
};
let... |
41defdbb37642cc561ceca1cfccbb899cbf8b9b3 | TypeScript | Spand0x/DnD-Adventure-Web-app | /src/app/views/dnd-adventure/character/character-stats/character-stats.component.ts | 2.640625 | 3 | import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {CharacterStats} from '../../../../shared/models/character-stats.model';
@Component({
selector: 'app-character-stats',
templateUrl: './character-stats.component.html',
styleUrls: ['./character-stats.component.scss']
})
export cl... |
5fe7eac10ccb178917c0522aa9665990edc4198a | TypeScript | mathiamry/jhipster-sample-applicationbannk | /src/main/webapp/app/entities/turnover/turnover.model.ts | 2.8125 | 3 | import { ISme } from 'app/entities/sme/sme.model';
export interface ITurnover {
id?: number;
min?: number | null;
max?: number | null;
description?: string | null;
smes?: ISme[] | null;
}
export class Turnover implements ITurnover {
constructor(
public id?: number,
public min?: number | null,
... |
cfd5d9b96c693e0c0a2f42d9b5c642fabd17781c | TypeScript | imralav/TheOrderOfWorms | /src/sorting-algorithms/bubble-sort.ts | 3.15625 | 3 | import { SortingAlgorithm, swap } from "./sorting-algorithms";
import { withSortingEvents } from "./sorting-algorithms";
class BubbleSort implements SortingAlgorithm {
private data: number[];
constructor(data: number[]) {
this.data = [...data];
}
sort() {
const eventsStream = withSortingEvents((inspec... |
02babbc91041117e91ee696e71486dc2f3f446a9 | TypeScript | israel1947/App-paises | /src/app/paises/pages/ver-pais/ver-pais.component.ts | 2.625 | 3 | import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { tap } from 'rxjs/operators';
import { PaisService } from '../../services/pais.service';
import { Country, Language } from '../../interfaces/paises.interface';
@Component({
selector: 'app... |
78a6292a5944d20d5a33012047beec7b8d615e2e | TypeScript | ThoaDuong/beblog-x | /src/entities/topic.entity.ts | 2.546875 | 3 | import { TopicDTO } from './../blog/dtos/blog.api.dto';
import { Column, CreateDateColumn, Entity, ObjectID, ObjectIdColumn } from "typeorm";
@Entity()
export class TopicEntity{
@ObjectIdColumn()
id: ObjectID;
@Column()
name: string;
@CreateDateColumn({ type: 'date' })
created_at: Date
... |