repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
galak75/node-scripting
scripts/testing/testingScript.ts
import { Command, program as caporal } from '@caporal/core'; import { ScriptBase, TESTING_SCRIPT_NAME_PREFIX } from '../../src'; export interface Options { throwError?: boolean; port?: number; } export class TestingScript extends ScriptBase<Options> { get name(): string { return `${TESTING_SCRIPT_NAME_PREFI...
galak75/node-scripting
src/config/configs.ts
import { Program } from '@caporal/core'; import * as os from 'os'; import * as path from 'path'; export class Configs { /** * The library root. When this library is used * as a dependency in a project, the "libRoot" * will be the path to the dependency folder, * inside the "node_modules". */ public ...
galak75/node-scripting
src/scripts/testUnits.ts
import { Command, program } from '@caporal/core'; import * as _ from 'lodash'; import { configs } from '../config/configs'; import { CoreScriptBase } from '../coreScriptBase'; export interface Options { bail?: boolean; jenkins?: boolean; report?: string; } export class TestUnitsScript extends CoreScriptBase<Opt...
galak75/node-scripting
src/globalOptions.ts
<filename>src/globalOptions.ts /** * Global Options interface. Those are always possible, for any script. * * Most of them are provided out-of-the-box by Caporal. */ export interface IGlobalOptions { silent?: boolean; v?: boolean; verbose?: boolean; quiet?: boolean; color?: boolean; // "no-color" becomes ...
galak75/node-scripting
src/scripts/prettierFix.ts
import { configs } from '../config/configs'; import { CoreLintScriptBase } from '../coreLintScriptBase'; export class PrettierFixScript extends CoreLintScriptBase { get name(): string { return 'prettier-fix'; } get description(): string { return `Fix the project formating using the Prettier rules.`; }...
galak75/node-scripting
src/scripts/showCoverage.ts
<reponame>galak75/node-scripting<filename>src/scripts/showCoverage.ts<gh_stars>0 import { Command, program } from '@caporal/core'; import * as path from 'path'; import { configs } from '../config/configs'; import { ScriptBase } from '../scriptBase'; export interface Options { report?: string; } export class ShowCov...
galak75/node-scripting
src/coreScriptBase.ts
import { ParsedArgumentsObject } from '@caporal/core'; import { IGlobalOptions } from './globalOptions'; import { ScriptBase } from './scriptBase'; /** * Base class for a core Script. */ export abstract class CoreScriptBase< O = {}, GO extends IGlobalOptions = IGlobalOptions, A extends ParsedArgumentsObject = ...
Sariohara/ublacklist
src/scripts/options/sync-section.tsx
import dayjs from 'dayjs'; import dayjsDuration from 'dayjs/plugin/duration'; import React, { useEffect, useState } from 'react'; import { apis } from '../apis'; import { Button, LinkButton } from '../components/button'; import { CheckBox } from '../components/checkbox'; import { FOCUS_END_CLASS, FOCUS_START_CLASS } fr...
ChicagoTechSlack/chicagotech-slack-inviter
pages/index.tsx
import React from "react"; const App = () => { // Forward to the Shared Slack Invite Link const inviteLink = process.env.SLACK_INVITE_LINK; const refreshContentAttr = `0;url=${inviteLink}`; return <meta httpEquiv="refresh" content={refreshContentAttr} />; }; export default App;
ChicagoTechSlack/chicagotech-slack-inviter
pages/guysbotReminder.tsx
const GuysbotReminder = () => { return ( <img src="/assets/CONFIRMED_SHARED_WITH_QWALL.png" alt="Guysbot Reminder" /> ); }; export default GuysbotReminder;
newoceaninfosys/ng2-breadcrumb
ngx-breadcrumb.ts
export {NgXBreadcrumbModule} from './app/app.module'; export {BreadcrumbComponent} from './app/components/breadcrumb'; export {BreadcrumbService} from './app/components/breadcrumbService';
newoceaninfosys/ng2-breadcrumb
app/components/breadcrumb.ts
<reponame>newoceaninfosys/ng2-breadcrumb import {Component, Input, OnInit, OnChanges} from '@angular/core'; import {Router, NavigationEnd} from '@angular/router'; import {BreadcrumbService} from './breadcrumbService'; /** * This component shows a breadcrumb trail for available routes the router can navigate to. * It...
newoceaninfosys/ng2-breadcrumb
demo/app.module.ts
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { Component1, Component2, Component3, Component4 } from './app.component'; import { routing, appRoutingProviders } from './app.routing'; import { NgXBreadcru...
newoceaninfosys/ng2-breadcrumb
demo/app.component.ts
<filename>demo/app.component.ts import {Component} from '@angular/core'; import {Router} from '@angular/router'; import {BreadcrumbService} from '../app/app.module'; @Component({ selector: 'app', template: ` <div class="container"> <h1>Breadcrumb Example</h1> <breadcrumb></bread...
Nijooke/create-react-app
packages/cra-template/template/src/App.tsx
<reponame>Nijooke/create-react-app import React from 'react'; import logo from './logo.svg'; import styles from './styles'; const App: React.FC = () => { return ( <div css={styles.app}> <header css={styles.appHeader}> <img src={logo} css={styles.appLogo} alt="logo" /> <p> Edit <co...
Nijooke/create-react-app
packages/cra-template/template/src/styles.ts
<gh_stars>0 import { css, keyframes } from '@emotion/core'; export const app = css` text-align: center; `; export const appLogoSpin = keyframes` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `; export const appLogo = css` animation: ${appLogoSpin} infinite 20s linear; heig...
hickdevil/class-app
src/classes/entities/classes.entity.ts
<reponame>hickdevil/class-app import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; export type ClassesDocument = IClass & Document; @Schema() export class IClass { @Prop({ required: true, unique: true, index: true }) name: string; @Prop({ required: true, index: t...
hickdevil/class-app
src/classes/classes.module.ts
<filename>src/classes/classes.module.ts import { Module } from '@nestjs/common'; import { MongooseModule } from '@nestjs/mongoose'; import { StudentsModule } from 'src/students/students.module'; import { TeachersModule } from 'src/teachers/teachers.module'; import { ClassesController } from './classes.controller'; impo...
hickdevil/class-app
src/students/students.module.ts
<reponame>hickdevil/class-app<filename>src/students/students.module.ts<gh_stars>0 import { Module } from '@nestjs/common'; import { MongooseModule } from '@nestjs/mongoose'; import { Student, StudentsSchema } from './entities/students.entity'; import { StudentsController } from './students.controller'; import { Student...
hickdevil/class-app
src/students/students.service.ts
<filename>src/students/students.service.ts import { Injectable } from '@nestjs/common'; import { Student, StudentsDocument } from './entities/students.entity'; import { Model } from 'mongoose'; import { InjectModel } from '@nestjs/mongoose'; import { CreateStudentDto } from './dto/create-student.dto'; @Injectable() exp...
hickdevil/class-app
src/classes/dto/create-class.dto.ts
import { PartialType } from '@nestjs/mapped-types'; import { IsNotEmpty, IsString, IsArray } from 'class-validator'; export class CreateClassDto { @IsString() @IsNotEmpty() name: string; @IsString() @IsNotEmpty() subject: string; @IsArray() students: string[]; @IsString() teacher: string; } exp...
hickdevil/class-app
src/teachers/teachers.service.ts
import { Injectable } from '@nestjs/common'; import { Model } from 'mongoose'; import { Teacher, TeachersDocument } from './entities/teachers.entity'; import { InjectModel } from '@nestjs/mongoose'; import { CreateTeacherDto } from './dto/create-teacher.dto'; @Injectable() export class TeachersService { constructor(...
hickdevil/class-app
src/students/entities/students.entity.ts
<filename>src/students/entities/students.entity.ts import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; export type StudentsDocument = Student & Document; @Schema() export class Student { @Prop({ required: true, unique: true, index: true }) name: string; @Prop({ ...
hickdevil/class-app
src/classes/classes.controller.ts
<reponame>hickdevil/class-app import { Body, Controller, Get, Param, Post } from '@nestjs/common'; import { ClassesService } from './classes.service'; import { CreateClassDto } from './dto/create-class.dto'; @Controller('classes') export class ClassesController { constructor(private readonly classesService: ClassesS...
hickdevil/class-app
src/teachers/teachers.controller.ts
<gh_stars>0 import { Body, Controller, Get, Param, Post } from '@nestjs/common'; import { CreateTeacherDto } from './dto/create-teacher.dto'; import { TeachersService } from './teachers.service'; @Controller('teachers') export class TeachersController { constructor(private readonly teachersServices: TeachersService)...
hickdevil/class-app
src/students/students.controller.ts
<filename>src/students/students.controller.ts import { Controller, Post, Body, Param, Get } from '@nestjs/common'; import { CreateStudentDto } from './dto/create-student.dto'; import { StudentsService } from './students.service'; @Controller('students') export class StudentsController { constructor(private readonly ...
hickdevil/class-app
src/students/dto/create-student.dto.ts
<reponame>hickdevil/class-app<gh_stars>0 import { PartialType } from '@nestjs/mapped-types'; import { IsEmail, IsNotEmpty, IsString } from 'class-validator'; export class CreateStudentDto { @IsString() @IsNotEmpty() name: string; @IsString() @IsNotEmpty() @IsEmail() email: string; @IsString() @IsNo...
hickdevil/class-app
src/classes/classes.service.ts
<reponame>hickdevil/class-app import { Injectable } from '@nestjs/common'; import { Model } from 'mongoose'; import { InjectModel } from '@nestjs/mongoose'; import { ClassesDocument, IClass } from './entities/classes.entity'; import { CreateClassDto } from './dto/create-class.dto'; import { StudentsService } from 'src/...
hickdevil/class-app
src/teachers/dto/create-teacher.dto.ts
import { PartialType } from '@nestjs/mapped-types'; import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; export class CreateTeacherDto { @IsString() @IsNotEmpty() name: string; @IsString() @IsOptional() subject?: string[]; } export class UpdateTeacherDto extends PartialType(CreateTeacherDt...
snowplow-incubator/web-video-tracking-examples
src/components/players/videojs.tsx
import React from 'react'; import 'video.js/dist/video-js.css'; import { enableMediaTracking } from '@snowplow/browser-plugin-media-tracking'; import VideoJsPlayer from './videojs-setup'; interface IProps {} interface IState { videoJsOptions: any; } export default class VideoJS extends React.Component<IProps, ISt...
snowplow-incubator/web-video-tracking-examples
src/components/players/html5-audio.tsx
<reponame>snowplow-incubator/web-video-tracking-examples import React from 'react'; import { enableMediaTracking } from '@snowplow/browser-plugin-media-tracking'; interface IProps { } interface IState { tracking: any; } export default class HTML5Audio extends React.Component<IProps, IState> { componentDidMount() ...
snowplow-incubator/web-video-tracking-examples
src/App.tsx
import { newTracker } from '@snowplow/browser-tracker'; import React from 'react'; import './App.css'; import HTML5Audio from './components/players/html5-audio'; import HTML5Video from './components/players/html5-video'; import Plyr from './components/players/plyr'; import VideoJs from './components/players/videojs'; ...
snowplow-incubator/web-video-tracking-examples
src/components/players/html5-video.tsx
import React from 'react'; import { enableMediaTracking } from '@snowplow/browser-plugin-media-tracking'; interface IProps { } interface IState {} export default class HTML5Video extends React.Component<IProps, IState> { componentDidMount() { enableMediaTracking({ id: 'html5', options: { bo...
snowplow-incubator/web-video-tracking-examples
src/components/players/plyr.tsx
<reponame>snowplow-incubator/web-video-tracking-examples import Plyr from 'plyr'; import React from 'react'; import { enableMediaTracking } from '@snowplow/browser-plugin-media-tracking'; interface IProps {} interface IState { plyrSource: any; } export default class PlyrVideo extends React.Component<IProps, IState...
snowplow-incubator/web-video-tracking-examples
src/components/players/youtube.tsx
import React from 'react'; interface IProps {} interface IState {} export default class Youtube extends React.Component<IProps, IState> { /* componentDidMount() { enableYoutubeTracking({ id: 'youtube', trackingOptions: { mediaLabel: 'Youtube', }, }); } */ render() { re...
stackedq/web
src/plugins/cosmos/components/modals/GetStarted/views/LearnMore.tsx
<reponame>stackedq/web<filename>src/plugins/cosmos/components/modals/GetStarted/views/LearnMore.tsx import { ArrowBackIcon } from '@chakra-ui/icons' import { Box, Flex } from '@chakra-ui/layout' import { Button, IconButton } from '@chakra-ui/react' import { useSteps } from 'chakra-ui-steps' import { DefiModalHeader } f...
stackedq/web
src/components/StakingVaults/EarnOpportunityRow.tsx
import { Box, HStack } from '@chakra-ui/layout' import { Popover, PopoverTrigger, Skeleton, SkeletonCircle, SkeletonText, Stack, Td, Tr, useMediaQuery } from '@chakra-ui/react' import { Tag } from '@chakra-ui/tag' import { caip19 } from '@shapeshiftoss/caip' import { SupportedYearnVault, YearnVault } ...
fongelias/albus-fe
src/components/presentational/FlexBox/FlexBox.tsx
<reponame>fongelias/albus-fe import React from 'react'; import cx from 'classnames'; import styles from './FlexBox.module.scss'; type FlexDirection = 'row-reverse' | 'column' | 'column-reverse'; type FlexWrap = 'wrap' | 'wrap-reverse'; type FlexJustify = 'end' | 'center' | 'space-b...
Treast/screeps
src/models/Unit.ts
<reponame>Treast/screeps import { Constant } from '../config/constants'; import { Config } from '../config/config'; import { Storage } from '../models/Storage'; export class Unit { public readonly name: string; private creep: Creep; private role: number; public constructor(name: string) { thi...
Treast/screeps
src/types.d.ts
// type shim for nodejs' `require()` syntax declare const require: (module: string) => any; interface CreepMemory { role: number; working?: boolean; } interface Role { code: number; name: string; count: number; body: BodyPartConstant[]; } interface Config { roles: Role[]; spawn: strin...
Treast/screeps
src/config/config.ts
<reponame>Treast/screeps<filename>src/config/config.ts import { Constant } from './constants'; export const Config : Config = { spawn: 'Spawn1', roles: [ { code: Constant.ROLE_BUILDER, name: "Builder", count: 3, body: [WORK, WORK, MOVE, MOVE, CARRY] ...
Treast/screeps
src/main.ts
import { ErrorMapper } from "utils/ErrorMapper"; import { UnitManager } from "managers/unit.manager"; import { Storage } from "models/Storage"; // When compiling TS to JS and bundling with rollup, the line numbers and file names in error messages change // This utility uses source maps to get the line numbers and file...
Treast/screeps
src/models/Storage.ts
<reponame>Treast/screeps type StorageType = StructureContainer | StructureSpawn | StructureExtension; export class Storage { private static storages: Structure[]; public static initialize() { Storage.storages = _.filter(Game.structures, (structure) => { return structure.structureType == S...
Treast/screeps
src/managers/unit.manager.ts
<filename>src/managers/unit.manager.ts import { Unit } from '../models/Unit'; import { Config } from '../config/config'; export class UnitManager { private units: Unit[]; private spawn: StructureSpawn; public constructor() { this.units = []; this.spawn = Game.spawns[Config.spawn]; } ...
Treast/screeps
src/config/constants.ts
<reponame>Treast/screeps export const Constant = { ROLE_HARVESTER: 0, ROLE_UPGRADER: 1, ROLE_BUILDER: 2 };
flarebyte/oak-cloud-function-test
src/obj-path-utils.ts
import { ObjectValue, AdvancedObject } from './obj-tranf-model'; export const findFieldValue = (path: string, value: AdvancedObject): ObjectValue => { const [first, ...rest] = path.split('.'); const objValue: { [name: string]: ObjectValue } = value; const second = objValue[first]; if (rest.length === 0 || type...
flarebyte/oak-cloud-function-test
src/version.ts
export const version = '0.2.0';
flarebyte/oak-cloud-function-test
test/storage/version.ts
<gh_stars>0 export const version = '2.32.14';
flarebyte/oak-cloud-function-test
src/context-utils.ts
<reponame>flarebyte/oak-cloud-function-test import { OakEngineContext } from './model'; export const createEmptyContext = (): OakEngineContext => ({ transactions: [], actionTransactions: [], systemFlags: [], businessOperationFlags: {}, actionFlags: {}, functionFlags: {}, });
flarebyte/oak-cloud-function-test
src/obj-mutator.ts
import { transformFieldValue } from './obj-path-utils'; import { OakObjApplicableMutation, OakObjFieldMutation, ObjectValue, AdvancedObject, } from './obj-tranf-model'; const unusualChar = '🤢'; const identityRule: OakObjFieldMutation = { name: 'identity', fieldKind: 'any', rule: (value: ObjectValue) =>...
flarebyte/oak-cloud-function-test
src/flag-utils.ts
import { OakStatus } from './model'; import { statusFlagDict } from './status-data'; import { findStatusByNameInDict } from './status-utils'; const responseStatusFlag = 'response:status='; const flagStartsWith = (text: string) => (flag: string) => flag.startsWith(text); const createFailedStatus = (name: string): O...
flarebyte/oak-cloud-function-test
src/simulator.ts
import { strict as assert } from 'assert'; import { mergeActionCompanions, mergeFunctionCompanions, OakFunctionCompanionBuilder, transformActionCompanion, transformFunctionCompanion, } from './companion-utils'; import { createEmptyContext } from './context-utils'; import { updateReturnStatus } from './flag-ut...
flarebyte/oak-cloud-function-test
src/status-data.ts
import { OakStatus } from './model'; export const statusFlagDict = { success: 'success', failure: 'failure', invalid: 'invalid', }; const ok: OakStatus = { name: 'ok', description: 'The request has succeeded', flags: [statusFlagDict.success], }; const found: OakStatus = { name: 'found', description: ...
flarebyte/oak-cloud-function-test
src/companion-utils.ts
<filename>src/companion-utils.ts import { OakAction, OakActionCall, OakActionCallWrapper, OakActionCompanion, OakActionCtxCall, OakActionRequestEvent, OakActionToCall, OakCall, OakCallWrapper, OakCtxCall, OakEngineContext, OakFunctionCompanion, OakRequestEvent, OakServiceOperation, OakServ...
flarebyte/oak-cloud-function-test
test/simulator.test.ts
<filename>test/simulator.test.ts<gh_stars>0 describe('Simulator', () => { it.todo('can shortcut an action with status response'); it.todo('can shortcut a function with status response'); it.todo('can replay an action'); it.todo('can replay a cloud function'); it.todo('can iterate alternative to the happy path...
flarebyte/oak-cloud-function-test
src/actor-data.ts
import { OakAction, OakFunction } from './model'; import { version } from './version'; const template = { version, flags: [], customStatusDict: {}, systemFlagsDict: {}, }; export const beforeEachAction: OakAction = { ...template, name: 'oak-cloud-function-test/action/before-each', functionName: 'beforeE...
flarebyte/oak-cloud-function-test
src/map-red.ts
<filename>src/map-red.ts import { OakBase, OakEventTransaction } from './model'; export const isSameName = (a: OakBase, b: OakBase) => a.name === b.name; export const sortedTxByIdDesc = ( a: OakEventTransaction, b: OakEventTransaction ): number => { if (a.id === b.id) return 0; if (a.id > b.id) return -1; r...
flarebyte/oak-cloud-function-test
src/obj-tranf-model.ts
export type FieldPrimitive = | null | undefined | string | number | boolean | symbol | bigint | Function; export type AdvancedObject = { [Key in string]?: ObjectValue }; export type ObjectArray = ObjectValue[]; export type ObjectValue = FieldPrimitive | AdvancedObject | ObjectArray; export interface ...
flarebyte/oak-cloud-function-test
src/experiment.ts
import { OakActionAndRequest } from './model'; import { OakSimulator } from './simulator'; import { OakActionExperiment } from './simulator-model'; export class OakExperiment { simulator: OakSimulator; actionAndrequests: OakActionAndRequest[]; actionExperiment: OakActionExperiment[]; constructor() { this....
flarebyte/oak-cloud-function-test
test/aggregate/alpha-aggregate-action.ts
import { OakActionCall, OakActionCompanion, OakActionRequestEvent, OakEngineContext, } from '../../src/model'; import { bizOperationObj } from '../fixture-business-operation'; import { createS1Params } from '../storage/s1-storage-factory'; import { AggregateTask, AlphaAggregateParams, CityPayload, } from ...
flarebyte/oak-cloud-function-test
test/storage/s1-storage-model.ts
export interface S1StorageParams { path: string; }
flarebyte/oak-cloud-function-test
src/request-utils.ts
<gh_stars>0 import { OakAction, OakActionRequestEvent, OakBusinessOperation, OakFunction, OakRequestEvent, } from './model'; interface OakRequestEventSimpleParams<V, P> { businessOperation: OakBusinessOperation; comment: string; serviceParams: V; payload: P; callerAction: OakAction; } export funct...
flarebyte/oak-cloud-function-test
test/aggregate/version.ts
export const version = '1.12.14';
flarebyte/oak-cloud-function-test
test/storage/s1-data.ts
import { OakService, OakServiceData, OakServiceOperation, OakStatus, } from '../../src/model'; import { version } from './version'; const service: OakService = { name: 'company:s1', description: 'Cloud storage', flags: [], }; const circuitBreaking: OakStatus = { name: 'circuit-breaking', descriptio...
flarebyte/oak-cloud-function-test
test/storage/s1-storage-dev.test.ts
<reponame>flarebyte/oak-cloud-function-test<gh_stars>0 import { OakRequestEvent } from '../../src/model'; import { bizOperationObj } from '../fixture-business-operation'; import { s1DevCompanion } from './s1-storage-dev'; import { createS1Params } from './s1-storage-factory'; import { OakSimulator } from '../../src/sim...
flarebyte/oak-cloud-function-test
test/storage/s1-storage-dev.ts
import { OakActionCompanion, OakCall, OakEngineContext, OakRequestEvent, OakResponseEvent, } from '../../src/model'; import { isSameName, sortedTxByIdDesc } from '../../src/map-red'; import { coS1 } from './s1-data'; import { validateParams } from './s1-storage-validator'; import { buildActionCompanion } from...
flarebyte/oak-cloud-function-test
src/status-utils.ts
import { OakStatus } from './model'; import { statusFlagDict } from './status-data'; export const isStatusEqual = ( expected: OakStatus, actual: OakStatus ): boolean => actual.name === expected.name; export const isSuccessfulStatus = (actual: OakStatus): boolean => actual.flags.includes(statusFlagDict.success);...
flarebyte/oak-cloud-function-test
test/aggregate/alpha-aggregate-action.test.ts
<gh_stars>0 import { OakSimulator } from '../../src/simulator'; import { bizOperationObj } from '../fixture-business-operation'; import { s1DevCompanion } from '../storage/s1-storage-dev'; import { createS1Params } from '../storage/s1-storage-factory'; import { aggregateCompanion } from './alpha-aggregate-action'; impo...
flarebyte/oak-cloud-function-test
test/fixture-business-operation.ts
import { OakBusinessOperation } from '../src/model'; import { resourceObj } from './fixture-resource'; const writeLondonData: OakBusinessOperation = { name: 'write-to-london', description: 'Write London data to storage', flags: [], resource: resourceObj.s3London, }; const writeParisData: OakBusinessOperation ...
flarebyte/oak-cloud-function-test
src/obj-abstractor.ts
import { OakObjAbstracted, OakObjAbstractionRule, ObjectValue, AdvancedObject } from './obj-tranf-model'; const someUrl: OakObjAbstractionRule = (value: string) => value.startsWith('http://') || value.startsWith('https://') ? 'url' : ''; export const anyOfString = (name: string, options: string[]) => (value: strin...
flarebyte/oak-cloud-function-test
src/simulator-summarizer.ts
<filename>src/simulator-summarizer.ts import { OakActionEventTransaction, OakEventTransaction } from './model'; import { OakActionTx, OakSimServiceOpTx, OakSimServiceOpTxPerf, } from './simulator-model'; export const summarizeServiceOpTransaction = ( event: OakEventTransaction ): OakSimServiceOpTx => ({ id: ...
flarebyte/oak-cloud-function-test
test/storage/s1-storage-validator.ts
<reponame>flarebyte/oak-cloud-function-test export const validateParams = (value: object): string[] => { return Object(value).hasOwnProperty('path') ? [] : ['Missing path']; };
flarebyte/oak-cloud-function-test
src/obj-utils.ts
export function cloneValue<A>(value: A): A { const jsonStr = JSON.stringify(value); const result: A = JSON.parse(jsonStr); return result; }
flarebyte/oak-cloud-function-test
test/fixture-resource.ts
import { OakResource } from '../src/model'; const s3London: OakResource = { name: 's3:london', description: 'Bucket for London', flags: [], }; const s3Paris: OakResource = { name: 's3:paris', description: 'Bucket for Paris', flags: [], }; const s3Europe: OakResource = { name: 's3:europe', description...
flarebyte/oak-cloud-function-test
test/obj-utils.test.ts
describe('Object Utils', () => { it.todo('clone'); });
flarebyte/oak-cloud-function-test
src/simulator-model.ts
<reponame>flarebyte/oak-cloud-function-test<gh_stars>0 import { OakActionAndRequest } from './model'; export interface OakSimServiceOpTx { id: number; businessOperationName: string; serviceOperationName: string; serviceName: string; resourceName: string; caller: string; serviceParams: object; systemFla...
flarebyte/oak-cloud-function-test
test/aggregate/alpha-aggregate-data.ts
<filename>test/aggregate/alpha-aggregate-data.ts import { OakAction } from '../../src/model'; import { version } from './version'; const aggregateDataAction: OakAction = { name: 'alpha-aggregate-europe', functionName: 'aggregateData', version, description: 'Aggregate european data', flags: [], customStatus...
flarebyte/oak-cloud-function-test
test/aggregate/alpha-aggregate-model.ts
export enum AggregateTask { Sum, Merge, } export interface AlphaAggregateParams { task: AggregateTask; } export interface CityPayload { data: number[]; }
flarebyte/oak-cloud-function-test
test/storage/s1-storage-factory.ts
<filename>test/storage/s1-storage-factory.ts import { S1StorageParams } from './s1-storage-model'; export const createS1Params = (path: string): S1StorageParams => ({ path, });
flarebyte/oak-cloud-function-test
src/interceptor.ts
<reponame>flarebyte/oak-cloud-function-test import { shouldReturnStatus } from './flag-utils'; import { OakBeforeCallInterceptor, OakEngineContext, OakRequestEvent, OakResponseEvent, OakServiceOperation, OakStatus, } from './model'; import { statusDict } from './status-data'; const { internalServiceError } ...
flarebyte/oak-cloud-function-test
src/perf.ts
import { hrtime } from 'process'; export const measureTime = () => { const started = hrtime.bigint(); return () => { const finished = hrtime.bigint(); const delta = finished - started; return delta.toString(); }; };
flarebyte/oak-cloud-function-test
src/model.ts
export interface OakBase { name: string; description: string; flags: string[]; } /** * Metadata about a status that a function or cloud service would return */ export type OakStatus = OakBase; /** * Metadata about a cloud service * @example aws:s3 */ export type OakService = OakBase; /** * Metadata about...
flarebyte/oak-cloud-function-test
test/obj-mutator.test.ts
<filename>test/obj-mutator.test.ts import { mutateObject, mutatorRules } from '../src/obj-mutator'; describe('Object Mutator', () => { describe('mutateObject', () => { it('mutate an object with one rule', () => { const mutation = { path: 'name', kind: 'string', mutationName: 'string...
mohammedzamakhan/ng2-redux
examples/counter/actions/CounterActions.ts
<gh_stars>0 export const INCREMENT_COUNTER:string = 'INCREMENT_COUNTER'; export const DECREMENT_COUNTER:string = 'DECREMENT_COUNTER'; export var increment = () => { return { type: INCREMENT_COUNTER }; } export var decrement = () => { return { type: DECREMENT_COUNTER }; } export var incrementIfOdd = (...
mohammedzamakhan/ng2-redux
examples/counter/containers/App.ts
<filename>examples/counter/containers/App.ts import {Component, Inject, OnDestroy} from 'angular2/core'; import {bindActionCreators} from 'redux'; import {Counter} from '../components/Counter'; import * as CounterActions from '../actions/CounterActions'; @Component({ selector: 'root', directives: [Counter], temp...
mohammedzamakhan/ng2-redux
examples/counter/store/configureStore.ts
<reponame>mohammedzamakhan/ng2-redux<gh_stars>0 import {createStore, applyMiddleware, compose} from 'redux'; const thunk = require('redux-thunk'); import reducer from '../reducers/index'; const devTools = require('redux-devTools').devTools; const finalCreateStore = compose( applyMiddleware(thunk), devTools() )(cre...
mohammedzamakhan/ng2-redux
examples/counter/typings/tsd.d.ts
/// <reference path="_custom/custom.d.ts" /> /// <reference path="redux/redux.d.ts" />
Phoeon/free-ui
src/data/modal.ts
export const c1=`FModal.alert({ title:"欢迎!", content:"北京欢迎您!" }) ` export const c2=`FModal.confirm({ title:"操作失败", content:"账号密码不一致,是否重试?", cancelText:"关闭", doneText:"重试" }).done((status:number)=>{ if(status) FToast.success("确认事件") else FToast.error("取消事件") })` export const c3=`cons...
Phoeon/free-ui
src/components/form/validator/built-in-validators.ts
import { isEmpty , Reg } from '../../../shared/utils' export function required(v:unknown,args:any,next:()=>void,reject:(d?:any)=>void){ if(!isEmpty(v))next() else reject({ valid:false, tip:"该字段不可为空" }) } export function number(v:unknown,args:any,next:()=>void,reject:(d?:any)=>void){ con...
Phoeon/free-ui
src/data/progress.ts
export const c1=`<f-progress-bar :max="100" :value="0"></f-progress-bar> <f-progress-bar :max="100" :value="10" type="warning"></f-progress-bar> <f-progress-bar :max="100" :value="20" type="danger"></f-progress-bar> <f-progress-bar :max="100" :value="30"></f-progress-bar> <f-progress-bar :max="100" :value="40" :striped...
Phoeon/free-ui
src/data/message.ts
<reponame>Phoeon/free-ui<gh_stars>0 export const c1=` type IMsgType = 'success'|'error'|'warning'|'info' type IMsgOption = { type?:IMsgType, position?:'top'|'bottom', icon?:string, iconColor?:string, autoClose?:boolean, clickClose?:boolean } interface IResult{ click(fn), close(fn) } inte...
Phoeon/free-ui
src/components/drawer/index.ts
<gh_stars>0 import FDrawer from './main.vue' export { FDrawer }
Phoeon/free-ui
src/components/notification/index.ts
import Evt from 'ph-evt' import NotificationMnger from './main.vue' import Env from '../../shared/env' import { INotifyOption } from '../../shared/types' import { CloseStatus } from './types' import { createApp, nextTick } from 'vue' let mnger:InstanceType<typeof NotificationMnger>; const notify =(content:string,opt?:I...
Phoeon/free-ui
src/components/menu/index.ts
<gh_stars>0 import FMenuTree from './tree/tree-root.vue' export { FMenuTree }
Phoeon/free-ui
src/components/pop/index.ts
import FPopConfirm from './confirm.vue' import FPopover from './over.vue' import FTooltip from './tooltip.vue' import FDropdownList from './dropdown.vue' import FPopSelect from './select.vue' import FPopContainer from './base.vue' import FTreeSelect from './tree-select.vue' import FCascadeSelect from './cascade-select....
Phoeon/free-ui
src/shared/utils.ts
<reponame>Phoeon/free-ui<filename>src/shared/utils.ts<gh_stars>0 import { App } from 'vue' import { Position } from './config' export const Reg={ email:/^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-z]{2,}$/, url:/https?:\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/, mobi...
Phoeon/free-ui
src/directives/index.ts
import vPopconfirm from './popconfirm' import vPopover from './popover' import vTooltip from './tooltip' export { vPopconfirm,vPopover,vTooltip }
Phoeon/free-ui
src/data/form.ts
export const c1=`<f-form title="表单标题" :xl="2"> <f-validator ref="evalidator"> <f-form-input v-model="formData.account" label="输入框" :validators="['required']"></f-form-input> <f-form-input v-model="formData.psd" label="密码域" placeholder="测试密码域" :validators="['required']" type="password"></f-form-input> <f-for...
Phoeon/free-ui
src/components/tabs/main.ts
<filename>src/components/tabs/main.ts import './main.scss' import { h, ref, toRef, provide } from 'vue' import { ITab } from '../../shared/types' import TabsNav from './nav.vue' import TabsPanel from './panel.vue' export default { components:{ TabsNav, TabsPanel }, props:{ modelValue...
Phoeon/free-ui
src/directives/toggle-height.ts
<filename>src/directives/toggle-height.ts<gh_stars>0 interface Binding{ [k:string]: any } const cla = 'ph-height-anim' export default { beforeMount(el:HTMLElement,binding:Binding):void{ el.addEventListener("transitionend",binding.dir.transitionend) }, mounted(el:HTMLElement,binding:Binding):void{ if(!binding...