blob_id large_stringlengths 40 40 | language large_stringclasses 1
value | repo_name large_stringlengths 5 119 | path large_stringlengths 4 271 | score float64 2.52 4.84 | int_score int64 3 5 | text stringlengths 26 4.09M |
|---|---|---|---|---|---|---|
6beb209d92f78b15a522c143a1e4525d2a78e1a1 | TypeScript | keyur2714/E_7_Angular_8 | /DirectiveDemo/src/app/directives/my-directive.ts | 2.515625 | 3 | import { Directive, OnInit, ElementRef, Input } from '@angular/core';
@Directive({
selector : '[app-my-directive]'
})
export class MyDirective implements OnInit{
@Input()
color : string = 'orange';
constructor(private elementRef : ElementRef){
console.log("App My Directive Object Created...!");... |
e273b8d9dc4a665374a33b76feacc47d713e996f | TypeScript | Nemog17/today | /packages/shared/utils/uuid.ts | 2.859375 | 3 | function uuid(): string {
function generate(char: string): string {
const r = (Math.random() * 16) | 0;
return (char === 'x' ? r : (r & 0x3) | 0x8).toString(16);
}
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, generate);
}
export default uuid;
|
5adeeed1948c4c8c391369f0941c3cfc6a4258f4 | TypeScript | bitclave/base-client-js | /src/repository/source/http/SignInterceptor.ts | 2.5625 | 3 | import { MessageSigner } from '../../../utils/keypair/MessageSigner';
import { HttpInterceptor } from './HttpInterceptor';
import { InterceptorCortege } from './InterceptorCortege';
import SignedRequest from './SignedRequest';
export enum ExcludeSignatureType {
EXCLUDE_SIG = 'EXCLUDE_SIG',
EXCLUDE_WRAPPER = 'E... |
5adcb796aa848946ffd636243a97ed315f774f1a | TypeScript | pytime-osu/web | /src/store/types.ts | 2.609375 | 3 | export const UPDATE_SEARCH = 'UPDATE_SEARCH';
interface UpdateSearchAction {
type: typeof UPDATE_SEARCH
terms: string[]
}
export type ActionTypes = UpdateSearchAction;
export interface RootState {
searchTerms: string[];
}
|
84e480f752e25d4dbc6811fcca5548b487242fdb | TypeScript | landrito/pandemic-dot-cards | /src/components/setup-pandemic/reducer.ts | 2.59375 | 3 | import { chooseInfectionCard } from './actions/choose-infection-cards';
import { chooseMonth } from './actions/choose-month';
import { chooseMonthPhase } from './actions/choose-month-phase';
import { nextStep } from './actions/next-step';
import { previousStep } from './actions/previous-step';
import { BASE_SETUP_STATE... |
acdf9a7c144f39f2d33e98f74995a77064a57afb | TypeScript | Raz1990/Chat_React_Redux_SQL | /src/Redux/reducers.ts | 2.625 | 3 | import {AnyAction} from "redux";
import {AppState} from "./../Interfaces/appState";
import {User} from "../Classess/User";
import {Group} from "../Classess/Group";
import ICanChat from "../Interfaces/ChatEntity";
const handlers = {
"SET_CURRENT_USER": setCurrentUser,
"SET_ALL_USERS": setAllUsers,
"SET_ALL_... |
34a905ba219f64ace5d6885f270536fa5d6be13c | TypeScript | burlistic/perth-code-dojo-3-garden | /Garden/TypeScriptHTMLApp1/modernLowMaintenanceGarden.ts | 2.640625 | 3 | /// <reference path="Garden.ts" />
class ModernLowMaintenanceGarden extends Garden
{
artificialLawns: ArtificialLawn[];
constructor(width: number, height: number, soilType: string, lastWatered: string) {
super(width, height, soilType, lastWatered);
this.artificialLawns = new Array<A... |
f139b2257ae80f78d1be8c8e1889d68711add877 | TypeScript | shivetay/react_typescript | /src/redux/Actions.ts | 2.5625 | 3 | import { ActionType } from './ActionTypes';
interface SearchReposAction {
type: ActionType.SEARCH_REPO;
}
interface SearchRepoActionSuccess {
type: ActionType.SEARCH_REPO_SUCCESS;
payload: string[];
}
interface SearchReposActionError {
type: ActionType.SEARCH_REPO_ERROR;
payload: string;
}
export type Actio... |
b8d958ee5a9ceb0643ed6f6a349c9c6dd94f6933 | TypeScript | uedsonreis/ionic_react_todo_list | /src/domain/todo.list.ts | 3.09375 | 3 | import { Task } from './task';
export const CREATE = 'CREATE';
export const UPDATE = 'UPDATE';
export const DELETE = 'DELETE';
type Action = { type: string, payload: Task };
export const creators = {
createCreate: (task: Task) => ({ type: CREATE, payload: task }),
createUpdate: (task: Task) => ({ type: UPDAT... |
65add42f99d282be8735984f298def8eb6222e8e | TypeScript | NeedsSoySauce/Random-Bookmark | /src/storage.ts | 2.71875 | 3 | import { AnyValue, BookmarkSelectionMethod, HistoryRetentionPeriod, IconStyle } from './types.js';
export interface HistoryItem {
date: string;
url: string;
title: string;
}
export interface SyncStorageState {
includeSubfolders: boolean;
openInNewTab: boolean;
reuseTab: boolean;
selectionM... |
990e29bf8758974b5a319dc7401d8c5b1054ce7c | TypeScript | banjankri/angular-webpack2-starter | /src/app/features/lazy/lazy.reducer.ts | 2.75 | 3 | import { Store, ActionReducer, Action } from '@ngrx/store';
import { AppState, createNewRootReducer } from './../../reducers';
import { LazyActions } from './lazy.actions';
export interface LazyState {
counter: number;
}
const INITIAL_STATE: LazyState = {
counter: 0
};
export function lazyReducer(state: La... |
83b6c5feba8932c2d78a3a2cbd7359a476d5e6a5 | TypeScript | borbert/hrsa-findings-dashboard | /dashboard/src/app/components/searchCard/ducks/reducers.ts | 2.890625 | 3 | import { SearchActionTypes } from './types'
import { combineReducers } from 'redux'
function entityKeyword(state = '', action: SearchActionTypes): string {
switch (action.type) {
case 'SET_ENTITY_KEYWORDS': {
const { keyword } = action.payload
return keyword
}
default:
return state
}... |
c2edb4d518bdbde51141f070edc3cd55594be3f7 | TypeScript | cloudsmithconsulting/cds-for-code | /src/commands/cs.cds.deployment.addSolutionComponent.ts | 2.53125 | 3 | import * as cs from "../cs";
import * as vscode from 'vscode';
import { CdsWebApi } from '../api/cds-webapi/CdsWebApi';
import { CdsSolutions } from '../api/CdsSolutions';
import ApiRepository from '../repositories/apiRepository';
import Quickly from '../core/Quickly';
import { Utilities } from '../core/Utilities';
imp... |
6ce96da1ee3c8cca6cb7abcfb9c6bfd68b1ed678 | TypeScript | renzol2/lineage | /src/pages/api/pairings.ts | 2.75 | 3 | import type { NextApiRequest, NextApiResponse } from 'next';
import {
getPairings,
addPairing,
updatePairing,
deletePairing,
getAllPairings,
} from '../../firebase/pairings';
import { Pairing } from '../../fixtures/Pairings';
import { PairingApiResult } from './types/pairings';
export default async (req: Nex... |
ac20b2c4555f8ca0f68fe0e2aaaa7fba16eaa150 | TypeScript | hasparus/power-of-preconditions | /04.ts | 2.75 | 3 | // #region
import { Flavor } from "nom-ts";
export type Username = Flavor<string, "Username">;
export type Email = Flavor<string, "Email">;
export interface User {
name: Username;
email: Email;
}
export type Id = Flavor<string | number, "Id">;
// #endregion
export interface Meeting {
id: Id;
author: User;
... |
0a21b4ee5ef44ea02cc8415604ddf4ee4f2097e4 | TypeScript | fredguth/risque-rabisque | /src/utils/curve.ts | 2.796875 | 3 | import Point from './point';
// // Based on SignaturePad
// // https://github.com/szimek/signature_pad
// // https://medium.com/square-corner-blog/smoother-signatures-be64515adb33
export function addPointToCurve(point:Point, points:Array<Point>, velocity, width, minWidth, maxWidth) {
if (points.length > 2) {
... |
2b7a22af8c93e162ca7c229937e7ffda1362a4af | TypeScript | JerduarV/2P1S2020 | /src/app/Compilador/ExpresionJ/CallFun2.ts | 2.578125 | 3 | import { ExpresionJ } from './ExpresionJ';
import { Tipo } from '../TSJ/Tipo';
import { ErrorLup } from 'src/app/Auxiliares/Error';
import { DecFun } from '../InstruccionJ/DecFun';
import { getTempAct, concatCodigo, genTemp, conectarNodo, getIdNodo } from 'src/app/Auxiliares/Utilidades';
import { CallFun } from './Call... |
b47f5c16265a4fc270245dc19904adcf13889391 | TypeScript | fureweb-com/nuxtswagger | /src/TemplateCommon.ts | 2.859375 | 3 | /* eslint-disable no-control-regex */
import { Options } from './index'
import { camelCase } from './utils'
import * as v2 from './schema/v2/Spec'
import * as v3 from './schema/v3/Spec'
import { LoDashStatic } from 'lodash'
type ParameterIn = v2.ParameterIn| v3.ParameterIn | '$body' | '$config'
interface Parameter { ty... |
27e4ceeb4caef637e5ece4761b61d95fdfa7bf7d | TypeScript | degrize/jhipster-sample-application | /src/main/webapp/app/entities/decision/decision.model.ts | 2.5625 | 3 | import { INouveau } from 'app/entities/nouveau/nouveau.model';
import { DecisionType } from 'app/entities/enumerations/decision-type.model';
export interface IDecision {
id?: number;
decision?: DecisionType;
nouveaus?: INouveau[] | null;
}
export class Decision implements IDecision {
constructor(public id?: n... |
53f53dcadfddac57f2ec3f35b5d0d5430b0e5bd8 | TypeScript | dmorosinotto/angular-poc-uno | /src/app/shared/ui-codfisc.component.ts | 2.5625 | 3 | import { Component, OnInit, Input, forwardRef } from "@angular/core";
import {
FormControl,
ControlValueAccessor,
NG_VALUE_ACCESSOR,
NG_VALIDATORS,
Validator,
ValidationErrors,
AbstractControl
} from "@angular/forms";
import { BaseCtrl } from "../base/base-ctrl.component";
const IMPLEMENT_VALIDATE_LOGIC ... |
283ca9ac6497e4038094f0323b2929e3ff6f29d2 | TypeScript | Gintez/exchange | /src/services/currency-exchange/compose-exchange-pair.ts | 2.84375 | 3 | import { ExchangePair } from 'types';
interface ComposeExchangePair {
currencyChange: Partial<ExchangePair>;
currentCurrencyPair: ExchangePair;
}
export default function composeExchangePair({
currencyChange,
currentCurrencyPair,
}: ComposeExchangePair) {
let buy = currencyChange.buy;
let sell = currencyCh... |
017882eb9ad83bd1d1283018a44b31cbbf9f66ee | TypeScript | tamanugi/mono_tech_training | /mono-front/src/repositories/user.ts | 2.578125 | 3 | import axios from 'axios'
import { User } from '@/types/'
const API_ENDPOINT = 'http://localhost:8080/users';
export async function findByName(name: string) {
return axios.get<{users: User[]}>(API_ENDPOINT, {params: {name}}).then(({data}) => data.users)
}
export async function findById(id: string) {
return axios... |
f8fda733177c6c4276d438fe54746e867dd6708c | TypeScript | Sazar24/nestable-notes-manager | /__tests__/services/NotesManagerService/deleteNoteAndDescendants.test.ts | 2.6875 | 3 | import { INote, Note } from './../../../src/models/Note';
import NotesManager from '../../../src/services/NotesManager';
describe('NotesManager .deleteNoteAndDescendants ', () => {
const notesManager = new NotesManager();
it('should delete proper values', () => {
const notesInState: INote[] = [
... |
3ef1ed2964ee0fa7252e54e3f28ecce2d2d9fcad | TypeScript | onaio/js-tools | /packages/reducer-registry/src/tests/ducks/users.ts | 2.953125 | 3 | import { ActionCreator, AnyAction, Store } from 'redux';
import reducerRegistry from '../..';
export const reducerName = 'users';
interface User {
username: string;
}
interface AddUserAction extends AnyAction {
payload?: User;
type: typeof ADD_USER;
}
interface UserState {
users: User[];
}
const initialSta... |
6d938d2e1390949a9ba698ab7cb689a301374e0f | TypeScript | cliffordfajardo/mini-rdms | /test/nodes/ProjectionNode.test.ts | 2.671875 | 3 | import { MemoryscanNode } from '../../src/nodes/MemoryscanNode';
import { ProjectionNode } from "../../src/nodes/ProjectionNode";
// TEST DATA
const movies_table = [
{movieId:"0", title: "Apple Computer History"},
{movieId:"1", title: "Ben and Jerrys Documentary"}
];
const DatabaseInMemory = {"movies": movies_tabl... |
8e647d3f124d281cbea2553d09cc1e481a8a5734 | TypeScript | CarbonLDP/sparqler | /src/tokens/BaseToken.spec.ts | 3.0625 | 3 | import { BaseToken } from "./BaseToken";
import { IRIRefToken } from "./IRIRefToken";
describe( "BaseToken", ():void => {
it( "should exists", ():void => {
expect( BaseToken ).toBeDefined();
expect( BaseToken ).toEqual( jasmine.any( Function ) );
} );
describe( "BaseToken.constructor", ():void => {
it( "s... |
f106eb27d7af450b3eb854efd8517714c2c47fd9 | TypeScript | arosh/icfpc2016 | /web/app/browser/d3renderer.ts | 2.515625 | 3 | import { IPoint, ISegment } from "./store";
const renderSize = 555;
const margin = 50;
const edgeRadius = 5;
class Color {
public static BLACK = "#212121";
public static RED = "#F44336";
}
export class D3Renderer {
private el: d3.Selection<any>;
private xScale: d3.scale.Linear<number, number>;
pr... |
bbf115e1f1fe5049bde81dc13321e86222850351 | TypeScript | yuriy-tk/theme-app | /libs/utils/src/lib/colorUtil.ts | 2.984375 | 3 | import * as Color from 'color';
function darken(color: string, amt: number = 0.2) {
return Color(color)
.darken(amt)
.hex();
}
function lighten(color: string, amt: number = 0.2) {
return Color(color)
.lighten(amt)
.hex();
}
function saturate(color: string, amt: number = 0.2) {
return Color(colo... |
fa67b8632359a39f12acad9352c32b8d83a63a59 | TypeScript | stevekeol/remax | /packages/remax-runtime/src/polyfills/Function.ts | 2.609375 | 3 | /* eslint-disable prefer-rest-params */
/* istanbul ignore next */
if (typeof Function.prototype.call === 'undefined') {
Function.prototype.call = function (context: any) {
context = context || window;
context.fn = this;
const args = [...arguments].slice(1);
const result = context.fn(...args);
del... |
20775699b26871ad4432c92caffd7eabfdb4aae7 | TypeScript | LOKE/http-client | /index.ts | 2.8125 | 3 | import got from "got";
import { Counter, Histogram, Registry } from "prom-client";
import { resolve as resolveUrl } from "url";
import urlTemplate from "url-template";
const requestsCount = new Counter({
name: "http_client_requests_total",
help: "Total number of http client requests",
labelNames: ["base", "metho... |
3724db1956890b6fd2e16986c23b4c4ee13d20ec | TypeScript | design-automation/mobius-parametric-modeller-0-5-6 | /assets/core/modules/basic/virtual.ts | 3 | 3 | /**
* The `virtual` module has functions for creating virtual geometric constructs.
* They are called 'virtual' due to the fact that they are not saved in the model.
* Currently there are two types of virtual constructs: planes and rays.
* Most of these functions neither make nor modify anything in the model.
* Th... |
6bad61e7ea5c57e3066f70f69326a1b730005a1b | TypeScript | Pupix/rift-explorer | /app/util/createSpec.ts | 2.625 | 3 | /**
* Legacy code from @Pupix which won't be updated.
* @since 2.0.1
*/
/* eslint-disable */
import { AxiosInstance } from "axios";
import { Agent } from "https";
import mixin from "mixin-deep";
import axios from "axios";
interface createSpecInterface {
address: string;
port: number;
protocol: string;
use... |
137d65bd17e1195397ca8f5d6c26da63befeb864 | TypeScript | end5/CoC-UEE-Web | /classes/classes/Perks/PiercedIcestonePerk.ts | 2.75 | 3 | import { PerkType } from "../PerkType";
import { Perk } from "../Perk";
/**
* Created by aimozg on 27.01.14.
*/
export class PiercedIcestonePerk extends PerkType {
public desc(params: Perk): string {
return "Reduces minimum lust by " + Math.round(params.value1) + ".";
}
public constructor() {
... |
27348c7c44a6d8e92f73803215e0f54626db1f8c | TypeScript | gmackie/home-cal | /src/types/index.ts | 2.6875 | 3 | export enum ProteinType {
CHICKEN = 'Chicken',
BEEF = 'Beef',
FISH = 'Fish',
SEAFOOD = 'Seafood',
TOFU = 'Tofu',
VEGETABLE = 'Vegetable',
}
export interface Meal {
mealName: string;
proteinType: ProteinType;
}
export interface MealCalendar {
meal: Meal;
date: Date;
} |
679e6ea9c34feaa8bcf29ee166612634a9af55d6 | TypeScript | ShotsOnTarget/RoRBuilder | /import/validateDescription.ts | 2.96875 | 3 | import colors from 'colors';
import { Ability } from '../src/helpers/abilities';
import { AbilityData } from './structureAbilities';
export const escapeRegExp = (string: string) => {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
};
// From a description, extract an arra... |
c8cdf75db582dd487e3f699a8202d0949bfe0622 | TypeScript | webrats/NgRx-Angular-Complete | /src/app/counter1/state/counter.state.ts | 2.515625 | 3 |
export interface CounterState {
counter :number ,
desc :String ,
}
export const initialState = {
counter : 0,
desc:"Default Desc"
} |
10ee5e762fb1e6934462babe6c61c08e30d72f5b | TypeScript | mittalprince/Everyday-Stuff | /Angular/Form-validation/src/app/calender/calender.component.ts | 2.75 | 3 | import { Component, OnInit } from '@angular/core'
import * as Moment from 'moment'
import { extendMoment } from 'moment-range'
const moment = extendMoment(Moment)
@Component({
selector: 'app-calender',
templateUrl: './calender.component.html',
styleUrls: ['./calender.component.css']
})
export class Calen... |
cad8d44b9eb0c277b92e349b9a4e1a27a29aa5af | TypeScript | KyleMayes/advent-of-code-2019 | /source/day17.ts | 3.28125 | 3 | import * as _ from "lodash";
import { Grid2d } from "./common/grid2d";
import * as input from "./common/input";
import { execute } from "./common/intcode";
import { iota } from "./common/array";
type Move = "L" | "R" | number;
const memory = input.csv("day17.txt").map(c => parseInt(c, 10));
function view(): string ... |
3d1a75e71e4a30fdea09a55455c0c520777a41bb | TypeScript | simultechnology/my-typescript-samples | /src/lib/ch1/main.ts | 2.890625 | 3 | /**
* get a price after discount
*
* @param price
* @param discount
*/
export function getFinalPrice(price: number, discount: number): number {
return price - (discount === 0 ? 0 : price / discount);
}
|
4f5b3dee35c6613fd1b784f0d3aa34d14361198e | TypeScript | gravyboat/syniti-take-home | /src/__tests__/validateData.tests.ts | 2.734375 | 3 | import { readFileSync } from 'fs';
import {
userAddressFormat,
validZipCode,
readJsonFile,
validateAndOptionallyWriteData,
} from '../validateData';
import path from 'path';
describe('read in data', () => {
test('reads in JSON aray file to confirm local file access', () => {
expect(readJson... |
e63d139c3c64abda5b0856bb699afb65d7bf134d | TypeScript | kobajs/analytics-dashboard | /src/features/PortsSelection/PortsSelection.reducer.ts | 2.78125 | 3 | import { createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
import { createGenericSlice, GenericState } from '../../store/createGenericSlice';
import { Port } from '../../entities/Port';
import { PortsAPI } from '../../api/PortsAPI';
interface PortsSelectionState {
availablePorts: Port[];
origin: string;
... |
57d7f7589a28ce7289a8aad7e082b0cdf6d7ea28 | TypeScript | JakLind/octra | /src/app/media-components/obj/Line.ts | 3.484375 | 3 | /***
* Creates new Line Object for the canvas
* @param number
* @param size {width:w, height:h}
* @param pos {x: x, y: y}
* @constructor
*/
export class Line {
public number = -1;
mouseIn = function (x, y) {
const result =
(x > this.pos.x && x < (this.pos.x + this.size.width)) &&
(y > this.po... |
1298a03c12eb5a0619141c3cbfe4539a3572ebae | TypeScript | x-wk/redux-kangking-examples | /src/pages/home/counter.state.ts | 2.953125 | 3 | import AppState from '../../redux/state';
import {PayloadAction, ReduxStateProcessor} from 'redux-kangking';
import {ReduxStateObserver} from 'redux-kangking/observable';
import {Observable, of} from 'rxjs';
import {delay, filter, mergeMap} from 'rxjs/operators';
import {createSlice} from '../../redux/store';
// 前2个处理... |
de290f6c749b9500e2be9d77867d72dbaab9c591 | TypeScript | JordhanMadec/markdown-editor | /src/app/services/html-parser.service.ts | 3.078125 | 3 | export function parseMdTitleToHtml(markdown: string): string {
return !markdown ? '' : markdown
.replace(/######(.+)(\n|$)/g, '<h6>$1</h6>') // Parse h6
.replace(/#####(.+)(\n|$)/g, '<h5>$1</h5>') // Parse h5
.replace(/####(.+)(\n|$)/g, '<h4>$1</h4>') // Parse h4
.replace(/###(.+)(\n|$)/g, '<h3>$1</h3... |
aed03d7d1fcd7c6ace84a0bb056d29a9877a2552 | TypeScript | sheinsight/shineout | /src/utils/validate/regExp.ts | 2.625 | 3 | import nullable from './nullable'
export default (regExp: string | RegExp | undefined, options: {message: string}) =>
nullable((value: unknown, _formdata: any, callback: (x: boolean | Error) => void) => {
const { message } = options
const reg = typeof regExp === 'string' ? new RegExp(regExp) : regExp
if... |
dee830560561b7cb0d8e42967eda930b71cdfd24 | TypeScript | tmilos1/learning-ionic-favorite-quotes | /src/services/settings.ts | 2.75 | 3 |
export class SettingsService
{
private alternativeColor: boolean = false;
setAlternativeColor(altColor: boolean) {
this.alternativeColor = altColor;
}
isAlternativeColor() : boolean {
return this.alternativeColor;
}
} |
cf657b9eebd4f438390cf206dd98695dffcccead | TypeScript | jweber96/Secure-Login | /api/src/controller/UserController.ts | 2.859375 | 3 | import { Request, Response } from "express";
import { getRepository } from "typeorm";
import { validate } from "class-validator";
const otplib = require('otplib');
import { User } from "../entity/User";
import { Note } from "../entity/Note";
class UserController{
static getOneById = async (req: Request, res: Respo... |
2ed7690ad6bf7680d4ebbe8801dbc7d5fcc88e27 | TypeScript | aklom/GetMeMyWeather | /src/interfaces.ts | 2.671875 | 3 |
export enum Pages {
weather, sun
}
export enum Unit {
METRIC = "metric",
IMPERIAL = "imperial"
}
export interface stateInterface {
temperature: string | undefined;
weather: string | undefined;
windSpeed: string | undefined;
unit: Unit;
icon: string | undefined;
longitude: number | undefined;
l... |
2e553c5ad15da7ea7ad14fca05820207a987a2ed | TypeScript | luisneto98/rick-proxy | /src/app.controller.ts | 2.6875 | 3 | import { Controller, Get, Param, Query } from '@nestjs/common';
import { AppService } from './app.service';
import axios from 'axios';
import { identity } from 'rxjs';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
async getHello(
@Query('page') pag... |
9d2bb8794ca6d30c459a5f930ef1d591d6ada682 | TypeScript | hotellaapp/WebApp | /hotella/src/app/pages/informacoes/components/inputs/components/smartTables/smartTables.service.ts | 2.59375 | 3 | import {Injectable} from '@angular/core';
import { Http, Response, RequestOptions, Headers } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { Informacao } from '../../../../../informacao';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';
... |
a9de12a7b8e07887c38217f26103cfd19f2067cc | TypeScript | navelist89/AutochekChart | /food-lens-chart.ts | 2.5625 | 3 | import * as Highcharts from 'highcharts'
import { AutochekChartOption, chartCommon } from '@AutochekChart/chart.option'
import * as moment from 'moment'
import { DaySummaryWithArray, FoodlensDaySummary, FoodlensMeasurement } from 'autochek-base/objects/device-data-object'
chartCommon(Highcharts)
export function drawF... |
e4e5d076d0bd72485a4d5f11adfe644a05f3cbdc | TypeScript | sa-express-news/2018-primaries-server | /src/google-sheets/index.ts | 2.640625 | 3 |
import * as fs from "fs";
import * as readlineSync from "readline-sync";
import { promisify } from "util";
import primaryIDMap from "../data-store/primaryIDMap";
import { Candidate, Primary, Race } from "../types";
const google = require("googleapis");
const googleAuth = require("google-auth-library");
import { Google... |
972d04806be9c3183ac63e8fa3fdf2b8a7718b32 | TypeScript | IvanPopov/akra-engine-core | /src/akra-ui/ui/Vector.ts | 2.609375 | 3 | /// <reference path="../idl/IUILabel.ts" />
/// <reference path="../idl/IUIVector.ts" />
/// <reference path="Component.ts" />
module akra.ui {
import Vec2 = math.Vec2;
import Vec3 = math.Vec3;
import Vec4 = math.Vec4;
function prettifyNumber(x: float): string {
if (x === math.floor(x)) {
return... |
f74206606f639c69d1668d0e74e11647725b16fa | TypeScript | nojaf/thunderstone | /tasks/thunderstoneProcessor.ts | 2.546875 | 3 | /// <reference path="interface.ts" />
/// <reference path="../typings/tsd.d.ts" />
import cheerio = require("cheerio");
import _ = require("underscore");
//#region parse html
export function parseHtmlFiles(htmlFiles: IHtmlFile[], cssFiles: ICssFile[]): void {
"use strict";
for (var h: number = 0; h < htmlFile... |
0867e5e6096679d5ce2a78eb2e08faccac74618a | TypeScript | lulzzz/topical | /packages/botbuilder-topical/src/SimpleForm.ts | 2.84375 | 3 | import { Topic, TopicInstance, TextPrompt, TopicWithChild } from './topical';
import { BotContext } from 'botbuilder';
export interface SimpleFormMetadata {
type: 'string';
prompt: string;
}
export interface SimpleFormSchema {
[field: string]: SimpleFormMetadata;
}
export interface SimpleFormData {
[... |
e2a5580aae5115c5e096169046f135c949a6aa70 | TypeScript | Jitzek/jitzek.github.io-old | /static/js/linux/commands.ts | 3.046875 | 3 | function delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function removeWhiteSpaceEntries(array: Array<string>) {
return array.filter(function (str: string) { return /\S/.test(str); })
}
class Command {
id: string;
help: string;
man: Object;
fs: Filesystem;
terminal: Termin... |
4a59aaed7539bf08760bd6cadd3064b9edc8400c | TypeScript | PauloMoss/banana-game | /src/AutonomousDraw.ts | 2.65625 | 3 | import Game from "./Game";
import { randomIntFromInterval } from "./helpers";
import Illustration from "./Illustration";
export default class AutonomousDraw extends Illustration {
canvas;
speedY;
constructor(
canvas: HTMLCanvasElement,
context: CanvasRenderingContext2D,
img: HTMLImageElement
) {
... |
669d0e2c524a3ebbd2c3b940c1b91c786c7f1610 | TypeScript | xiaohong-yang/vue3-learn | /src/views/demo/hooks/useRequest.ts | 2.59375 | 3 | import { ref, getCurrentInstance } from 'vue'
export default function <T>(url: string) {
// 加载的状态
const loading = ref(true)
// 请求成功的数据
const data = ref<T | null>(null) // 坑
// 错误信息
const errorMsg = ref('')
// 发送请求
// @ts-ignore
const { proxy } = getCurrentInstance()
setTimeout(() => {
// @ts-ign... |
f97c7cc6ee269324e7d3ebdd43a01b22fc53a0ec | TypeScript | Metarock/club_backend | /src/entities/Post.ts | 2.578125 | 3 | import { Field, ObjectType } from "type-graphql";
import { BaseEntity, Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Page } from "./Page";
@ObjectType()
@Entity()
export class Post extends BaseEntity {
@Field()
@PrimaryGeneratedCo... |
0e2706bb2c8124ec9aac9455b440830407b4f744 | TypeScript | erikaxe/Corona-Dashboard | /src/app/components/user-interactive-chart/user-interactive-chart.component.ts | 2.875 | 3 | // Imports
import { Component, OnInit, ViewChild} from '@angular/core';
// Service import
import { ApiDataService } from './../../services/api-data.service';
// Apex chart imports
import {
ApexAxisChartSeries,
ApexChart,
ChartComponent,
ApexDataLabels,
ApexXAxis,
ApexPlotOptions,
ApexTitleSubtitle,
Ap... |
96707ca3ea7453e42682293e479e9e823905e9ed | TypeScript | sugrinov/hacker-news | /src/app/submissions/submissions.component.ts | 2.546875 | 3 | import { Component, OnInit, Input } from '@angular/core';
import { RESULTS_PER_PAGE } from '../constants/constants';
@Component({
selector: 'app-submissions',
templateUrl: './submissions.component.html',
styleUrls: ['./submissions.component.css']
})
export class SubmissionsComponent implements OnInit {
@Input... |
63bb3bad29b395f6d49b213aa778e5fbe0a70454 | TypeScript | Activiti/activiti-modeling-app | /projects/process-editor/src/services/bpmn-js/EventBusMock.ts | 2.59375 | 3 | /* eslint-disable */
import {
isFunction,
isArray,
isNumber,
bind,
assign
} from 'min-dash';
var FN_REF = '__fn';
var DEFAULT_PRIORITY = 1000;
var slice = Array.prototype.slice;
export default function EventBusMock() {
this._listeners = {};
this.on('diagram.destroy', 1, this._destroy, t... |
76b1b9c579b543aee6e010d61121cb6250d1b48f | TypeScript | serge-web/serge | /packages/components/src/local/molecules/editable-row/types/props.d.ts | 2.6875 | 3 | import { EDITABLE_SELECT_ITEM, EDITABLE_SWITCH_ITEM } from '..'
export interface Option {
name: string
uniqid: string
[property: string]: any
}
export interface SelectItem {
readonly uniqid: string
type: typeof EDITABLE_SELECT_ITEM
title?: string
active?: Array<number>
multiple?: boolean
emptyTitle?:... |
e27e36a8642abea569da2c5e0515f449237c392b | TypeScript | moritzmyrz/Driver-TS | /src/events/message.ts | 2.609375 | 3 | import BaseEvent from '../utils/structures/BaseEvent';
import { Message } from 'discord.js';
import DiscordClient from '../client/client';
export default class MessageEvent extends BaseEvent {
constructor() {
super('message');
}
async run(client: DiscordClient, message: Message) {
if (message.author.bot... |
41e919e1601d1162b4c97bbb83ae31c87d30d3d0 | TypeScript | williamfligor/slider | /src/convert.ts | 2.640625 | 3 | import * as fileUpload from "express-fileupload";
import * as imagemagick from "imagemagick";
import * as fs from "fs";
import * as path from "path";
export const SLIDES_DIR = __dirname + "/../data/slides";
async function moveFile(file: fileUpload.UploadedFile) {
return new Promise((resolve, reject) => {
... |
144b7b9d641e18994a18f4bede91227d9098aeda | TypeScript | jtamminga/boids | /src/obsticle.ts | 2.875 | 3 | import { Renderable, GameState, DEBUG_MODE, Vision, Avoidable, BOID_SPEED } from "./game";
import Point from "./point";
import { closestPointLine, min } from "./utils";
import Segment from "./segment";
import GameElement from "./element";
import Vector from "./vector";
export default class Obsticle implements Renderab... |
f76b90df9182e2506d90074abf909b832cfdd3ad | TypeScript | guardian/dotcom-rendering | /dotcom-rendering/src/model/enhanceTableOfContents.test.ts | 2.578125 | 3 | import { Explainer as ExampleArticle } from '../../fixtures/generated/articles/Explainer';
import { blockMetaData } from '../../fixtures/manual/block-meta-data';
import { enhanceTableOfContents } from './enhanceTableOfContents';
describe('Enhance Table of Contents', () => {
it('does not generate a toc where an existi... |
6f857c4be93ac7d3261b20a53bb422b1c27dfc8b | TypeScript | SadlyOfficical/ghostybot | /src/features/MemberCount.ts | 2.640625 | 3 | import { Guild } from "discord.js";
import Bot from "../structures/Bot";
import Feature from "../structures/Feature";
export default class MemberCountFeature extends Feature {
constructor(bot: Bot) {
super(bot, "member-count");
}
async execute(bot: Bot) {
const timeout = 60 * 1000 * 15; // 15 minutes
... |
b9b808d611b5207c8d8fcc2a30e199e04f6959e4 | TypeScript | iamwaswa/email | /frontend/content/attachFiles/chips/index.ts | 2.75 | 3 | import * as React from "react";
import { Box, Chip } from "@material-ui/core";
type Props = {
values: Email;
setValues: React.Dispatch<React.SetStateAction<Email>>;
setTotalFileSizeInMB: React.Dispatch<React.SetStateAction<number>>;
};
export default (props: Props): JSX.Element[] => {
if (props.values.attach... |
0ebaae42f71733de8d254405579a08d6945fda82 | TypeScript | Kennypt/react-native-cinema | /server/src/middlewares/errorHandler.ts | 2.828125 | 3 | import path from 'path';
import statusCodes from 'http-status-codes';
import config from '../config';
import errorCodesEnum from '../enums/errorCodes';
const DEFAULT_ERROR_MESSAGE = 'Unfortunately we are unable to fulfil your request at this time.';
export const buildErrorResponse = (
message = DEFAULT_ERROR_MESSA... |
2e1cd5689a7af0b27fbdd91763866b6ed4b00983 | TypeScript | vaibhavbhandare/Assignment1-Sports | /src/app/store/reducers/auth.reducers.spec.ts | 2.8125 | 3 | import { reducer, State } from './auth.reducers';
import { LogIn, LogInFailure, LogInSuccess,
SignUpFailure, SignUpSuccess, LogOut } from '../actions/auth.action';
import { User, Sport } from '../model/user';
const initialState = {
isAuthenticated: false,
user: null,
errorMessage: null,
};
const... |
2e3e612bf7b7fae44e6d44ea4acc9f8e691c2bb7 | TypeScript | microsoft/fluentui | /packages/date-time-utilities/src/dateMath/dateMath.test.ts | 3.28125 | 3 | import { DayOfWeek, DateRangeType } from '../dateValues/dateValues';
import * as DateMath from './dateMath';
enum Months {
Jan = 0,
Feb = 1,
Mar = 2,
Apr = 3,
May = 4,
Jun = 5,
Jul = 6,
Aug = 7,
Sep = 8,
Oct = 9,
Nov = 10,
Dec = 11,
}
describe('DateMath', () => {
it('can add days', () => {
... |
8132ddc6695e9e44e13e9f87e2de67cfdd325453 | TypeScript | dev-marlon/rca-api | /src/user/user.service.ts | 2.71875 | 3 | import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from './user.entity';
import { Repository } from 'typeorm';
export interface User {
userId: number;
firstname: string;
lastname: string;
username: string;
password: string;
}
@Injectabl... |
5ef4eebc636f8f29a6cef7ee8db2045ba9940f59 | TypeScript | jvitorssouza/nestjs-authentication | /src/shared/utils/document-validate.ts | 2.703125 | 3 | import { BadRequestException } from '@nestjs/common';
import HapiJoi from '@hapi/joi';
import validator, { cnpj, cpf } from 'cpf-cnpj-validator';
export class DocumentValidateService {
execute(documentStr: string) {
try {
const Joi = HapiJoi.extend(validator);
const document = documentStr.match(/\d+... |
081cc244cb38797205d4775f9ea21deb6b13d426 | TypeScript | yasmim-moon/dsdeliver-sds2 | /front-web/src/api.ts | 2.53125 | 3 | import axios from "axios";
import { OrderPlayload } from "./Orders/types";
const API_URL = process.env.REACT_APP_API_URL;
//requisação nessa url que irá buscar os produtos
const mapboxToken = process.env.REACT_APP_ACESS_TOKEN_MAP_BOX;
export function fetcProducts(){
return axios(`${API_URL}/products`)
//conc... |
ce26e3e46957a1f9c53edcf01ac27de3ad060a74 | TypeScript | fireflysemantics/is | /projects/fs-is/src/lib/IsFQDN.ts | 3.09375 | 3 | import { IsFQDNOptions as vtsIsFQDNOptions, isFQDN as vtsIsFQDN } from '@fireflysemantics/validatorts'
/**
* Checks if the string is a fully qualified domain name (e.g. domain.com).
* If given value is not a string, then it returns false.
*
* @param value The value being checked.
* @param options The options con... |
aa59db52bab7b790b33401c3dd7b8b9974da3f36 | TypeScript | andrewscwei/node-mongodb-odm | /src/utils/typeIsUpdateFilter.ts | 2.984375 | 3 | import _ from 'lodash'
import { UpdateFilter } from 'mongodb'
import { AnyProps, Document } from '../types'
/**
* Checks if a value is an {@link UpdateFilter}.
*
* @param value - Value to check.
*
* @returns `true` if value is an {@link UpdateFilter}, `false` otherwise.
*/
export default function typeIsUpdateFil... |
217411ab275d6305394f3d410d35b633cf5239ff | TypeScript | Steady5063/steady5063.github.io | /common-ui/projects/common-ui/src/lib/tables/static-control/static-control-element.component.ts | 2.5625 | 3 | import {Component, Input} from '@angular/core';
/**
* @Component: Static Control Element
* @description This component generates the static control element.
*/
@Component({
selector: '[citi-static-control-element]',
template: `
<th scope="row" [innerHtml]="(labelText === null ? '' : labelText)"></th>
<t... |
5ba81e971a828917836b463f5ce958d3006fa568 | TypeScript | W-R126/Stopover-poc | /src/Models/HotelOfferModel.ts | 2.78125 | 3 | import { CoordinateModel } from './CoordinateModel';
import { PriceModel } from './FlightOfferModel';
export interface HotelOfferModel {
checkIn: Date;
checkOut: Date;
hotels: HotelModel[];
}
export interface HotelModel {
images: ImageModel[];
rooms: RoomModel[];
chain: {
code?: string;
name?: str... |
34b4b2459f219666db0243d6d5df5ebf1f770812 | TypeScript | marcelopimeireles/storybook-poc-2 | /src/components/form-elements/input/input.ts | 2.515625 | 3 | /**
* Sunrise UI - Input
*/
import {html, css, LitElement, property, unsafeCSS, customElement, CSSResult, TemplateResult} from 'lit-element';
import {classMap} from 'lit-html/directives/class-map';
import styles from './input.scss';
/**
* This component is not complete and is mostly used as a placeholder.
* Angula... |
ac5e159f89fbcfbf700c6d8d40b4754f0eefad33 | TypeScript | ErickWendel/palestra-vscode-extensions | /capi-ext/src/RecorrencyController.ts | 2.59375 | 3 | import { Disposable, window, StatusBarItem, StatusBarAlignment } from 'vscode'
import { activate } from './extension';
export default class RecorrencyController {
private _disposable: Disposable;
private _statusBarItem: StatusBarItem;
constructor() {
this._statusBarItem = window.createStatusBarIte... |
1d5f1f54d0dc7ef9e91e019a409f6717b5375599 | TypeScript | itaied246/daas | /src/models/interfaces/index.ts | 2.5625 | 3 | export interface IModel {
name: string;
body: IField[];
description?: string;
}
export interface IField {
field: IInfo;
input?: IInfo;
}
export interface IInfo {
name: string;
type: string;
}
|
fe4b9de58316af32d4370aec87585bd475104f2d | TypeScript | joanmaciasaguirre/ionic-instagram-backend | /middlewares/autenticacion.ts | 2.625 | 3 | import { Response, Request, NextFunction } from 'express';
import Token from '../classes/token';
export const verificaToken = (req: any, resp: Response, next: NextFunction) => {
// con el método get podemos acceder al header del request
// x-token es como vamos a llamar a la key del token en el header
c... |
2c09938145b90f42a4b37813040ea66d0588b40d | TypeScript | Islandman93/black-screen | /src/shell/Aliases.ts | 2.890625 | 3 | import {executeCommandWithShellConfig} from "../PTY";
import * as _ from "lodash";
export const aliasesFromConfig: Dictionary<string> = {};
export async function loadAliasesFromConfig(): Promise<void> {
const lines = await executeCommandWithShellConfig("alias");
lines.map(parseAlias).forEach(parsed => aliase... |
7da4d01a8c114a60596682a6e0fa7476b4d9f7d3 | TypeScript | subodhsubhedar/angular2 | /my-angular-single-page-profile-app/src/app/contact-me/contact.ts | 2.984375 | 3 | export class Contact {
salutation: string;
userName: string;
mobileNum: number;
email: string;
remarks: string;
constructor(userNm: string, mobNum: number, emailAddrss: string, remrks: string) {
this.userName = userNm;
this.mobileNum = mobNum;
this.email = emailAddrss;... |
5d335ad73ec078d55124d13c6bb77eb8060c6b67 | TypeScript | christopher-caldwell/ts-migration-helpers | /test/ui/src/stores/dateIntegrity/dateIntegrityActions.ts | 2.53125 | 3 | import { STORE_BOARD_METADATA, RECEIVE_BOARD_METADATA } from '../actionTypes';
const receiveDateIntegrity = () => ({ type: RECEIVE_BOARD_METADATA });
const storeDateIntegrity = (payload: any) => ({
type: STORE_BOARD_METADATA,
payload
});
export const requestDateIntegrity = () => (dispatch: any) => dispatch(r... |
73f8eadd05bc378e804a54d72ac982bf695123f6 | TypeScript | TheUnderScorer/show-me-the-hooks | /src/ts/app/hooks/toggleVisibility.ts | 2.59375 | 3 | import { showHooks, toggleHooks } from './utils/visibility';
import { hooksToggle } from './selectors';
import HooksState from '../types/HooksState';
import ElementEvent from '../types/ElementEvent';
import { getVisibleHooksCount } from './count';
const localStorageState = localStorage.getItem( 'smth_hooks_state' );
c... |
51f30c83250843771c6cd4f5e4232511fb90088c | TypeScript | aviacommerce/mobileapp-nativescript | /app/search/reducers/search.reducers.ts | 2.625 | 3 |
import { Product } from "~/core/models/product";
import { SearchActions } from "../action/search.actions";
import { IsearchState, searchStateRecord } from "./search.state";
export const initialState: IsearchState = new searchStateRecord() as IsearchState;
export function reducer(state = initialState, { type, payload... |
5ba2c04cef738370a3500059ab8b89d83eccee5b | TypeScript | MrMarans/EIA2 | /aufg4/aufg3b.ts | 2.734375 | 3 |
//Aufgabe: Aufgabe 3
//Name: Metzger Ron
//Matrikel: 254878
//Datum: 07.04.2017
//Hiermit versichere ich, dass ich diesen Code selbst geschrieben habe. Er wurde nicht kopiert und auch nicht diktiert.
document.addEventListener('DOMContentLoaded', function() {
let Stapel: string[] = ["Karo 7", "K... |
2306d885744f6f27d5f6e7fccccc6f2f727ffdb5 | TypeScript | diorrego/api-rest-typescript-express | /src/utils/catch.ts | 2.765625 | 3 | import { Response } from 'express';
interface errors extends Error {
code: number;
message: string;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const sendError = (res: Response, e: errors | any): void => {
const statusCode: number = e.code || 500;
res.status(statusCode).send(e.mess... |
05d4e5b056c13ab1db59de97fed3a7d34e81051b | TypeScript | dbalatoni13/jikan-nodejs | /lib/functions/genre/animesByGenre.ts | 2.625 | 3 | import api from '../../api';
import AnimeByGenre from '../../interfaces/genre/AnimeByGenre';
export default async function animesByGenre(
id: number,
params?: { [Key: string]: number },
): Promise<AnimeByGenre> {
let url = `/search/anime?genre=${id}`;
for (const param in params) {
if (params[param]) {
... |
dcabac2c5d630d22798207d68bbe356669107848 | TypeScript | blockframes/bank-server | /src/firestore/firestore.ts | 2.546875 | 3 |
import { initializeApp } from 'firebase-admin';
import { ExpectedPayment, Movement } from '../receipt/receipt';
import { PaymentParty } from '../payment/payment';
const app = initializeApp();
const db = app.firestore();
/** This interface come from the Draw.io data model */
interface InvoiceTitleDetails {
titleId:... |
bbec990393302794ef88d1340ce1ccddfc5dae08 | TypeScript | chigginsiii/tag_league | /client/src/components/style/colors.ts | 2.828125 | 3 | interface ToneProfile {
base: string,
bright: string,
brighter: string,
dark: string,
darker: string
}
interface ColorTones {
white: string,
black: string,
primary: ToneProfile,
secondary: ToneProfile,
tertiary: ToneProfile,
complent: ToneProfile,
}
const colors = {
white: "#ffffff",
black: ... |
f2a9d3052b6457283897d803439129b42e0e8290 | TypeScript | ShiningDan/intell-be | /app/service/loan.ts | 2.546875 | 3 | import { Service, Context } from 'egg'
import { LoanProductsModel, LoanUsersModel } from '../model'
export default class Loan extends Service {
constructor(ctx: Context) {
super(ctx)
}
// 这里实现搜素框查询功能
public async search({ name }: { name: string }): Promise<LoanProductsModel[]> {
const { app } = this
co... |
2dba7c038f2e192bec771f5b4c21a59c8b313082 | TypeScript | Saervok/types | /definitions/utilities/math/Direction.d.ts | 2.671875 | 3 | /*!
* Copyright Unlok, Vaughn Royko 2011-2020
* http://www.unlok.ca
*
* Credits & Thanks:
* http://www.unlok.ca/credits-thanks/
*
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the moddin... |
8a80cde000ce927fb9748074b4a2dcd56f469a60 | TypeScript | digirati-co-uk/madoc-platform | /services/madoc-ts/src/frontend/shared/capture-models/types/to-be-removed.ts | 2.765625 | 3 | import { CaptureModel } from './capture-model';
import { NestedField } from './field-types';
import { BaseSelector } from './selector-types';
export type UseCaptureModel<Model extends CaptureModel = CaptureModel> = {
captureModel: Model;
};
export type CaptureModelContext<
Selector extends BaseSelector = BaseSele... |
fcc76cbe918e807b7f519c040163c8e1284d94a1 | TypeScript | brTomaz/clonify | /src/reducers/player-reducer.ts | 3.0625 | 3 | import { Track } from '../entities/track';
import { PlayerContextState as PlayerState } from '../providers/player-context';
import { Action } from '../types/action.type';
export enum PlayerActionType {
CHANGE_QUEUE = 'CHANGE_QUEUE',
PLAY_TRACK = 'PLAY_TRACK',
}
export type PlayerAction = {
[PlayerActionType.CHA... |
0e03da02d679afb6e6df8c8abf74480595a2de35 | TypeScript | ibuckner/collections | /src/slicer.ts | 3.328125 | 3 | export type TSlicerState = {
filtered: boolean,
selected: boolean
};
export enum SlicerModifier {
NO_KEY = 0,
CTRL_KEY = 1,
SHIFT_KEY = 2
}
export class Slicer<T> {
private _: Map<T, TSlicerState> = new Map<T, TSlicerState>();
private _selectionCount: number = 0;
public get members(): any {
con... |
2b7919fda842a8e18e35c0d68bba9ed70a2d0424 | TypeScript | trevorhanus/dynaflo | /__test__/conditions/ContainsComparator.test.ts | 2.65625 | 3 | import ContainsComparator from '../../src/conditions/comparators/ContainsComparator';
describe('ContainsComparator', () => {
it('String', () => {
const comp = new ContainsComparator('test');
const str = comp.exprString('#test');
expect(str.includes('contains(#test, ')).toBe(true);
const valueMap = c... |
4064ecba222dea50763b15317474850813ba2473 | TypeScript | pjlee11/speedcurve-cli | /src/command/update-url.ts | 2.765625 | 3 | import SpeedCurve from "../index"
import log from "../log"
interface UpdateUrlCommandOptions {
key: string
json: boolean
urlId: number
url: string
label?: string
}
export default async function updateUrlCommand(opts: UpdateUrlCommandOptions) {
const { key, json = false, urlId, url, label } = opts
try {
cons... |