repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
gzigzigzeo/protobuf-as
tests/structs/weight_map.test.ts
import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { WeightMap } from '../../src/structs/index.js'; test('WeightMap.increase(), WeightMap.decrease()', () => { const map = new WeightMap<string>(); map.increase('test', 5); assert.equal(map.get('test'), 5); map.decrease('test', 3)...
gzigzigzeo/protobuf-as
src/structs/index.ts
<reponame>gzigzigzeo/protobuf-as export { WeightMap } from "./weight_map.js"; export { ImmutableFlatTree } from "./immutable_flat_tree.js";
gzigzigzeo/protobuf-as
tests/__fixtures__/assembly/elementaries.ts
import { Elementaries } from '../as_proto/elementaries/elementaries'; export function encode(obj: Elementaries): ArrayBuffer { return obj.encode() } export function decode(buffer: ArrayBuffer): Elementaries { return Elementaries.decode(buffer) } export function size(obj: Elementaries): u32 { return obj.si...
gzigzigzeo/protobuf-as
src/proto/index.ts
export * as named from './named_descriptor.js'; export * as decorated from './decorated_descriptor.js'; export * from './named_descriptor_index.js'; export * from './named_descriptor_index_reducer.js'; export * from './decorated_descriptor_index.js'; // Represents abstract descriptor collection interface export interf...
gzigzigzeo/protobuf-as
tests/assembly/nested.test.ts
<reponame>gzigzigzeo/protobuf-as<filename>tests/assembly/nested.test.ts<gh_stars>1-10 import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { Person } from '../__fixtures__/ts_proto/nested/main.js'; import { encode, decode, size } from '../__fixtures__/build/nested.js'; const subject: Person = { ...
gzigzigzeo/protobuf-as
tests/__fixtures__/ts_proto/oneof/main.ts
<reponame>gzigzigzeo/protobuf-as<filename>tests/__fixtures__/ts_proto/oneof/main.ts /* eslint-disable */ import Long from 'long'; import _m0 from 'protobufjs/minimal.js'; export const protobufPackage = ''; export interface Branch1 { String: string; } export interface Branch2 { UInt32: number; } export inter...
gzigzigzeo/protobuf-as
tests/assembly/oneof.test.ts
import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { OneOf } from '../__fixtures__/ts_proto/oneof/main.js'; import { encode, decode, size } from '../__fixtures__/build/oneof.js'; const subject: OneOf = { Messages: {$case: "Branch2", Branch2: { UInt32: 99 } }, NonOneOf1: "foo", NonOn...
gzigzigzeo/protobuf-as
src/walker_as/blocks_single_file.ts
import { Writer } from "./index.js"; import { readFileSync } from 'fs'; import { staticFiles, embedNamespace } from './internal.js'; /** * Before and after code blocks */ export class BlocksSingleFile { constructor(private p:Writer) {} beforeAll() { this.p(`namespace ${embedNamespace} {`); s...
gzigzigzeo/protobuf-as
tests/__fixtures__/assembly/oneof.ts
import { OneOf } from '../as_proto/oneof/oneof'; export function encode(obj: OneOf): ArrayBuffer { return obj.encode() } export function decode(buffer: ArrayBuffer): OneOf { return OneOf.decode(buffer) } export function size(obj: OneOf): u32 { return obj.size() }
gzigzigzeo/protobuf-as
src/proto/decorated_descriptor.ts
<gh_stars>1-10 import { FieldDescriptorProto_Type } from 'ts-proto-descriptors'; import { AbstractDescriptorCollection } from './index.js'; // Protobuf wire type export enum WireType { VARINT = 0, FIXED64 = 1, LENGTH_DELIMITED = 2, FIXED32 = 5, } // Has wire type export type WireTypeable = { wireT...
gzigzigzeo/protobuf-as
tests/structs/immutable_flat_tree.test.ts
import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { ImmutableFlatTree } from '../../src/structs/index.js'; const fixture: [string, string][] = [ ['root', 'root'], ['root.1', 'root.1'], ['root.1.1', 'root.1.1'], ['root.1.2', 'root.1.2'], ['root.2', 'root.2'], ['root.2.1',...
gzigzigzeo/protobuf-as
src/internal.ts
import ReadStream = NodeJS.ReadStream; export function readToBuffer(stream: ReadStream): Promise<Buffer> { return new Promise((resolve) => { const ret: Array<Buffer> = []; let len = 0; stream.on('readable', () => { let chunk; while ((chunk = stream.read())) { ...
gzigzigzeo/protobuf-as
tests/__fixtures__/ts_proto/complex_struct/main.ts
/* eslint-disable */ import Long from 'long'; import _m0 from 'protobufjs/minimal.js'; import { Timestamp } from './google/protobuf/timestamp.js'; import { Properties } from './external.js'; import { Properties as Properties1 } from './external.external.js'; export const protobufPackage = ''; /** Status represents ob...
gzigzigzeo/protobuf-as
tests/__fixtures__/assembly/complex_struct.ts
<reponame>gzigzigzeo/protobuf-as<gh_stars>1-10 import { Message } from '../as_proto/complex_struct/complex_struct'; export function encode(obj: Message): ArrayBuffer { return obj.encode() } export function decode(buffer: ArrayBuffer): Message { return Message.decode(buffer) } export function size(obj: Message...
gzigzigzeo/protobuf-as
tests/__fixtures__/build/elementaries.d.ts
<reponame>gzigzigzeo/protobuf-as /** * tests/__fixtures__/assembly/elementaries/encode * @param obj `tests/__fixtures__/as_proto/elementaries/elementaries/Elementaries` * @returns `~lib/arraybuffer/ArrayBuffer` */ export declare function encode(obj: __Record3<undefined>): ArrayBuffer; /** * tests/__fixtures__/asse...
gzigzigzeo/protobuf-as
src/main.ts
<filename>src/main.ts<gh_stars>1-10 import { CodeGeneratorRequest, CodeGeneratorResponse, CodeGeneratorResponse_Feature, } from 'ts-proto-descriptors'; import { promisify } from 'util'; import { FlatWalker, FlatWalkerStrategy } from './walker/flat_walker_strategy.js'; import { WalkerASSingleFile, WalkerASM...
gzigzigzeo/protobuf-as
src/walker/index.ts
<filename>src/walker/index.ts export * from './flat_walker_strategy.js';
gzigzigzeo/protobuf-as
src/walker_as/field.ts
import { decorated } from '../proto/index.js'; import { Writer } from './index.js'; import { getTypeInfo, TypeInfo } from './type_info.js'; import { Options } from '../options.js'; import { comment } from './internal.js'; /** * Field code blocks */ export class Field { constructor(private p: Writer, private opti...
gzigzigzeo/protobuf-as
assembly/ext/google.protobuf.Value.ts
// Sets field value set<T>(value: T): Value { this.setNull(); this.null_value = 0; if (isBoolean<T>(value)) { this.bool_value = value; } else if (isInteger<T>(value) || isFloat<T>(value)) { this.number_value = value; } else if (isString<T>(value)) { this.string_value = value; } else if (value i...
gzigzigzeo/protobuf-as
tests/options.test.ts
<filename>tests/options.test.ts import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { parseOptions } from '../src/options.js'; test('parseOptions() returns targetFileName', () => { const options = parseOptions(''); assert.equal(options.targetFileName, 'assembly.ts'); }); test('parseOption...
gzigzigzeo/protobuf-as
tests/__fixtures__/build/maps.d.ts
<filename>tests/__fixtures__/build/maps.d.ts /** * tests/__fixtures__/assembly/maps/encode * @param obj `tests/__fixtures__/as_proto/maps/maps/Maps` * @returns `~lib/arraybuffer/ArrayBuffer` */ export declare function encode(obj: __Record3<undefined>): ArrayBuffer; /** * tests/__fixtures__/assembly/maps/decode * ...
gzigzigzeo/protobuf-as
tests/helpers/index.ts
<reponame>gzigzigzeo/protobuf-as<gh_stars>1-10 import { CodeGeneratorRequest } from 'ts-proto-descriptors'; import { readFileSync } from 'fs'; import { normalize, join, dirname } from 'path'; import { fileURLToPath } from 'url'; /** * Returns CodeGeneratorRequest of a specified proto definition * @param name Request...
gzigzigzeo/protobuf-as
scripts/gen-fixtures.ts
import { execSync } from "child_process"; import { readdirSync } from "fs"; import { join, normalize, dirname, basename } from 'path'; import { mkdir } from 'mk-dirs/sync/index.js' import { fileURLToPath } from 'url'; // Fixture represents fixture paths type Fixture = { name: string; // Name proto: strin...
gzigzigzeo/protobuf-as
src/walker_as/one_of.ts
import { decorated } from "../proto/index.js"; import { Writer } from "./index.js"; import { Options } from '../options.js'; import changeCase from "change-case"; /** * OneOf code blocks */ export class OneOf { constructor(private p:Writer, private options:Options) {} public discriminatorDecl(desc: decorate...
gzigzigzeo/protobuf-as
tests/__fixtures__/build/oneof.d.ts
<filename>tests/__fixtures__/build/oneof.d.ts /** * tests/__fixtures__/assembly/oneof/encode * @param obj `tests/__fixtures__/as_proto/oneof/oneof/OneOf` * @returns `~lib/arraybuffer/ArrayBuffer` */ export declare function encode(obj: __Record3<undefined>): ArrayBuffer; /** * tests/__fixtures__/assembly/oneof/deco...
gzigzigzeo/protobuf-as
src/walker_as/message.ts
import { decorated } from '../proto/index.js'; import { Writer } from './index.js'; import { relativeName, comment } from './internal.js'; import { Options } from '../options.js'; import { normalize, join, dirname, parse } from 'path'; import { fileURLToPath } from 'url'; import { readdirSync, readFileSync } from 'fs';...
StephenFluin/elgato-key-light-control-interface
src/app/core/services/electron/electron.service.ts
import { Injectable } from '@angular/core'; // If you import a module but never use any of the imported values other than as TypeScript types, // the resulting javascript file will look as if you never imported the module at all. import { ipcRenderer, webFrame, remote } from 'electron'; import * as childProcess from '...
chilam1234/VotingSystem
src/utils/serializeValidationError.ts
import { ValidationError } from 'yup'; interface Error { path: string; message: string; } export const serializeValidationError = (err: ValidationError) => { const invalid: Error[] = []; err.inner.map(value => { invalid.push({ path: value.path, message: value.message, }); }); return in...
chilam1234/VotingSystem
src/main.ts
import { NestFactory } from '@nestjs/core'; import * as Store from 'connect-redis'; import * as dotenv from 'dotenv'; import * as session from 'express-session'; import { AppModule } from './app.module'; import { SESSION_SECRET } from './constants'; import { redis } from './redis'; dotenv.config(); async function boo...
chilam1234/VotingSystem
src/constants.ts
export const SESSION_SECRET = 'asfl;kasfoaihfasdfknafin'; export const POLL_OPTION_ID_PREFIX = 'pollOptionId:';
chilam1234/VotingSystem
src/poll/pollOption.entity.ts
import { Field, ObjectType } from 'type-graphql'; import { Column, Entity, ManyToOne, PrimaryGeneratedColumn, OneToMany } from 'typeorm'; import { Poll } from './poll.entity'; import { Vote } from './vote.entity'; @ObjectType() @Entity() export class PollOption { @Field() @PrimaryGeneratedColumn() id: number; ...
chilam1234/VotingSystem
src/app.module.ts
<filename>src/app.module.ts import { Module } from '@nestjs/common'; import { GraphQLModule } from '@nestjs/graphql'; import { TypeOrmModule } from '@nestjs/typeorm'; import { typeOrmConfig } from './config/typeOrmConfig'; import { pollOptionLoader } from './loaders/pollOptionLoader'; import { PollModule } from './poll...
chilam1234/VotingSystem
src/poll/args/allPollsArgs.ts
<gh_stars>0 import { ArgsType, Field } from 'type-graphql'; @ArgsType() export class AllPollsArgs { @Field() take: number; @Field() skip: number; }
chilam1234/VotingSystem
src/user/user.entity.ts
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Poll } from '../poll/poll.entity'; @Entity('users') export class User { @PrimaryGeneratedColumn('uuid') id: string; @Column() userName: string; @Column() hkId: string; @Column() password: string; @OneToMany(() =...
chilam1234/VotingSystem
src/pipes/yupValidationPipe.ts
<gh_stars>0 import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common'; import { Schema } from 'yup'; import { serializeValidationError } from '../utils/serializeValidationError'; @Injectable() export class YupValidationPipe implements PipeTransform { constructor(private readonly schema: Schema<{}>...
chilam1234/VotingSystem
src/user/user.service.ts
import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import * as bcrypt from 'bcryptjs'; import { Request } from 'express'; import { MyContext } from '../types/myContext'; import { LoginInput } from './input/user.loginInput'; import { SignupInput } from './input/user.singupIn...
chilam1234/VotingSystem
src/poll/auth.guard.ts
<filename>src/poll/auth.guard.ts import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; import { Request } from 'express'; @Injectable() export class AuthGuard implements CanActivate { canActivate(context: ExecutionContext): boolean { co...
chilam1234/VotingSystem
src/poll/poll.repository.ts
<filename>src/poll/poll.repository.ts import { EntityRepository, Repository } from 'typeorm'; import { Poll } from './poll.entity'; import { PollOption } from './pollOption.entity'; import { Vote } from './vote.entity'; @EntityRepository(Poll) export class PollRepository extends Repository<Poll> {} @EntityRepository(...
chilam1234/VotingSystem
src/types/myContext.ts
<reponame>chilam1234/VotingSystem<filename>src/types/myContext.ts import * as DataLoader from 'dataloader'; import { Request, Response } from 'express'; import { PollOption } from '../poll/pollOption.entity'; export interface MyContext { req: Request; res: Response; pollOptionLoader: DataLoader<number, PollOptio...
chilam1234/VotingSystem
src/poll/poll.entity.ts
import { Field, ObjectType } from 'type-graphql'; import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, } from 'typeorm'; import { User } from '../user/user.entity'; import { PollOption } from './pollOption.entity'; @ObjectType() @Entity() export class Poll { @Field() @PrimaryGeneratedCo...
chilam1234/VotingSystem
src/user/user.resolver.ts
import { UsePipes } from '@nestjs/common'; import { Args, Context, Mutation, Query, Resolver } from '@nestjs/graphql'; import { MyContext } from 'src/types/myContext'; import * as yup from 'yup'; import { YupValidationPipe } from '../pipes/yupValidationPipe'; import { LoginInput } from './input/user.loginInput'; import...
chilam1234/VotingSystem
src/user/input/user.singupInput.ts
import { Field, InputType } from 'type-graphql'; import { User } from '../user.entity'; @InputType({ description: 'Signup Input' }) export class SignupInput implements Partial<User> { @Field() userName: string; @Field() hkId: string; @Field() password: string; }
chilam1234/VotingSystem
src/poll/poll.service.ts
import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { POLL_OPTION_ID_PREFIX } from '../constants'; import { redis } from '../redis'; import { MyContext } from '../types/myContext'; import { Poll } from './poll.entity'; import { PollOptionRepository, PollRepository, Vo...
chilam1234/VotingSystem
src/subscribers/user.subscriber.ts
import * as <PASSWORD> from '<PASSWORD>'; import { EntitySubscriberInterface, EventSubscriber, InsertEvent, } from 'typeorm'; import { User } from '../user/user.entity'; @EventSubscriber() export class PostSubscriber implements EntitySubscriberInterface<User> { /** * Indicates that this subscriber only list...
chilam1234/VotingSystem
src/poll/vote.entity.ts
import { Field, ObjectType } from 'type-graphql'; import { Entity, PrimaryGeneratedColumn, OneToOne, ManyToOne } from 'typeorm'; import { PollOption } from './pollOption.entity'; import { User } from 'src/user/user.entity'; @ObjectType() @Entity() export class Vote { @Field() @PrimaryGeneratedColumn() id: number;...
runerback/iso-3166-reader-2
src/matches.ts
import { MatchGroups } from "./module"; export default function* iterator(pattern: string | RegExp, flags: string[], content: string): IterableIterator<MatchGroups> { const exp = new RegExp(pattern, flags.join('')); let match = exp.exec(content); while (match && match.groups) { yield match.groups...
runerback/iso-3166-reader-2
src/request.ts
<filename>src/request.ts import http, { ClientRequest, IncomingMessage } from 'http'; import https from 'https'; import { URL } from 'url'; import { Config } from './module'; import crypto from 'crypto'; import fs from 'fs'; import path from 'path'; interface RequestResult { readonly data: string; readonly isB...
runerback/iso-3166-reader-2
src/index.ts
<filename>src/index.ts import { Config, CountryData, CountryModel, LinkedData } from './module'; import request from './request'; import matches from './matches'; import fs from 'fs'; import path from 'path'; import { URL } from 'url'; import { Pattern } from './patterns'; const _config = readConfig(); read(_config) ...
runerback/iso-3166-reader-2
src/module.d.ts
export interface Config { readonly rootURL: string; readonly cachePath: string; // cache folder readonly output: string; // output file name } export interface MatchGroups { readonly [key: string]: string; } export interface LinkedData<T = any> { readonly name: string; readonly url: string; ...
at-fe-support/ng2-file-upload
ng2-file-upload.d.ts
<reponame>at-fe-support/ng2-file-upload export * from './components/file-upload/file-select.directive'; export * from './components/file-upload/file-drop.directive'; export * from './components/file-upload/file-uploader.class'; export declare const FILE_UPLOAD_DIRECTIVES: [any]; declare var _default: { directives: ...
at-fe-support/ng2-file-upload
demo/components/file-upload/zs-file-demo/demo.ts
import {Component, ElementRef, Renderer, Input, HostListener, HostBinding, OnInit} from '@angular/core'; import {FileUploader, FileUploaderOptions} from '../../../../ng2-file-upload'; @Component({ selector: 'demo-file-upload', providers: [FileUploader], template: require('./demo.html'), styles: [':host {border...
at-fe-support/ng2-file-upload
components/file-upload/file-like-object.class.ts
function isElement(node:any):boolean { return !!(node && (node.nodeName || node.prop && node.attr && node.find)); } export class FileLikeObject { public lastModifiedDate:any; public size:any; public type:string; public name:string; public constructor(fileOrInput:any) { let isInput = isElement(fileOrIn...
at-fe-support/ng2-file-upload
components/file-upload/file-drop.directive.spec.ts
import {Component} from '@angular/core'; import {it, inject, beforeEachProviders} from '@angular/core/testing'; import {ComponentFixture} from '@angular/compiler/testing'; import {FileUploader} from './file-uploader.class'; import {FileSelectDirective} from './file-select.directive'; @Component({ selector: 'container...
at-fe-support/ng2-file-upload
demo/components/file-upload-section.ts
<filename>demo/components/file-upload-section.ts import {Component} from '@angular/core'; import {CORE_DIRECTIVES} from '@angular/common'; import {TAB_DIRECTIVES} from 'ng2-bootstrap/ng2-bootstrap'; import {SimpleDemoComponent} from './file-upload/simple-demo'; let name = 'File Upload'; let doc = require('../../compo...
dreamweiver/money-waster-app
src/environments/firebase.env.ts
export const config = { apiKey: "<KEY>", authDomain: "gcal-app-246607.firebaseapp.com", databaseURL: "https://gcal-app-246607.firebaseio.com", projectId: "gcal-app-246607", storageBucket: "", messagingSenderId: "422142782931", appId: "1:422142782931:web:a51807657295188f" };
dreamweiver/money-waster-app
src/app/app.module.ts
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { config } from './../environments/firebase.env'; import { AppComponent } from './app.component'; import { HomeComponent } from './home/home.component'; import { EventDetailComponent } from './event-detail/event...
dreamweiver/money-waster-app
src/app/services/auth.service.ts
import {Injectable, NgZone} from '@angular/core'; import {Observable, from, of, forkJoin} from 'rxjs'; import {AngularFireAuth} from '@angular/fire/auth'; import { delay} from 'rxjs/operators' import {auth} from 'firebase/app'; import {config} from './../../environments/gapi-config'; import {BehaviorSubject} from 'rxjs...
dreamweiver/money-waster-app
src/app/event-detail/event-detail.component.ts
import { Component, Input , OnDestroy} from '@angular/core'; import { NotificationService } from './../services/notification.service'; import {MatSnackBar} from '@angular/material'; // Custom Daily Rates type class DailyRates { avgDailyCostRate:number; avgDailyRevenueRate:number; } const totalHrsInDay:number...
dreamweiver/money-waster-app
src/app/home/home.component.ts
import { Component, OnDestroy, NgZone} from '@angular/core'; import { AuthService } from './../services/auth.service'; import { NotificationService } from './../services/notification.service'; const delay:number = 60 * 1000; @Component({ selector: 'home', templateUrl: './home.component.html', styleUrls: [ './ho...
dreamweiver/money-waster-app
src/app/services/notification.service.ts
<reponame>dreamweiver/money-waster-app<filename>src/app/services/notification.service.ts import {Injectable} from '@angular/core'; import {MatSnackBar} from '@angular/material'; declare var webNotification: any; const icons = { normal: 'assets/images/office-calendar.ico', special: 'assets/images/office-alert....
dreamweiver/money-waster-app
src/environments/gapi-config.ts
<filename>src/environments/gapi-config.ts export const config = { apiKey: "<KEY>", clientId:'422142782931-gb1lg84ipjucknmkil7qevkmrep0c1i7.apps.googleusercontent.com', discoveryDocs: ['https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest'], scope: 'https://www.googleapis.com/auth/calendar.readonly' };
PabloLION/usehooks-ts
scripts/copyHooks.ts
<reponame>PabloLION/usehooks-ts import fs from 'fs' import path from 'path' import { isHookFile, toQueryParams } from './utils' const hooksDir = path.resolve('./lib/src') const demosDir = path.resolve('./site/src/hooks-doc') const outputDir = path.resolve('./site/generated') const sandboxTemplatePath = path.resolve('...
Distil62/ynovNosql_teal
server/api/quarters/getByName.ts
<filename>server/api/quarters/getByName.ts import { Router, Request, Response} from "express"; import Quarter from '../../model/Quarter'; const router = Router(); interface IQuarterNameRequest { name: string } export default router.get('/name', async function (req: Request, res: Response) { const request: IQ...
Distil62/ynovNosql_teal
server/api/index.ts
import { Router } from 'express'; import velov from './velov/index'; import quarter from './quarters/index'; import interest from './interest/index'; const router = Router(); router.use('/velov', velov); router.use('/quarter', quarter); router.use('/interest', interest); export default router;
Distil62/ynovNosql_teal
server/server.ts
import express = require('express'); import next = require('next'); import bodyparser = require('body-parser'); import database from './database/database'; import routes from './routes'; const dev = process.env.NODE_ENV !== 'production'; const port = dev ? 3000 : 8000; const app = next({ dev }); const handle = app.ge...
Distil62/ynovNosql_teal
server/model/Quarter.ts
<filename>server/model/Quarter.ts import { model, Schema } from "mongoose"; const quarter = model('quartier', new Schema({ type: String, features: { nom: String, theme: String, soustheme: String, identifiant: String, idexterne: String, siret: String, date...
Distil62/ynovNosql_teal
server/api/interest/index.ts
import { Router } from 'express'; import all from './all'; import getByName from './getByName'; const router = Router(); router.use(all); router.use(getByName); export default router;
Distil62/ynovNosql_teal
server/api/interest/getByName.ts
<reponame>Distil62/ynovNosql_teal import { Router, Request, Response} from "express"; import Interest from '../../model/Interest'; const router = Router(); interface IInterestNameRequest { name: string } export default router.get('/name', async function (req: Request, res: Response) { const request: IInteres...
Distil62/ynovNosql_teal
server/model/Velov.ts
import { model, Schema } from "mongoose"; const velov = model('velov', new Schema({ type: String, properties: { number: Number, name: String, address: String, address2: String, commune: String, nmarrond: Number, bonus: String, pole: String, ...
Distil62/ynovNosql_teal
server/api/velov/all.ts
<gh_stars>1-10 import { Request, Response, Router } from "express"; import Velov from '../../model/Velov'; const router = Router(); export default router.get('/', async function (req: Request, res: Response) { res.json(await Velov.find()); });
Distil62/ynovNosql_teal
server/api/quarters/all.ts
<gh_stars>1-10 import { Router, Request, Response} from "express"; import Quarter from '../../model/Quarter'; const router = Router(); export default router.get('/', async function (req: Request, res: Response) { res.json(await Quarter.find()); });
Distil62/ynovNosql_teal
server/model/Interest.ts
<gh_stars>1-10 import { model, Schema } from "mongoose"; const interest = model('pointCle', new Schema({ type: String, properties: { id: String, id_sitra1: String, type: String, type_detail: String, nom: String, adresse: String, codepostal: String, ...
Distil62/ynovNosql_teal
server/api/velov/nearAvailablePlace.ts
<reponame>Distil62/ynovNosql_teal import {Request, Response, Router} from "express"; import Velov from '../../model/Velov'; const router = Router(); interface INearAvailablePlaceRequest { lat: string; lon: string; distance: string } export default router.get('/nearAvailablePlace', async function (req: Re...
Distil62/ynovNosql_teal
server/types/velov.d.ts
<reponame>Distil62/ynovNosql_teal export interface IVelov { type: string, properties: { number: number, name: string, address: string, address2: string, commune: string, nmarrond: number, bonus: string, pole: string, lat: number, ln...
Distil62/ynovNosql_teal
server/api/velov/index.ts
import { Router } from 'express'; import all from './all'; import nearAvailablePlace from './nearAvailablePlace'; import nearAvailableBike from './nearAvailableBike'; const router = Router(); router.use(all); router.use(nearAvailablePlace); router.use(nearAvailableBike); export default router;
Distil62/ynovNosql_teal
server/database/database.ts
<filename>server/database/database.ts import mongoose = require('mongoose'); export default function () { // mongoose.connect('mongodb+srv://mern:mern@<EMAIL>.mongodb.<EMAIL>/test?retryWrites=true', mongoose.connect('mongodb://YnovNoSql:YnovNoSql@172.16.31.10/ProjetNoSql?retryWrites=true', { authSo...
dduportal/cds
ui/src/app/views/project/add/project.add.component.spec.ts
<filename>ui/src/app/views/project/add/project.add.component.spec.ts import { HttpClientTestingModule } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA, Injector } from '@angular/core'; import { getTestBed, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { R...
dduportal/cds
ui/src/app/views/workflow/run/node/pipeline/service/service.log.component.ts
<filename>ui/src/app/views/workflow/run/node/pipeline/service/service.log.component.ts import { HttpClient, HttpHeaders } from '@angular/common/http'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angu...
dduportal/cds
ui/src/app/store/applications.state.ts
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Action, createSelector, State, StateContext } from '@ngxs/store'; import { Application, Overview } from 'app/model/application.model'; import { IntegrationModel, ProjectIntegration } from 'ap...
PgBiel/nodeargs
types.d.ts
<gh_stars>0 declare module "nodeargs" { export let args: string[]; export let rawArgs: string[]; export let latestParsed: parsedArg[]; export function setArgs(...args: arg[]): void; export function setOptions(...options: string[]): boolean; export function parseArgs(): parsedArg[]; interface parsedArg { ...
igorilic/portfolio
typings/tsd.d.ts
<reponame>igorilic/portfolio /// <reference path="express/express.d.ts" /> /// <reference path="jquery/jquery.d.ts" /> /// <reference path="mime/mime.d.ts" /> /// <reference path="node/node.d.ts" /> /// <reference path="serve-static/serve-static.d.ts" /> /// <reference path="angularjs/angular.d.ts" /> /// <reference pa...
rdeak/dockerize-express
src/server.ts
<gh_stars>0 import express, {Request, Response} from "express"; const app = express(); app.get("/", (req:Request, res:Response) => { res.send("Hello world"); }); app.get("/time", (req: Request, res:Response) => { res.send(`current time is ${new Date()}`); }); const PORT = process.env.PORT || 8080; app.listen(PORT, ...
sgtobin/HowMuch
ts_js/HowMuch/App.ts
window.onload = () => { var inputNumber: any = document.getElementById('number'); var howmuch: any = document.getElementById('howmuch'); inputNumber.addEventListener('input', () => { howmuch.innerText = new HowMuch().isThat(inputNumber.value); }); };
sgtobin/HowMuch
ts_js/HowMuch/HowMuchShould.ts
/// <reference path="scripts/typings/jasmine/jasmine.d.ts" /> /// <reference path="howmuch.ts" /> /// <reference path="digitgroup.ts" /> describe('HowMuchShould', () => { it('GetNumbersUnder20Correct', () => { expect(new HowMuch().isThat(0)).toBe("zero"); expect(new HowMuch().isThat(1)).toBe("one...
sgtobin/HowMuch
ts_js/HowMuch/HowMuch.ts
<filename>ts_js/HowMuch/HowMuch.ts class HowMuch { public isThat(number: number): string { if (number === 0) return "zero"; var digitGroups = DigitGroup.splitIntoDigitGroups(number); var digitGroupsInWords = this.processDigitGroups(digitGroups); return this.assembleDigitGroups(dig...
sgtobin/HowMuch
ts_js/HowMuch/DigitGroup.ts
<filename>ts_js/HowMuch/DigitGroup.ts class DigitGroup { private digitGroupAsNumber: number; public get asWords(): string { return this.processDigitGroup(); } constructor(private digitGroup: string) { this.digitGroupAsNumber = Number(digitGroup); } private processDigitGroup(...
carlosrodrigues94/desafio_07_fundamentos_react_js
src/utils/formatValue.ts
const formatValue = (value: number): string => { return Intl.NumberFormat([], { style: 'currency', currency: 'BRL', }).format(value); // TODO }; export default formatValue;
ssttevee/streamsearch
testing/fuzz.ts
import fs from 'fs'; import path from 'path'; import { ReadableStreamSearch } from '../src'; import { makeStream, cmp, BAD_INPUT_DIR } from './util'; function randomString(min: number, max: number): string { return Array.from( { length: min + Math.floor(Math.random() * (max - min)) }, () => String...
ssttevee/streamsearch
testing/util.ts
<filename>testing/util.ts import { stringToArray } from '@ssttevee/u8-utils'; export const BAD_INPUT_DIR = 'erroneous_input'; export function makeStream(strs: string[]): ReadableStream { let i = 0; return { getReader() { return { async read() { if (i < s...
ssttevee/streamsearch
src/search.ts
/* Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation by <NAME> at: https://github.com/FooBarWidget/boyer-moore-horspool */ import { stringToArray } from '@ssttevee/u8-utils'; type CharFunc = (index: number) => number; function coerce(a: Uint8Array | CharFunc): CharFunc { if (a instanceof...
ssttevee/streamsearch
src/index.ts
import { mergeArrays } from '@ssttevee/u8-utils'; import { StreamSearch, MATCH } from './search'; export function splitChunks(chunks: Uint8Array[], needle: Uint8Array | string): Uint8Array[] { const search = new StreamSearch(needle); const outchunks: Uint8Array[][] = [[]]; for (const chunk of chunk...
ssttevee/streamsearch
src/readable.test.ts
<filename>src/readable.test.ts import tape from 'tape-promise/tape'; import { makeStream } from '../testing/util'; import { ReadableStreamSearch } from './readable'; import { arrayToString } from '@ssttevee/u8-utils'; tape('readable', async function (t: tape.Test): Promise<void> { t.test('iterators', async functi...
ssttevee/streamsearch
src/index.test.ts
import tape from 'tape'; import { split } from './index'; import { stringToArray, arrayToString } from '@ssttevee/u8-utils'; const text = 'hello world foo bar'; tape('split', function(t: tape.Test): void { t.deepEqual( split(stringToArray(text), ' ').map(arrayToString), text.split(' '), ); ...
ssttevee/streamsearch
src/readable.ts
import { arrayToString, mergeArrays } from '@ssttevee/u8-utils'; import { StreamSearch, MATCH, Token } from './search'; export class ReadableStreamSearch { private _search: StreamSearch; public constructor(needle: Uint8Array | string, private _readableStream: ReadableStream<Uint8Array>) { this._search...
ssttevee/streamsearch
src/search.test.ts
<filename>src/search.test.ts import tape from 'tape'; import { arrayToString, stringToArray } from '@ssttevee/u8-utils'; import { StreamSearch, MATCH } from './search'; function test(t: tape.Test, needle: string, chunks: string[], expected: string[], lookbehind: string): void { const search = new StreamSearch(need...
Blockception/BC-Minecraft-Bedrock-Vanilla-Data
src/Lib/Vanilla/ResourcePack/entities.ts
<gh_stars>0 import { Entity } from '../../Types/ResourcePack/Entity'; export const Entities: Entity[] = [ { "id": "minecraft:armor_stand", "animations": [ "default_pose", "no_pose", "solemn_pose", "athena_pose", "brandish_pose", "honor_pose", "enterta...
Blockception/BC-Minecraft-Bedrock-Vanilla-Data
src/Lib/Types/BehaviorPack/BehaviorPack.ts
<filename>src/Lib/Types/BehaviorPack/BehaviorPack.ts import { Block } from "./Block"; import { Entity } from "./Entity"; import { Item } from "./Item"; import { LootTable } from "./LootTable"; import { Trading } from "./Trading"; /**The interface that stores vanilla behavior pack data*/ export interface BehaviorPack {...
Blockception/BC-Minecraft-Bedrock-Vanilla-Data
src/Lib/Vanilla/ResourcePack/textures.ts
<filename>src/Lib/Vanilla/ResourcePack/textures.ts<gh_stars>0 export const Textures: string[] = [ "textures/blocks/acacia_trapdoor", "textures/blocks/amethyst_block", "textures/blocks/amethyst_cluster", "textures/blocks/ancient_debris_side", "textures/blocks/ancient_debris_top", "textures/blocks/anvil_base...
Blockception/BC-Minecraft-Bedrock-Vanilla-Data
src/Lib/Edu/ResourcePack/animations.ts
export const Animations: string[] = []
Blockception/BC-Minecraft-Bedrock-Vanilla-Data
src/Lib/Vanilla/ResourcePack/animation_controllers.ts
export const AnimationControllers: string[] = [ "controller.animation.agent.move", "controller.animation.armor_stand.pose", "controller.animation.armor_stand.wiggle", "controller.animation.axolotl.general", "controller.animation.axolotl.move", "controller.animation.bat.move", "controller.animation.bee.dr...