repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
syrflover/iterator-helper | deno/methods/inspect.ts | <filename>deno/methods/inspect.ts
import type { ForEachFn } from "../types/functions/mod.ts";
import { _curry } from "../lib/utils/mod.ts";
async function* _inspect_impl_fn<T>(
fn: ForEachFn<T>,
iter: AsyncIterable<T>,
): AsyncIterable<T> {
for await (const elem of iter) {
await fn(elem);
yield elem;
... |
syrflover/iterator-helper | src/types/guards/isArrayLike_test.ts | <filename>src/types/guards/isArrayLike_test.ts
import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { isArrayLike } from './mod.ts';
Deno.test('isArrayLike() array', () => {
const actual = isArrayLike([1, 2, 3]);
const expected = true;
assertEquals(actual, expected);
});
Deno.... |
syrflover/iterator-helper | deno/lib/iterable/next.ts | import { isIterable } from '../../types/guards/isIterable.ts';
export type NextReturn<T> = {
done?: boolean;
value: T;
};
export function next_async<T>(iter: AsyncIterable<T>): Promise<NextReturn<T>> {
const it = iter[Symbol.asyncIterator]();
return it.next();
}
export function next_sync<T>(iter: Ite... |
syrflover/iterator-helper | src/methods/cycle_test.ts | <gh_stars>1-10
import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { iterator } from '../mod.ts';
Deno.test('count() [1,2,3,4,5,6,7,8]', async () => {
const a = iterator([1, 2, 3, 4, 5, 6, 7, 8]);
const actual: number[] = [];
const expected = [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, ... |
syrflover/iterator-helper | src/types/flatten.ts | import type { EP } from './promise.ts';
export type Flatten<T> = T extends Iterable<infer E> | AsyncIterable<infer E> ? EP<E> : T;
|
syrflover/iterator-helper | src/types/guards/isAsyncIterable_test.ts | import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { isAsyncIterable } from './mod.ts';
function* iterable() {
yield 1;
yield 2;
yield 3;
yield 4;
}
async function* asyncIterable() {
yield 1;
yield 2;
yield 3;
yield 4;
}
Deno.test('isAsyncIterable() Array... |
syrflover/iterator-helper | deno/lib/iterable/initLast.ts | import { pair, Pair } from '../../types/pair.ts';
import { fold } from '../../methods/fold.ts';
import { append } from './append.ts';
import { next_async } from './next.ts';
import { sequence } from './toAsyncIterable.ts';
export async function initLast<T>(iter: AsyncIterable<T>): Promise<Pair<AsyncIterable<T>, T | ... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/form-inputs/z-form-input-base.ts | import { AsyncValidatorFn, ValidatorFn, FormControl } from '@angular/forms';
import { Subject } from 'rxjs';
export class ZFormInputBase<X> {
value: X;
key: string;
label: string;
hint?: string;
required: boolean;
order: number;
controlType: string;
disabled: boolean;
validators: ValidatorFn[];
as... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/z-modal.component.ts | import { Component, OnInit, Output, EventEmitter, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
selector: 'z-modal',
templateUrl: './z-modal.component.html',
styleUrls: ['./z-modal.component.scss']
})
export class ZModalComponent implements ... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/providers/index.ts | <reponame>LucasZaia/zmaterial-app
export * from './z-form-provider';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/index.ts | <filename>projects/zmaterial/src/lib/z-menu/index.ts
import { from } from 'rxjs';
export * from './z-menu.module';
export * from './z-menu-material';
export * from './z-menu-bootstrap';
export * from './interfaces';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/public-api.ts | // ! z-modal
export * from './lib/z-modal/index';
// ! z-menu
export * from './lib/z-menu/index';
// ! z-form
export * from './lib/z-form/index';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/form-inputs/z-form-input-text.ts | <reponame>LucasZaia/zmaterial-app<filename>projects/zmaterial/src/lib/z-form/form-inputs/z-form-input-text.ts
import { ZFormInputBase, ZInput } from './z-form-input-base';
export class ZFormInputText extends ZFormInputBase<string> {
public controlType = 'inputText';
public type: string;
public maxlength?: number... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/providers/z-form-provider.ts | <reponame>LucasZaia/zmaterial-app<gh_stars>1-10
import { Observable } from 'rxjs';
import { EventEmitter } from '@angular/core';
import { ZFormInputBase } from '../form-inputs';
export abstract class ZFormProvider {
/**
* Event Reset Form
*/
public didResetForm = new EventEmitter();
/**
* Event Set Va... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/z-menu-bootstrap/index.ts | export * from './z-menu-bootstrap.component';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/validators/index.ts | export * from './z-pattern-validator';
export * from './z-custom-validator';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/z-modal-manual-log.ts | <gh_stars>1-10
import { ZModalManual } from './z-modal-manual';
export interface ZModalManualLog {
base: ZModalManual;
btnLogTitle: string;
log: string;
}
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/z-menu-material/index.ts | export * from './z-menu-material.component';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/form-inputs/index.ts | export * from './z-form-input-base';
export * from './z-form-input-text';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/z-form.service.ts | import {
zCfpValidator,
zCnpjPattern,
zCnpjValidar,
zCpfCnpjPattern,
zCpfPattern,
zIpPattern,
zVehiclePlatePattern
} from './validators';
import { AbstractControl, AsyncValidatorFn, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
import { Injectable } from '@angular/core';
import ... |
LucasZaia/zmaterial-app | src/app/app.component.ts | <reponame>LucasZaia/zmaterial-app<gh_stars>0
import { Component } from '@angular/core';
import { ZMenuProfile, ZModalService, ZMenuItems,ZMenuBootstrapItens, ZMenuProfileBootstrap} from 'zmaterial';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
exp... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/z-modal-log.ts | <filename>projects/zmaterial/src/lib/z-modal/interfaces/z-modal-log.ts
import { ZModalBase } from './z-modal-base';
export interface ZModalLog {
base: ZModalBase;
btnLogTitle: string;
log: string;
}
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/z-modal-manual-confirm.ts | import { ZModalManual } from './z-modal-manual';
export interface ZModalManualConfirm {
base: ZModalManual;
btnConfirmTitle: string;
}
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/index.ts | <gh_stars>1-10
export * from './z-modal-type';
export * from './z-modal-base';
export * from './z-modal-log';
export * from './z-modal-confirm';
export * from './z-modal-manual';
export * from './z-modal-manual-log';
export * from './z-modal-manual-confirm';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/interfaces/z-menu-bootstrap-itens.ts | <gh_stars>0
export interface ZMenuBootstrapItens {
category: string;
icon: string;
itens: {
label: string;
link: string;
icon?: string;
disabled?: boolean;
}[];
} |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/interfaces/index.ts | <reponame>LucasZaia/zmaterial-app
export * from './z-menu-profile';
export * from './z-menu-items';
export * from './z-menu-bootstrap-itens';
export * from './z-menu-itens-bootstrap-profile';
|
LucasZaia/zmaterial-app | src/app/app-routing.module.ts | import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CourseComponent } from './register/course/course.component';
import { UserComponent } from './register/user/user.component';
const routes: Routes = [
{
path: 'register/user',
component: UserComponent,
... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/z-modal.module.ts | import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ZModalComponent } from './z-modal.component';
import { ZModalService } from './z-modal.service';
import { ZModule } from '../z.module';
@NgModule({
declarations: [
ZModalComponent
],
imports: [
CommonModule... |
LucasZaia/zmaterial-app | src/app/register/user/user.component.ts | import { Component, OnInit } from '@angular/core';
import { Observable, of } from 'rxjs';
import { ZFormInputBase, ZFormInputText, ZFormProvider } from 'zmaterial';
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.scss']
})
export class UserComponent extends ... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/z-modal.service.ts | <reponame>LucasZaia/zmaterial-app
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Observable } from 'rxjs';
import {
ZModalBase,
ZModalConfirm,
ZModalLog,
ZModalType,
ZModalManual,
ZModalManualLog,
ZModalManualConfirm
} from './interfaces';
import... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/z-menu-material/z-menu-material.component.ts | import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
import { Component, Input, OnInit, Output } from '@angular/core';
import { ActivationStart, Router } from '@angular/router';
import { Observable, Subject } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { ZMenuProfile, ZMenuItems ... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/z-form-material/index.ts | export * from './z-form-material.component';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/index.ts | <gh_stars>1-10
export * from './z-modal.component';
export * from './z-modal.service';
export * from './z-modal.module';
export * from './interfaces';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/z-input-material/index.ts | <filename>projects/zmaterial/src/lib/z-form/z-input-material/index.ts
export * from './z-input-material.component';
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/interfaces/z-menu-itens-bootstrap-profile.ts | export interface ZMenuProfileBootstrap{
img?: string;
descriptions?: {
icon: string;
text: string;
}[];
}
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/z-menu-bootstrap/z-menu-bootstrap.component.ts | import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
import { ActivationStart, Router } from '@angular/router';
import { Observable, Subject } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { Component, OnInit, Input, Output } from '@angular/core';
import {ZMenuBootstrapItens} from ... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/z-modal-confirm.ts | <filename>projects/zmaterial/src/lib/z-modal/interfaces/z-modal-confirm.ts<gh_stars>1-10
import { ZModalBase } from './z-modal-base';
export interface ZModalConfirm {
base: ZModalBase;
btnConfirmTitle: string;
}
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/validators/z-pattern-validator.ts | export const zIpPattern = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
export const zVehiclePlatePattern = '[A-Z]{3}[0-9]{1}[A-Z]{1}[0-9]{2}|[A-Z]{3}[0-9]{4}';
export const zCpfPattern = /^\d{3}\.\d{... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-menu/z-menu.module.ts | <reponame>LucasZaia/zmaterial-app
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ZModule } from '../z.module';
import { ZMenuMaterialComponent } from './z-menu-material';
import { ZMenuBootstrapComponent } from './z-menu-bootstrap';
@NgModule({
declarations: [
... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/z-form.module.ts | <reponame>LucasZaia/zmaterial-app
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ZModule } from '../z.module';
import { ZFormMaterialComponent } from './z-form-material';
import { ZInputMaterialComponent } from './z-input-material';
import { ZFormService } from './z-f... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/z-modal-type.ts | <reponame>LucasZaia/zmaterial-app<gh_stars>1-10
export enum ZModalType {
// Template Success
T_SUCCESS = 'T_SUCCESS',
T_SUCCESS_LOG = 'T_SUCCESS_LOG',
T_SUCCESS_CONFIRM = 'T_SUCCESS_CONFIRM',
// Template Warning
T_WARNING = 'T_WARNING',
T_WARNING_LOG = 'T_WARNING_LOG',
T_WARNING_CONFIRM = 'T_WARNING_... |
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-modal/interfaces/z-modal-base.ts | export interface ZModalBase {
title: string;
description: string;
btnCloseTitle: string;
isDisableClose?: boolean | true;
width?: string | 'auto';
height?: string | 'auto';
}
|
LucasZaia/zmaterial-app | projects/zmaterial/src/lib/z-form/z-input-material/z-input-material.component.ts | <reponame>LucasZaia/zmaterial-app
import { Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormGroup } from '@angular/forms';
import { ZFormInputBase, ZFormInputText } from '../form-inputs';
import { ZFormService } from '../z-form.service';
@Component({
selector: 'z-input-material',
temp... |
NatSokneng/blog-post | src/users/users.service.ts | <reponame>NatSokneng/blog-post
import { Injectable, NotFoundException } from "@nestjs/common";
import { UserRepository } from "./repositories/user.repository";
import { UserEntity } from "./entities/user.entity";
import { CreateUserDto } from "./dto/create-user.dto";
import { RegistrationRespModel } from "./egistration... |
NatSokneng/blog-post | src/post/post.controller.ts | <gh_stars>0
import {
Controller,
Get,
Post,
Body,
HttpStatus,
Param,
Delete,
Patch,
UseGuards,
} from "@nestjs/common";
import { PostService } from "./post.service";
import { CreatePostDto } from "./dto/create-post.dto";
import { UpdatePostDto } from "./dto/update-post.dto";
import { JwtAuthGuard } fr... |
NatSokneng/blog-post | src/post/entities/post.entity.ts | <filename>src/post/entities/post.entity.ts
import { type } from "os";
import { CategoryEntity } from "src/categories/entities/category.entity";
import { TagEntity } from "src/tag/entities/tag.entity";
import { Entity, Column, ManyToMany, JoinTable } from "typeorm";
import { BaseEntity } from "../../generic/BaseEntity";... |
NatSokneng/blog-post | src/migrations/1646793604734-AddCocumnUser.ts | import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class AddCocumnUser1646793604734 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "Test",
columns: [
{
na... |
NatSokneng/blog-post | src/users/users.controller.ts | import {
Controller,
UseGuards,
Get,
Request,
} from "@nestjs/common";
import { UsersService } from "./users.service";
import { JwtAuthGuard } from "../auth/jwt-auth.guard";
@Controller("users")
export class UsersController {
constructor(private readonly usersService: UsersService) {}
@UseGuards(JwtAuthGua... |
NatSokneng/blog-post | src/new-user/new-user.module.ts | import { Module } from '@nestjs/common';
import { NewUserService } from './new-user.service';
import { NewUserController } from './new-user.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { NewUserRepository } from './repository/newuser.repository';
@Module({
imports: [TypeOrmModule.forFeature([... |
NatSokneng/blog-post | src/new-user/new-user.service.ts | <filename>src/new-user/new-user.service.ts
import { Injectable, NotFoundException } from "@nestjs/common";
import { CreateNewUserDto } from "./dto/create-new-user.dto";
import { UpdateNewUserDto } from "./dto/update-new-user.dto";
import { NewUserEntity } from "./entities/new-user.entity";
import { NewUserRepository } ... |
NatSokneng/blog-post | src/categories/entities/category.entity.ts | <reponame>NatSokneng/blog-post<filename>src/categories/entities/category.entity.ts
import { type } from "os";
import { PostEntity } from "src/post/entities/post.entity";
import { Entity, Column, ManyToMany } from "typeorm";
import { BaseEntity } from "../../generic/BaseEntity";
@Entity("Category")
export class Categor... |
NatSokneng/blog-post | src/migrations/1645589701241-Category_Post.ts | import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CategoryPost1645589701241 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "CategoryPost",
columns: [
{
... |
NatSokneng/blog-post | src/auth/auth.contoller.ts | import {
Controller,
Get,
Post,
Body,
HttpStatus,
Param,
Delete,
} from "@nestjs/common";
import { AuthService } from "./auth.service";
import { CreateUserDto } from "src/users/dto/create-user.dto";
import { UsersService } from "src/users/users.service";
import { AuthLoginDto } from "./dto/auth.login.dto"... |
NatSokneng/blog-post | src/tag/entities/tag.entity.ts | import { PostEntity } from "src/post/entities/post.entity";
import { Entity, Column, ManyToMany, JoinTable } from "typeorm";
import { BaseEntity } from "../../generic/BaseEntity";
@Entity("Tag")
export class TagEntity extends BaseEntity {
@Column()
public content: string;
@ManyToMany(() => PostEntity, (post) =>... |
NatSokneng/blog-post | src/users/repositories/user.repository.ts | <reponame>NatSokneng/blog-post
import { EntityRepository, Repository } from 'typeorm';
import { UserEntity } from '../entities/user.entity';
@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {
findOneUserByEmail(email: string) {
const query = this.createQueryBuilder("Use... |
NatSokneng/blog-post | src/migrations/1645585569621-Post.ts | <reponame>NatSokneng/blog-post<gh_stars>0
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class Post1645585569621 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "Post",
colu... |
NatSokneng/blog-post | src/tag/tag.module.ts | import { Module } from "@nestjs/common";
import { TagService } from "./tag.service";
import { TagController } from "./tag.controller";
import { TypeOrmModule } from "@nestjs/typeorm";
import { TagRepository } from "./repository/tag.repository";
import { PostRepository } from "src/post/repositories/post.repository";
@M... |
NatSokneng/blog-post | src/configurations/database.configuration.ts | <filename>src/configurations/database.configuration.ts
import { Injectable } from "@nestjs/common";
import { TypeOrmModuleOptions, TypeOrmOptionsFactory } from "@nestjs/typeorm";
import { ConfigurationService } from "./enviroment.configuration";
@Injectable()
export class TypeOrmConfigService implements TypeOrmOptions... |
NatSokneng/blog-post | src/tag/dto/create-tag.dto.ts | <gh_stars>0
import { IsNotEmpty } from "class-validator";
export class CreateTagDto {
@IsNotEmpty()
content: string;
@IsNotEmpty()
postId: number[]
}
|
NatSokneng/blog-post | src/new-user/dto/update-new-user.dto.ts | <filename>src/new-user/dto/update-new-user.dto.ts
import { PartialType } from '@nestjs/mapped-types';
import { CreateNewUserDto } from './create-new-user.dto';
export class UpdateNewUserDto extends PartialType(CreateNewUserDto) {}
|
NatSokneng/blog-post | src/users/entities/user.entity.ts | <gh_stars>0
import { Entity, Column, BeforeInsert } from "typeorm";
import { BaseEntity } from "../../generic/BaseEntity";
import * as bcrypt from "bcrypt";
@Entity("User")
export class UserEntity extends BaseEntity {
@Column()
public firstName: string;
@Column()
public lastName: string;
@Column({ unique: t... |
NatSokneng/blog-post | src/new-user/repository/newuser.repository.ts | <filename>src/new-user/repository/newuser.repository.ts
import { EntityRepository, Repository } from "typeorm";
import { NewUserEntity } from "../entities/new-user.entity";
@EntityRepository(NewUserEntity)
export class NewUserRepository extends Repository<NewUserEntity> {
async deleteNew(){
const query = awa... |
NatSokneng/blog-post | src/new-user/entities/new-user.entity.ts | import { Column, BeforeInsert, Entity } from "typeorm";
import { BaseEntity } from "src/generic/BaseEntity";
import * as bcrypt from "bcrypt";
@Entity('NewUser')
export class NewUserEntity extends BaseEntity {
@Column({
unique: true,
length: 200,
})
email: string;
@Column({
length: 25,
})
pass... |
NatSokneng/blog-post | src/categories/categories.service.ts | <gh_stars>0
import { Injectable, NotFoundException } from "@nestjs/common";
import { CreateCategoryDto } from "./dto/create-category.dto";
import { UpdateCategoryDto } from "./dto/update-category.dto";
import { CategoryRepository } from "./reposities/category.reposity";
@Injectable()
export class CategoriesService {
... |
NatSokneng/blog-post | src/new-user/dto/create-new-user.dto.ts | <filename>src/new-user/dto/create-new-user.dto.ts
import { IsEmail, IsNotEmpty, Length } from 'class-validator';
export class CreateNewUserDto {
@IsEmail()
@Length(200)
email: string;
@IsNotEmpty()
@Length(8, 25)
password: string;
}
|
NatSokneng/blog-post | src/categories/categories.controller.ts | import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
HttpStatus,
UseGuards,
} from "@nestjs/common";
import { CategoriesService } from "./categories.service";
import { CreateCategoryDto } from "./dto/create-category.dto";
import { UpdateCategoryDto } from "./dto/update-category.dto";
import { J... |
NatSokneng/blog-post | src/post/post.service.ts | import { Injectable, NotFoundException } from "@nestjs/common";
import { CategoryRepository } from "src/categories/reposities/category.reposity";
import { CreatePostDto } from "./dto/create-post.dto";
import { PostRepository } from "./repositories/post.repository";
import { PostEntity } from "./entities/post.entity";
i... |
NatSokneng/blog-post | src/tag/tag.service.ts | import { Injectable, NotFoundException } from "@nestjs/common";
import { CreateTagDto } from "./dto/create-tag.dto";
import { UpdateTagDto } from "./dto/update-tag.dto";
import { TagEntity } from "./entities/tag.entity";
import { TagRepository } from "./repository/tag.repository";
import { PostRepository } from "src/po... |
NatSokneng/blog-post | src/tag/repository/tag.repository.ts | <reponame>NatSokneng/blog-post
import { EntityRepository, Repository } from "typeorm";
import { TagEntity } from "../entities/tag.entity";
@EntityRepository(TagEntity)
export class TagRepository extends Repository<TagEntity> {
findAllTag() {
const query = this.createQueryBuilder("TagEntity");
query.leftJoinA... |
NatSokneng/blog-post | src/configurations/enviroment.configuration.ts | export class ConfigurationService {
private readonly envConfig: { [key: string]: any } = null;
constructor() {
this.envConfig = {
PORT: process.env.PORT,
DB_DRIVER: process.env.DB_DRIVER,
DB_HOST: process.env.DB_HOST,
DB_PORT: process.env.DB_PORT,
... |
NatSokneng/blog-post | src/new-user/new-user.controller.ts | import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
HttpStatus,
UseGuards,
} from "@nestjs/common";
import { NewUserService } from "./new-user.service";
import { CreateNewUserDto } from "./dto/create-new-user.dto";
import { UpdateNewUserDto } from "./dto/update-new-user.dto";
import { JwtAuthG... |
NatSokneng/blog-post | src/app.module.ts | import { Module } from "@nestjs/common";
import { AuthModule } from "./auth/auth.module";
import { UsersModule } from "./users/users.module";
import { TypeOrmModule } from "@nestjs/typeorm";
import { ConfigModule } from "@nestjs/config";
import { TypeOrmConfigService } from "./configurations/database.configuration";
im... |
NatSokneng/blog-post | src/tag/tag.controller.ts | <reponame>NatSokneng/blog-post
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
UseGuards,
HttpStatus,
} from "@nestjs/common";
import { TagService } from "./tag.service";
import { CreateTagDto } from "./dto/create-tag.dto";
import { UpdateTagDto } from "./dto/update-tag.dto";
import { JwtA... |
NatSokneng/blog-post | src/users/users.module.ts | import { Module } from '@nestjs/common';
import { UsersService } from './users.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserRepository } from './repositories/user.repository';
import { JwtModule } from '@nestjs/jwt';
@Module({
imports: [TypeOrmModule.forFeature([UserRepository]),
JwtModul... |
NatSokneng/blog-post | src/post/repositories/post.repository.ts | import { EntityRepository, Repository } from "typeorm";
import { PostEntity } from "../entities/post.entity";
@EntityRepository(PostEntity)
export class PostRepository extends Repository<PostEntity> {
getOneDetailByPostId(id: number) {
const query = this.createQueryBuilder("PostEntity");
query.leftJoinAndSele... |
FlashHand/rig-test-1 | index.d.ts | <reponame>FlashHand/rig-test-1<filename>index.d.ts
declare module 'rig-test-1' {
export const hello: () => void
}
|
jkogut/simple-python-rest-api-v1 | deployment/pulumi/index.ts | import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
// lets take image from pulumi config
let config = new pulumi.Config();
let appImage = config.require("appImage");
// testapp container, replicated 1 time.
const appName = "pyapi";
const appLabels = { app: appName };
const testapp = ... |
anakreon/awCrypt | src/cipher/morse.ts | export const encode = (plaintext: string): string => {
return plaintext.trim()
.toLowerCase()
.split(textSeparator.word)
.map(encodeTextWord)
.join(morseSeparator.word);
};
export const decode = (ciphertext: string): string => {
return ciphertext.trim()
.toLowerCase()
... |
anakreon/awCrypt | src/cipher/substitution.ts | <filename>src/cipher/substitution.ts
export const encode = (plaintext: string, keyword: string): string => {
return new CharcodeShiftEncoder(keyword).convert(plaintext);
};
export const decode = (ciphertext: string, keyword: string): string => {
return new CharcodeShiftDecoder(keyword).convert(ciphertext);
};
... |
anakreon/awCrypt | src/cipher/charcodeShift.ts | <reponame>anakreon/awCrypt
export const encode = (plaintext: string, key: number): string => {
return new CharcodeShiftEncoder().convert(plaintext, key);
};
export const decode = (ciphertext: string, key: number): string => {
return new CharcodeShiftDecoder().convert(ciphertext, key);
};
abstract class Charco... |
anakreon/awCrypt | src/cipher/base64.ts | <filename>src/cipher/base64.ts
export const encode = (plaintext: string) => {
return new Base64Encoder().convert(plaintext);
};
export const decode = (ciphertext: string) => {
return new Base64Decoder().convert(ciphertext);
};
abstract class Base64Converter {
protected abstract originalCharacterBatchSize:... |
anakreon/awCrypt | src/index.ts | import { Ascii85, Base64, Caesar, CharcodeShift, Morse, RailFence, Substitution } from './types';
import * as _ascii85 from './cipher/ascii85';
import * as _base64 from './cipher/base64';
import * as _caesar from './cipher/caesar';
import * as _charcodeShift from './cipher/charcodeShift';
import * as _morse from './ci... |
anakreon/awCrypt | src/types.ts | export interface Ascii85 {
encode: (inputText: string) => string;
decode: (inputText: string) => string;
}
export interface Base64 {
encode: (inputText: string) => string;
decode: (inputText: string) => string;
}
export interface Caesar {
encode: (plaintext: string, key: number) => string;
dec... |
anakreon/awCrypt | src/cipher/ascii85.ts | export const encode = (plaintext: string) => {
return new Ascii85Encoder().convert(plaintext);
};
export const decode = (ciphertext: string) => {
return new Ascii85Decoder().convert(ciphertext);
};
class Ascii85Encoder {
private originalBitsPerByte: number = 8;
private originalCharacterBatchSize: numb... |
anakreon/awCrypt | src/cipher/railFence.ts | <reponame>anakreon/awCrypt
export const encode = (plaintext: string, numberOfRails: number): string => {
let ciphertext = '';
const loopLength = 2 * (numberOfRails - 1);
const totalLoops = plaintext.length / loopLength;
for (var railNo = 0; railNo < numberOfRails; ++railNo) {
for (var loopNo = 0; ... |
anakreon/awCrypt | src/cipher/caesar.ts | export const encode = (plaintext: string, key: number): string => {
return new CaesarEncoder().convert(plaintext, key);
};
export const decode = (ciphertext: string, key: number): string => {
return new CaesarDecoder().convert(ciphertext, key);
};
abstract class CaesarConverter {
private charactersToIgnor... |
gpunalkar/quickstart | src/app/config/app.routes.ts | <gh_stars>0
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { UserComponent } from '../components/user.component/user.component';
import { AboutComponent } from '../components/about.component/about.component';
const appRoutes:Routes = [
... |
gpunalkar/quickstart | src/app/components/user.component/user.component.ts | <filename>src/app/components/user.component/user.component.ts
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { PostServices } from '../../services/post.services/post.services';
@Component({
selector: 'user',
templateUrl: `./user.component.html`,
providers:[PostServic... |
miguelcjalmeida/vagante-dsmod | src/tools/create-lottery-picker.ts | <reponame>miguelcjalmeida/vagante-dsmod
import { INextOf, nextItemFactory } from '../manipulators/next-item-factory'
import { shuffleArray } from './shuffle-array'
export interface ILotteryStack<T> {
proportion: number
possibilities: T[]
}
export interface ILottery<T> {
[key: string]: ILotteryStack<T>
}
expor... |
miguelcjalmeida/vagante-dsmod | src/transformators/merchant-intermission/replace-orbeck-items.ts | <filename>src/transformators/merchant-intermission/replace-orbeck-items.ts
import { IRoomBlock } from '../../rooms/context'
import { IItemEntity } from '../../rooms/entities'
import { findRoomEntities } from '../../finders/find-room-entities'
import { createLotteryPicker } from '../../tools/create-lottery-picker'
impor... |
miguelcjalmeida/vagante-dsmod | src/modder/get-all-transformators.ts | <filename>src/modder/get-all-transformators.ts
import { characterSelection } from '../transformators/character-selection'
import { itemsCreator } from '../transformators/items-creator'
import { merchantIntermission } from '../transformators/merchant-intermission'
import { cloneDsMod } from '../transformators/clone-dsmo... |
miguelcjalmeida/vagante-dsmod | src/item-builder/next-equipment-picker.ts | import { createLotteryPicker } from '../tools/create-lottery-picker'
import { equipmentProfiles, EquipmentSubType, EquipmentType } from './equipment-profile'
import { ItemTypes } from '../rooms/types'
import { shuffleArray } from '../tools/shuffle-array'
export const nextEquipmentPicker = createLotteryPicker(
{
... |
miguelcjalmeida/vagante-dsmod | src/transformators/merchant-intermission/replace-cornyx-items.ts | <reponame>miguelcjalmeida/vagante-dsmod<filename>src/transformators/merchant-intermission/replace-cornyx-items.ts
import { IItemEntity, IBookEntity } from '../../rooms/entities'
import { createLotteryPicker } from '../../tools/create-lottery-picker'
import { BookTypes, AttributeTypes, ItemTypes } from '../../rooms/type... |
miguelcjalmeida/vagante-dsmod | src/build.ts | <gh_stars>1-10
import { applyMod } from './modder/apply-mod'
applyMod()
|
miguelcjalmeida/vagante-dsmod | src/transformators/remove-doors.ts | <gh_stars>1-10
import { IRoomContext, IRoomBlock, IActSpecification, IRoomAct } from '../rooms/context'
import { RoomNames } from '../rooms/names';
export const removeDoors = (ctx: IRoomContext) => {
console.log('removing doors')
ctx.acts.forEach((act) => {
if (act._comment === RoomNames.Tutorial) return
... |
miguelcjalmeida/vagante-dsmod | src/transformators/clone-dsmod.ts | import { IRoomContext } from '../rooms/context'
import { findAct } from '../finders/find-act'
import { RoomNames } from '../rooms/names'
import { dsmod } from '../manipulators/get-template'
export const cloneDsMod = (context: IRoomContext) => {
cloneDsModRoomIntoRoom(context, RoomNames.ACT_ONE)
cloneDsModRoomIntoR... |
miguelcjalmeida/vagante-dsmod | src/transformators/merchant-intermission/replace-anri-items.ts | import { IBookEntity, IItemEntity } from '../../rooms/entities'
import { AttributeTypes, ItemTypes } from '../../rooms/types'
import { improveEquipment } from '../../item-builder/improve-equipment'
import { createLotteryPicker } from '../../tools/create-lottery-picker'
import { IEquipmentProfile, EquipmentSubType, Equi... |
miguelcjalmeida/vagante-dsmod | src/transformators/merchant-intermission/replace-andre-items.ts | import { equipmentProfiles, EquipmentType } from '../../item-builder/equipment-profile'
import { EntityTypes } from '../../rooms/types'
import { IItemEntity } from '../../rooms/entities'
import { createLotteryPicker } from '../../tools/create-lottery-picker'
import { shuffleArray } from '../../tools/shuffle-array'
impo... |
miguelcjalmeida/vagante-dsmod | src/transformators/merchant-intermission/replace-gavlan-items.ts | <gh_stars>1-10
import { IItemEntity } from '../../rooms/entities'
import { createLotteryPicker } from '../../tools/create-lottery-picker'
import { AttributeTypes, ItemTypes } from '../../rooms/types'
import { priceUp } from '../../item-builder/price-up'
import { equipmentProfiles, EquipmentSubType, EquipmentType }
f... |
miguelcjalmeida/vagante-dsmod | src/item-builder/attributes-by-type.ts | import { AttributeTypes } from '../rooms/types'
import { attributeProfiles, AttributeRestrictions, IAttributeProfile } from './attribute-profile'
import { nextItemFactory, INextOf } from '../manipulators/next-item-factory'
import { createLotteryPicker } from '../tools/create-lottery-picker'
export interface Attributes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.