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 |
|---|---|---|---|---|---|---|
d48825b212d8b1215538e4cb81f05ead0c314ec7 | TypeScript | lakexyde/tabris-js | /examples/typescript-weather-app/src/forecastOverview.ts | 2.65625 | 3 | import {Composite, CompositeProperties, TextView} from 'tabris';
import {omit} from './util';
import {WeatherData, WeatherDatum} from './weatherService';
const TEXT_COLOR = 'rgb(255, 255, 255)';
const MIN_TEMP_COLOR = 'rgb(245, 245, 255)';
const INFO_BOX_COLOR = 'rgba(0, 0, 0, 0.2)';
const MARGIN = 5;
const INNER_MAR... |
3e498cfbfe148872670d99ba2832afa1e2837961 | TypeScript | alejandrade/ScrumPointer | /src/app/model/story.ts | 2.640625 | 3 | export class Story {
public score: number;
public storyName: string;
public id: string;
public consensus: boolean;
constructor(id: string) {
this.score = 0;
this.storyName = '';
this.id = id;
this.consensus = false;
}
}
|
9e0742a51fc0f619b95ff683b66c6ca3b3aeb830 | TypeScript | citelao/hit_list_api | /src/util/WebArchive.ts | 2.703125 | 3 | import plist from "simple-plist";
interface IWebArchive {
WebMainResource: {
WebResourceData: Array<number>;
WebResourceFrameName: string;
WebResourceMIMEType: string;
WebResourceTextEncodingName: string;
WebResourceURL: string;
}
}
function parseWebArchiveEncoding(enco... |
cbdabb5bb5a9031b946a783298d1e8d41d85ff3b | TypeScript | wydra98/Flight-booking-frontend | /src/app/user/search-flight/Type.ts | 3.15625 | 3 | export class Type {
text: string;
allowed: boolean;
constructor(text: string, allowed: boolean) {
this.text = text;
this.allowed = allowed;
}
}
|
645f8aaad2c3e5f279a313d549dabdea9cb90aac | TypeScript | AbhishekLondhe/swabhavrepo3 | /angular7/welcome-app/src/app/student/student.component.ts | 2.59375 | 3 | import { Component } from "@angular/core";
import { IStudents } from "./IStudents";
import{ICourse} from "./ICourse"
@Component({
selector: 'aurionpro-student',
templateUrl: 'student.component.html'
})
export class StudentComponent {
student: IStudents;
imgHeight:String="400px";
imgWidth:String="40... |
21f2019f3c3cb1e154e01ad165d3268591760989 | TypeScript | zeromq/zeromq.js | /test/unit/context-construction-test.ts | 2.625 | 3 | import * as zmq from "../../src"
import {assert} from "chai"
describe("context construction", function () {
afterEach(function () {
global.gc?.()
})
it("should throw if called as function", function () {
assert.throws(
() => (zmq.Context as any)(),
TypeError,
"Class constructors canno... |
ee1102a33ec0da85853fb91ed279ab8660f8e227 | TypeScript | mznx/git-graph | /dev/ts/model.ts | 2.609375 | 3 | import { View } from './view';
import { Commit, Tag, CommitsObject, CommitQueue, Coords } from './mytypes';
export class Model {
view: View;
commit_queue: CommitQueue;
json_check: boolean;
constructor(view: View) {
this.view = view;
this.json_check = false;
}
... |
4a424b20dded2549be04aa598d5ca9acca330967 | TypeScript | organizer2012/TypeScript | /Seminar ECMA6/seminar_Original/typescript/types.ts | 3.34375 | 3 | // Value Types??
// das ist einer!
let zweiundvierzig: 42;
zweiundvierzig = 42;
// zweiundvierzig = 17;
let numBool: number|boolean|null;
type numBoolNull = number|boolean|null;
let numBool2: numBoolNull;
type ampel = 'rot'|'gelb'|'grün';
type zahlangabe = 'nix'|'nada'|number|null;
let color:ampel;
col... |
8f11392cdd2add86db8bb563fe7216bae855d612 | TypeScript | boromisp/jsonapi-tools | /packages/jsonapi-tools/src/handlers/handle-errors.ts | 2.875 | 3 | 'use strict';
import * as JSONAPI from 'jsonapi-types';
import { IExtendedError, IErrorResponseObject } from '../types/utils';
export interface IErrorLogger {
error: (message: any, ...optionalArgs: any[]) => void;
}
function transformError(error: IExtendedError): JSONAPI.IErrorObject {
const val: JSONAPI.IErrorO... |
ca18920782d0cbb94e2f0a81d1ccfd605d12705d | TypeScript | iMicknl/communication-ui-library | /packages/storybook/.storybook/telemetry.ts | 2.796875 | 3 | import { ApplicationInsights } from '@microsoft/applicationinsights-web';
/**
* Check if we have the necessary cookie consent to allow the app insights library to make use of cookies
*/
export const analyticsCookieConsentObtained = (): boolean => {
return (
!!(window as any).siteConsent && // has telemetry lib... |
0fcf9be9c36035d8951540ece15eb0b56969ba20 | TypeScript | khanka0511/discord-contest-bot | /src/notify.ts | 2.78125 | 3 | import { subscribedChannels } from '@/cli';
import {
EventSource,
UpcomingEvent,
notifyIntervals,
formatUpcomingEvent,
} from './event';
const eventSources: Map<string, EventSource> = new Map();
export function addEventSource(eventSource: EventSource, id: string) {
if (eventSources.has(id)) {
throw Error... |
adba965f0bde6ec4d05cb05e459c53e4f4d3680b | TypeScript | corbane/g3 | /worker/io/ressource.ts | 3.03125 | 3 |
"use strict"
const IS_RESOURCE = Symbol.for ("GS_RESOURCE")
interface IResource <T = any>
{
readonly isLoaded: boolean
readonly data : T|null
}
declare function loadImage <T> (url: string, callback?: (rsc: ImageBitmap) => T): IResource<T>
declare function loadText <T> (url: string, callback?: (rsc: stri... |
6e8dd42b4c1c142e895cb556feda6c70540ef1aa | TypeScript | isdenmois/beta-hd | /src/app/pipes/sort-table.pipe.ts | 2.578125 | 3 | import {Pipe, PipeTransform} from "angular2/core";
/**
* Filter task list with selected.
*/
@Pipe({name: 'tasksort'})
export class TaskListSorterPipe implements PipeTransform {
transform(collection, args) {
const [column, direction] = args;
if (column == '') {
return collection;
}
collection... |
bda1d4f34051bdaa07bbe3af33e5228f1f7f61e5 | TypeScript | Hspharwinder/CompleteNodeAngular8Project | /CrudMeanAngular8ReactiveForm/src/app/Service/authentication.service.ts | 2.515625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { BaseURL, Api } from '../path.config/Api';
import { ToastrService } from 'ngx-toastr';
import { Router } from '@angular/router';
@Injectable({
providedIn: 'root'
})
export clas... |
3c63e039363ade6be95518826cbba997f0714ee3 | TypeScript | bergur/pg-parameterize | /src/index.ts | 3.078125 | 3 |
export function toOrdinal (sqlString: string): string {
let index = 1
let ordinalString = sqlString
while (ordinalString.indexOf('?') !== -1) {
ordinalString = ordinalString.replace('?','$' + index)
index++
}
return ordinalString
}
export function flatten (arr: any[]): string {
return arr.reduce(... |
862f8b7fcb982230940206a780678d311b5fcee2 | TypeScript | sreenuyedavalli/angular | /modules/angular2/src/facade/intl.ts | 3.09375 | 3 |
// Modified version of internal Typescript intl.d.ts.
// TODO(piloopin): remove when https://github.com/Microsoft/TypeScript/issues/3521 is shipped.
declare module Intl {
interface NumberFormatOptions {
localeMatcher?: string;
style?: string;
currency?: string;
currencyDisplay?: string;
useGroupi... |
c6617b5447b4a1f1e54440cb6c762439b69a6078 | TypeScript | Ragomez33/tasky-server | /src/triggers/trigger/handler.ts | 2.78125 | 3 | /**
* This file was generated using 8base CLI.
*
* To learn more about writing custom trigger functions, visit
* the 8base documentation at:
*
* https://docs.8base.com/8base-console/custom-functions/triggers
*
* To update this functions invocation settings, update its configuration block
* in the projects 8bas... |
122d64456d58c635b46bb2d71fd54ba745def301 | TypeScript | AverzaAldo/merkdoo-test | /src/app/app.component.ts | 2.59375 | 3 | import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
errorText = '';
productName ='';
productDesc = '';
productSku = '';
products: string[][] = [];
addProduct(){
if (t... |
b68637d2f595fdb3fa44d95fa698aa7af067f6e1 | TypeScript | brayanesteves/mipsss-selasky-nodejs-angular | /backend/src/controller/UserController.ts | 2.6875 | 3 | import {getRepository} from "typeorm";
import {NextFunction, Request, Response} from "express";
import { User } from "../entity/User";
import { validate } from 'class-validator';
import * as moment from 'moment';
export class UserController {
//
static getAll = async (req: Request, res: Response) => {
... |
b81d306c257acb457591ba56486b1a3ee1334fa7 | TypeScript | BlokDenis/EVM | /packages/client/lib/net/peerpool.ts | 2.96875 | 3 | import { EventEmitter } from 'events'
import { Config } from '../config'
import { Peer } from './peer/peer'
import { RlpxServer } from './server'
export interface PeerPoolOptions {
/* Config */
config: Config
}
/**
* @module net
*/
/**
* Pool of connected peers
* @memberof module:net
* @emits connected
* @... |
27d400e6716ed334d219d61449163c244bcd3f27 | TypeScript | jeremy-coleman/gulpy | /packages/async-done/index.ts | 2.84375 | 3 | import * as domain from "domain"
import eos from "@local/end-of-stream"
import { once, isFunction } from "lodash"
import exhaust from "stream-exhaust"
import type { ChildProcess } from "child_process"
import type { EventEmitter } from "events"
import type { Stream } from "stream"
/**
* Represents a callback function... |
71c634359f276c8f14129c5b9fb718e67c539df5 | TypeScript | cloudfoundry/stratos | /src/frontend/packages/core/src/core/utils.service.ts | 2.65625 | 3 | import { Injectable } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
export function getIdFromRoute(activatedRoute: ActivatedRoute, id: string) {
if (activatedRoute.snapshot.params[id]) {
return activatedRoute.snapshot.params[id];
} else if (activat... |
a3a4fb9abd85ef40b0b8c4b79ef66e72c5ec942c | TypeScript | corinm/advent-of-code-2019 | /IntComputer/operations/index.ts | 3.390625 | 3 | import { getParameter, getParameters, setOutput } from "./helpers";
export const add = (opcode: number[], pointer: number): number[] => {
const { parameter1, parameter2 } = getParameters(opcode, pointer);
const output = parameter1 + parameter2;
const newOpcode = setOutput(opcode, pointer, output);
return newOp... |
33f69d980f5e716f29584311aa49737c6a2b8058 | TypeScript | rogermedico/activities-app | /src/app/shared/store/user/user.reducer.ts | 2.515625 | 3 | import { UserState } from './user.state';
import * as UserActions from './user.action';
import { Action, createReducer, on } from '@ngrx/store';
/* the auth state starts with no one logged in */
const defaultUserState: UserState = {
user: null,
loading: false,
loaded: true,
edited: false,
saved: false,
pro... |
9086412873c99b66740b4ae246c23088608b1e00 | TypeScript | TamuzGroup/node-express-typescript-boilerplate | /src/models/token.model.ts | 2.71875 | 3 | import { model, Document, Schema, Types, Model } from 'mongoose';
import toJSON from './plugins/toJSON.plugin';
import TokenTypes from '../config/tokens';
export interface IToken {
token: string;
user: Types.ObjectId;
type: string;
expires: string;
blacklisted: boolean;
}
// eslint-disable-next-line @typesc... |
68327735ed3d9b9b0c78aec7527b86c1e61d3d38 | TypeScript | capricorn86/happy-dom | /packages/happy-dom/test/nodes/node/Node.test.ts | 2.984375 | 3 | import Window from '../../../src/window/Window.js';
import IWindow from '../../../src/window/IWindow.js';
import IDocument from '../../../src/nodes/document/IDocument.js';
import Node from '../../../src/nodes/node/Node.js';
import HTMLElement from '../../../src/nodes/html-element/HTMLElement.js';
import HTMLTemplateEle... |
315a851e771f131523487c6ee4fc6f81859ccfca | TypeScript | albertozaranza/alurabank | /ts/models/Negotiation.ts | 2.78125 | 3 | export class Negotiation {
private _date: Date;
private _amount: number;
private _value: number;
constructor(date: Date, amount: number, value: number) {
this._date = date;
this._amount = amount;
this._value = value;
}
get date() {
return this._date;
}
get amount() {
return this._... |
30acc2a548ce9582c877ac3ee9f9800c5909b867 | TypeScript | AndrewSChapman/pandapoker | /frontend/src/domains/room/store/roomStoreProvider.ts | 2.65625 | 3 | import { getBlankRoom, RoomItem } from '@/domains/room/interfaces/RoomItem';
import { Store } from 'vuex';
import { RoomVoteOptionItem } from '@/domains/room/interfaces/RoomVoteOptionItem';
import { CreateRoomActionParams } from '@/domains/room/interfaces/CreateRoomActionParams';
import { DeleteUserFromRoomActionParams... |
2586b11cca9db1a1f0e25a4edf13d14e7be921c4 | TypeScript | CVPhelan/commander-spellbook-api-wrapper | /test/unit/models/card.test.ts | 2.90625 | 3 | /* eslint-disable @typescript-eslint/no-non-null-assertion */
import scryfall from "scryfall-client";
import Card from "../../../src/models/card";
describe("Card", () => {
it("has a name attribute", () => {
const card = new Card("Sydri, Galvanic Genius");
expect(card.name).toEqual("Sydri, Galvanic Genius");... |
e15da1b633f59bd04ce58df33da8d3b7e8150db2 | TypeScript | YIZHUANG/react-multi-carousel | /src/utils/next.ts | 3.125 | 3 | import { CarouselInternalState, CarouselProps } from "../types";
import { getSlidesToSlide } from "./common";
/*
two cases:
1. We are not over-sliding.
2. We are sliding over to what we have, that means nextslides > this.props.children.length. (does not apply to the inifnite mode)
*/
function populateNextSlides(
sta... |
94a8a8158f8fdbd030fb39283a1771caa8376d92 | TypeScript | SystemDevelopTraining/oic-sns | /server/src/domain/course/course.service.ts | 2.515625 | 3 | import { Course } from "../entities/course.entity";
import { Injectable, BadRequestException } from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";
import { CourseDto } from "../../../front/src/domain/course/CourseDto";
@Injectable()
export class CourseServic... |
666a4a7ad930ab3fe474e57e5b68fa8412af295c | TypeScript | kortkamp/ouvidoria-api | /src/__test__/unit/users/AuthenticateUserService.test.ts | 2.6875 | 3 | import CreateUserService from '@modules/users/services/CreateUserService';
import AuthenticateUserService from '@modules/users/services/AuthenticateUserService';
import FakeUsersRepository from '@modules/users/repositories/fakes/FakeUsersRepository';
let fakeUsersRepository:FakeUsersRepository;
let createUserService:C... |
cb6ccd6fc121f8534bcdba8393815b58b5ca52bb | TypeScript | Karan-Munjani/graphique | /packages/graphique/src/util/directlyStyleNodes.ts | 2.78125 | 3 | import { CSSProperties } from 'react'
interface FocusProps {
nodes: HTMLCollectionOf<SVGElement>
focusedIndex: number | number[]
focusedStyles: CSSProperties
unfocusedStyles: CSSProperties
}
interface UnfocusProps {
nodes: HTMLCollectionOf<SVGElement>
baseStyles: CSSProperties
}
export const focusNodes =... |
5a68911852471fe8e8c7c5c97b24f1e60dabaac9 | TypeScript | sandeep12407/volte1 | /lib/util.ts | 2.765625 | 3 | export const unwrap = <X>(x?: X | null, msg?: string): X => {
if (x === null || x === undefined) {
throw new Error(msg);
}
return x;
};
|
acdde2996f3234f2b226a84890b4441fcc6ea796 | TypeScript | diego-rangel/ngx-ui-hero | /projects/ngx-ui-hero/src/lib/input-forms/directives/currency/input.manager.ts | 2.8125 | 3 | export class InputManager {
private _storedRawValue: string;
constructor(private htmlInputElement: any) {
}
setCursorAt(position: number): void {
if (this.htmlInputElement.setSelectionRange) {
this.htmlInputElement.focus();
this.htmlInputElement.setSelectionRange(posit... |
a48b3f6fe6d8e374bacd07ec3d62608d7dbafedb | TypeScript | nguoianphu/phaser3-flappybird | /src/ts/prefabs/bird.ts | 2.828125 | 3 | import { Physics } from 'phaser'
import { config } from '../config'
export default class Bird extends Physics.Arcade.Sprite implements FlappyBird {
// 不能使用game属性哦
private flySound: Phaser.Sound.BaseSound
private tween: Phaser.Tweens.Tween
constructor(scene, x, y, textureKey) {
super(scene, x, y, textureKe... |
ee5ba8a252617cbbd04cca6b4bd2d1daa3b32f5f | TypeScript | DivineCross/DesignPattern | /ts/src/mediator/client.ts | 2.875 | 3 | import { CutePetTrader } from './cute-pet-trader.js';
import { Pet } from './pet.js';
import { PetMediator } from './pet-mediator.js';
import { StrongPetTrader } from './strong-pet-trader.js';
const petMediator = new PetMediator;
const cuteLucas = new CutePetTrader(petMediator, 'CuteLucas');
const cuteEhtan = new Cute... |
0e9ad7a8fbc759f1237281374fdd0861fe15a2c3 | TypeScript | bave8672/leetcode | /src/scramble-string/scramble-string.ts | 4.03125 | 4 | /**
* https://leetcode.com/problems/scramble-string/
*
* We can scramble a string s to get a string t using the following algorithm:
*
* If the length of the string is 1, stop.
* If the length of the string is > 1, do the following:
* Split the string into two non-empty substrings at a random ind... |
f62a7d6b9bb39fb879c7239e9db131ec46363e1e | TypeScript | carlosdumar/uicore | /src/hooks/useTween.ts | 3.140625 | 3 | import { useRef, useState } from 'react'
type TimingFunction = (time: number) => number
function makeEaseInOut(timing: TimingFunction): TimingFunction {
return function (time: number) {
if (time < 0.5) return timing(2 * time) / 2
else return (2 - timing(2 * (1 - time))) / 2
}
}
export const Easing = {
... |
99a8589fc8a4a03aa8f3d188aa45cf32a5052aa5 | TypeScript | AlmazKo/cosmos | /web/src/ext/promiser/types.d.ts | 3.03125 | 3 | declare type NP<T> = Exclude<T, Promise<any>>;
interface PromiseConstructor {
of<T>(value: NP<TO>): Promise<T>;
// zip<T1, T2, R>(v1: Promise<T1>, v2: Promise<T2>, accum: (p1: T1, p: T2) => R): Promise<R>;
//
// zip<T1, T2, T3, R>(v1: Promise<T1>, v2: Promise<T2>, v3: Promise<T3>, accum: (p1: T1, p2: T2, p3: ... |
3b5c18ec30bfaee20ad9c1a421e383f702afa819 | TypeScript | ludanin/groupxs | /src/order.spec.ts | 3.515625 | 4 | import "mocha";
import { expect } from "chai";
import Order from "./order";
describe("test Order constructor", () => {
it("returns a valid Order when built with an object", () => {
const order = new Order({ book1: 3, book2: 2, book3: -1, book4: undefined });
expect(order.book1).to.be.equal(3);
expect(or... |
e8d8b2f1449a5afaadf99b11956b1398e53c5950 | TypeScript | kincjf/kidskids-appclient-backup1 | /apps/ecom9/src/app/store/product/reducers/variant.reducer.ts | 2.640625 | 3 | import { createEntityAdapter, EntityState, EntityAdapter } from '@ngrx/entity';
import { VariantActions, VariantActionTypes } from '../actions/variant.actions';
import { ProductVariant } from '@ecom9/models';
export interface State extends EntityState<ProductVariant> {
isLoading: boolean;
error: any;
}
export... |
b1c3680115e9410ed08e455e4315c9ac55ed99b3 | TypeScript | jaburns/tsynth | /src/newNodes/adsr.ts | 2.734375 | 3 | import { NodeDef, UpdateFunc } from "newNodes";
const JUMP_LERP_TIME = 0.003; // Seconds.
// TODO Assert bufferLength > JUMP_LERP_TIME * sampleRate
export const ADSRDef : NodeDef = {
descriptor: ({
inputSignals: ['sync', 'input'],
outputSignals: ['output'],
knobs: [
{ label: 'a... |
8d0ceb1b403835f63882c2da1349d0f3886d64ed | TypeScript | ricardosn87/_GIT | /EstudoAngular/products-app/src/app/product.service.ts | 2.640625 | 3 | import { Injectable, EventEmitter } from '@angular/core';
import { Product } from './models/product.model';
import { DepartamentService } from './departament.service';
@Injectable({
providedIn: 'root'
})
export class ProductService {
private nextID: number
onNewProduct: EventEmitter<Product> = new EventEmitter... |
eb08f576cf45c7585ea537781bb3e26dcbe194ba | TypeScript | eliseuvideira/ev-fns__gzip | /test/index.test.ts | 2.921875 | 3 | import fs from "fs";
import path from "path";
import { gzip } from "../src";
describe("gzip", () => {
it("gzips a file", async () => {
expect.assertions(3);
const content = "file content".repeat(5);
const filename = path.join(__dirname, Date.now().toString());
const gzipFilename = filename + ".gz";... |
f7bba57f3e61d3939c9dd8804a4604af16df2d97 | TypeScript | SwingDev/table-soccer-backend | /src/common/crud.service.ts | 2.765625 | 3 | import { FindManyOptions, Repository } from 'typeorm';
/**
* Base class for all services based on crud
*/
export class CRUDService<E, K=number> {
constructor(protected readonly repository: Repository<E>) { }
public async save(entity: E): Promise<E> {
return this.repository.save(entity);
}
public async ... |
05d274b9af1f79bda7ad0b397f47d51169226533 | TypeScript | typestack/routing-controllers | /src/metadata-builder/MetadataArgsStorage.ts | 2.6875 | 3 | import { ControllerMetadataArgs } from '../metadata/args/ControllerMetadataArgs';
import { ActionMetadataArgs } from '../metadata/args/ActionMetadataArgs';
import { ParamMetadataArgs } from '../metadata/args/ParamMetadataArgs';
import { ResponseHandlerMetadataArgs } from '../metadata/args/ResponseHandleMetadataArgs';
i... |
ebcbbaccb19ef6cf464d36064ccfb425eb0e149a | TypeScript | ShivrajRath/cbsera12 | /collection.ts | 3.3125 | 3 | /**
* Collection class, container for student and subject collection
* http://stackoverflow.com/questions/30174078/how-to-define-singleton-in-typescript
*/
import {
Student
} from 'Student';
import {
Subject
} from 'Subject';
import {
Constant
} from 'Constant';
export class Collection {
private ... |
65b395cfd30d05de69ee733bb43d2ef40a02c125 | TypeScript | MrRefactoring/jira.js | /src/version2/parameters/getSelectableIssueFieldOptions.ts | 2.71875 | 3 | export interface GetSelectableIssueFieldOptions {
/** The index of the first item to return in a page of results (page offset). */
startAt?: number;
/** The maximum number of items to return per page. */
maxResults?: number;
/** Filters the results to options that are only available in the specified project. ... |
84c537affc5fdd49365d044fc9b620a42e2fcd0d | TypeScript | ManivannaBalaji/HiringApp-Angular | /src/app/service/job.service.ts | 2.625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class JobService {
constructor(private httpClient : HttpClient) { }
/**
* Get all available job offers
*/
getJobOffers(){
let url = "http://localhost:3000/api/jo... |
01d45d694b182341343cb89b0db6b47f07646e27 | TypeScript | tawaship/Pixim.js | /src/modules/Container.ts | 2.625 | 3 | import * as PIXI from 'pixi.js';
import { Task } from './Task';
//import { TaskManager } from './TaskManager';
import { ITickerData } from './Application';
export interface IContainerData {
task: Task,
taskEnabledChildren: boolean
}
/**
* @ignore
*/
let _lastObserverID = 0;
/**
* [[http://pixijs... |
65208199ed2f6d05410eaf3ac30f48544c0db326 | TypeScript | thutterer/veue | /app/javascript/controllers/user_menu_controller.ts | 2.65625 | 3 | import { Controller } from "stimulus";
import { debounce } from "util/debounce";
export default class extends Controller {
static targets = ["area", "menu"];
areaTarget!: HTMLDivElement;
menuTarget!: HTMLDivElement;
isOpen = false;
connect(): void {
this.isOpen = false;
this.layout();
}
@deboun... |
72988b3f30e5f099c63d04867ea67f1ad00c57b1 | TypeScript | MapGIS/MapGIS-Mobile-React-Native | /src/geodatabase/QueryDef.ts | 2.828125 | 3 | /**
* @content 查询条件定义功能组件
* @author fangqi 2021-09-16
*/
import ObjectManager from "../components/ObjectManager";
import type Dot from "../geoobject/Dot";
import Geometry from "../geoobject/Geometry";
import type Rect from "../geoobject/Rect";
/**
* @class QueryDef
* @description 扩展字段头
*/
export d... |
294f1ffd0c0fc94d77fb59e75df48d6f43b26007 | TypeScript | chadhietala/castle | /packages/avro-ts-cli/test/avro/ComplexRecord.avsc.ts | 2.9375 | 3 | /* eslint-disable @typescript-eslint/no-namespace */
export type User = ComExampleAvro.User;
export namespace ComExampleAvro {
export const FooName = "com.example.avro.Foo";
export interface Foo {
label: string;
}
export const EmailAddressName = "com.example.avro.EmailAddress";
/**
* ... |
6b26c63d0987ab83718de75517a4f7e30ff33c9d | TypeScript | pedroribeiro89/pizza-nest-prisma | /src/pizza/pizza.controller.ts | 2.578125 | 3 | import { Controller, Get, Logger, Param, Query } from "@nestjs/common";
import { Pizza } from '@prisma/client';
import { PizzaService } from './pizza.service';
@Controller('pizzas')
export class PizzaController {
private readonly logger = new Logger(PizzaController.name);
constructor(private readonly pizzaService... |
8ff5c13f694c937e0ac87606ddc75903a83967a9 | TypeScript | gache/CRUD-avec-Firebase | /src/app/pages/models/heroe.model.ts | 2.515625 | 3 |
export class HeroeModel {
id: string;
Prenom: string;
pouvoir: string;
vivant: boolean;
// j'initialise la propriété vivant par défaut va être true c'est dire vivant
constructor() {
this.vivant = true;
}
}
|
1c33e06ca2b25c8134bba258de9b74741868d24e | TypeScript | vesanieminen/web-components | /packages/grid/src/vaadin-grid-active-item-mixin.d.ts | 2.5625 | 3 | /**
* @license
* Copyright (c) 2021 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
declare function ActiveItemMixin<TItem, T extends new (...args: any[]) => {}>(
base: T
): T & ActiveItemMixinConstructor<TItem>;
interface ActiveItemMixinCons... |
56a068b301441bc4950f8bb491dd775e70530a0b | TypeScript | 1thanatos/qi | /src/qi/graphics/vertexs.ts | 2.796875 | 3 | import {Graphics} from "qi/graphics";
import {Point} from "qi/base/point";
import {can} from "qi/can";
import {Vector} from "qi/base/vector";
class Vertexs{
grap:Graphics
points:Array<Point>=[]
constructor(grap:Graphics) {
this.grap=grap
}
// according to points and transform.draw the graph... |
35326fa6b810ec418fd1a2d120da826f86db04d6 | TypeScript | MichaelShipitsyn/event-crm | /src/store/cache/selector.ts | 2.671875 | 3 | import { RootState } from 'store';
const isRootState = (state: unknown): state is RootState => {
return !!(state as RootState);
};
export const isCached = (url: string) => (state: RootState) => {
return state.cache.cache.includes(url);
};
export const getCache = (state: unknown) => {
if (isRootState(state)) {
... |
1d49a2b8f6323e477bb091e48e404851c31077e3 | TypeScript | xiaoyi20/game-globaltravel | /assets/scripts/hall/game/effect/LoadingTip.ts | 2.5625 | 3 |
import { LanguageLabel } from "../../../core/language/LanguageLabel";
import { ComponentExtends } from "../../../core/ui/ComponentExtends";
const { ccclass, property } = cc._decorator;
@ccclass
export default class LoadingTip extends ComponentExtends {
/** 获取begin到length的随机数 整数 */
public getRandomNum = func... |
f2ee8a2372fe7771d3d3e3aa0615bbcf062a510c | TypeScript | dudewith3faces/symply-frontend | /src/components/services/main.service.ts | 2.921875 | 3 | import axios from "axios";
import { useEffect, useState } from "react";
import { IFact, IResponse } from "../interface";
export const HomeService = () => {
const [facts, setFacts] = useState<IFact[]>([]);
const getFacts = async (): Promise<IFact[]> => {
const { data } = await axios.get<{ text: string; _id: st... |
2e074d0f4d281865c241f0e3510548a54549652a | TypeScript | apiatin/keycloak-admin-ui | /src/utils/useRequiredContext.ts | 3.25 | 3 | import { useContext } from "react";
import type { Context } from "react";
/**
* Passes the call to `useContext` and throw an exception if the resolved value is either `null` or `undefined`.
* Can be used for contexts that are required and should always have a non nullable value.
*
* @param context The context to p... |
ebe095d4d09e1adeb2caa257c9be89ab958667a9 | TypeScript | spacerkt/nestjs-util | /lib/merge-one-to-many.util.ts | 3.296875 | 3 | /***
* mergeManyToOneEntity - Used to map an array of Entity2 to a property in an Entity1
* Entity2 should have a foreign key to Entity1
* @param entities1 array of entities
* @param e1PK primary key of entitie1
* @param e1Prop which property of entitie1 will receive the array of entities2
* @param entities2 arra... |
3a481a471bb99b720d04f6801aeeb1ea6ea13d6b | TypeScript | zirman/aoc2017 | /src/day11.ts | 3.203125 | 3 | import fs from 'fs';
export {};
fs.readFile('../input/day11.txt', 'utf8', (err, contents) => {
if (err !== null) {
console.error(err);
return;
}
let max = 0;
const ds = contents.split(',');
let i = 0;
let j = 0;
for (const d of ds) {
switch (d) {
case 'n':
j += 1;
break;
... |
9c0ecac534d5924069a696b44c68bed1cb232440 | TypeScript | deyvidholz/letsshopping-api | /src/interceptors/product-request.interceptor.ts | 2.6875 | 3 | import { NextFunction, Request, Response } from 'express';
import unprocessableEntity from '../errors/http/unprocessable-entity.error';
import { HandlerReturn } from '../types/middlewares/interceptors/handler-return.types';
export class ProductRequestInterceptor {
public static handler(req: Request): HandlerReturn {... |
4f22646e3af15b6f35c714199bd5c01e27183eb7 | TypeScript | jjvainav/sprig | /packages/store/test/store.test.ts | 3.25 | 3 | import { combineHandlers, createStore, IAction, IActionHandler, IStore, IStoreOptions, mapHandlers } from "../src";
interface IItem {
readonly id: string;
readonly value: string;
}
interface IState {
readonly items: IItem[];
}
interface IAddItem extends IAction {
readonly type: "add-item";
reado... |
65714788bd4a77cbe07e13afaa09bfe042b3ef29 | TypeScript | murilovmachado/deck-of-cards-ui | /src/services/cards-service.ts | 2.640625 | 3 | import fetchApi from './fetchApi';
type RequestDeckResponse = {
success: boolean;
deck_id: string;
shuffled: boolean,
remaining: number;
}
type Card = {
image: string;
value: string;
suit: string;
code: string;
};
export type DrawCardResponse = {
success: boolean;
cards: Card[];
deck_id: string... |
4821cc0972af861c148b74969729d5624beb26a3 | TypeScript | chris510/Clouds | /src/app/city.model.ts | 2.671875 | 3 | export class City {
name: string;
temp: string;
pressure: string;
description: string;
windSpeed: string;
windDegree: string;
}
export interface cityWeather {
name: string,
temp: string;
pressure: string;
description: string;
windSpeed: string;
windDegree: string;
} |
6619aa7f283408bf83c66f0d0caa83834d2d60c3 | TypeScript | AlmeidaIgorCarlos/uSoftware-bayer-back | /src/auth/auth.service.ts | 2.6875 | 3 | import { Injectable } from '@nestjs/common';
import { UserService } from 'src/user/user.service';
import { JwtService } from '@nestjs/jwt';
import { InUserDto } from 'src/dto/in-user.dto';
@Injectable()
export class AuthService {
constructor(
readonly userService: UserService,
readonly jwtService: ... |
f1cc781be0a9c1c3b07dd6e4d992f82a8e3a9820 | TypeScript | sciffany/cadet-frontend | /src/features/game/layer/GameLayerManager.ts | 2.765625 | 3 | import { defaultLayerSequence, Layer } from './GameLayerTypes';
import { fadeIn } from '../effects/FadeEffect';
import { Constants } from '../commons/CommonConstants';
import GameActionManager from 'src/features/game/action/GameActionManager';
import { sleep } from '../utils/GameUtils';
type Container = Phaser.GameObj... |
21b53b21e363b8fae973a3a1cf37c43354ea246c | TypeScript | B10715018/ticketing | /nats-test/src/publisher.ts | 2.59375 | 3 | import nats from 'node-nats-streaming';
import {TicketCreatedPublisher} from './events/ticket-created-publisher';
console.clear();
//stan === client
const stan=nats.connect('ticketing','abc',{
url:'http://localhost:4222',
});
//listener
stan.on('connect',async()=>{
console.log('Publisher connected to NATs');
c... |
b5df4509f1eb539815328bc6ab0fa636dbc1584c | TypeScript | ksquareincmx/ks-hire-backend | /app/controllers/v1/Location.ts | 2.640625 | 3 | import { Router, Request, Response } from "express";
import { Controller } from "../../libraries/Controller";
import { Countries } from "../../models/Countries";
import { States } from "../../models/States";
import { Cities } from "../../models/Cities";
export class LocationController extends Controller {
constructor... |
d85c346a48ed6063792f3e5fd8e3956a9df04ab5 | TypeScript | ha-nagisa/BunBunBIKE | /src/store/slices/loggedInUserPhotosSlice.ts | 2.609375 | 3 | import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { responcePhotoDataWithUserInfo } from '../../models/responceData';
interface UpdatePhotoActionType {
docId: string;
title: string;
description: string;
workImageUrl: string;
category: string;
workMoney: string;
workHours: string;
}
i... |
06d3051e55c5bc0f0163332bc12d2a13f5d1e113 | TypeScript | mzpkjs/prototypes | /visual-layer-editor/lib/Core/Behaviour/RotatableBehaviour.ts | 2.796875 | 3 | import { throttle } from "../common"
import Shape from "../Shape/Shape"
class RotatableBehaviour {
private readonly _target: Shape
private readonly _state = {
initialized: null,
active: false,
cursor: ""
}
public static enabled = true
constructor(target: Shape) {
... |
3e3c48b7a1304073d1ea3cabe644872ca215dd90 | TypeScript | tcgdex/cards-database | /data/Sun & Moon/Celestial Storm/9.ts | 2.53125 | 3 | import { Card } from '../../../interfaces'
import Set from '../Celestial Storm'
const card: Card = {
name: {
en: "Grovyle",
fr: "Massko",
es: "Grovyle",
it: "Grovyle",
pt: "Grovyle",
de: "Reptain"
},
illustrator: "Shin Nagasawa",
rarity: "Uncommon",
category: "Pokemon",
set: Set,
dexId: [
253,
]... |
27689f69cf4d1b55a6b5f9139687ef20579b9a12 | TypeScript | sabinmarcu/memorize | /packages/config/src/utils.ts | 2.890625 | 3 | import {
KeyValue,
KV,
Obj,
ConfigID,
IConfig,
IsSetterKey,
IsDynamicKey,
IsProxyKey,
IsOwnKey,
OnlySetters,
OnlyDynamicSetters,
OnlyProxies,
PropertyToSetter,
OwnPropertyKey,
PropertiesToObject,
} from './types';
export const propertyToSetter = <
S extends OwnPropertyKey,
>(
property... |
fc260f0f93c42afc9dfd50e9259267c1bf8f42d7 | TypeScript | JohanG2012/scrape-helpers | /src/fs-helpers.ts | 3.0625 | 3 | import fs from "fs";
import { readdirSync, statSync } from "fs";
import { join } from "path";
export const copyFile = (source: string, dest: string): Promise<any> =>
new Promise((resolve, reject) => {
fs.copyFile(source, dest, err => {
if (err) return reject(err);
return resolve();
});
});
exp... |
d9cfc34658a775d3eb38da48239a7354f3287793 | TypeScript | VictorGabriel-Oliveira/letmeask | /src/hooks/useRoom.ts | 2.75 | 3 |
import { useState , useEffect, useContext} from "react"
import { AuthContext } from "../contexts/AuthContext"
import { data } from '../services/firebase'
type QuestionsType = {
id:string,
author:{
name:string,
avatar:string,
},
content:string,
isAnswered:boolean,
isHighlighted... |
1a3caac77141237e3061fb3601fdc9042b2a5611 | TypeScript | NalinLuthra/rx-player | /src/core/fetchers/segment/segment_fetcher_creator.ts | 2.609375 | 3 | /**
* Copyright 2015 CANAL+ Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
2b482594736f3bc8c1dc06d316f4ba2f88efe525 | TypeScript | NickCaminer/dgraph-orm | /src/metadata/with-facet.ts | 2.6875 | 3 | import { Constructor } from '../utils/class';
export class WithFacetMetadata {
constructor(readonly args: WithFacetMetadata.IArgs) {
//
}
}
export namespace WithFacetMetadata {
export interface IArgs {
/**
* Target class which the facet is added to.
*/
target: Object;
/**
* Name ... |
937aff89955ce9f4c0996850109f83bfdf91fed4 | TypeScript | tcgdex/cards-database | /data/Sun & Moon/Unbroken Bonds/233.ts | 2.640625 | 3 | import { Card } from '../../../interfaces'
import Set from '../Unbroken Bonds'
const card: Card = {
name: {
en: "Pokégear 3.0",
fr: "Pokématos 3.0",
es: "Pokégear 3.0",
it: "Pokégear 3.0",
pt: "Pokégear 3.0",
de: "Pokécom 3.0"
},
illustrator: "Studio Bora Inc.",
rarity: "Secret Rare",
category: "Trai... |
b21631c4068227e1f2ec747785ea03bb39cafde1 | TypeScript | jorgecasar/pwa-auth | /src/google-provider.ts | 2.5625 | 3 | import { SignInResult } from "./signin-result";
export class GoogleProvider {
private resolve: ((result: SignInResult) => void) | null = null;
private reject: ((error: any) => void) | null = null;
static readonly apiUrl = "https://apis.google.com/js/api:client.js";
constructor(private clientId: stri... |
485b7e830ce21bee0a38cb00a0baa3e072fcf087 | TypeScript | chrisd08/typescript-observable | /src/observable.ts | 3.203125 | 3 | import "core-js/es6/promise";
import "core-js/es6/array";
import "core-js/es6/set";
import {
IObservable,
IObserverItem,
IObservableEvent,
ObserverCallback,
IObserver,
ICancel,
ObservableEventType,
} from ".";
/**
* Check if the item is of type IObservableEvent
* @param tested is the parameter to be te... |
3611ab2b2fff5161d7165d3660a0ff5cd56f0039 | TypeScript | olimorri/codehort | /server/src/task/task.controller.ts | 2.625 | 3 | import {
Body,
Controller,
Get,
Param,
Post,
NotFoundException,
InternalServerErrorException,
} from '@nestjs/common';
import { TaskDto } from './dto/task.dto';
import { TaskService } from './task.service';
@Controller('task')
export class TaskController {
constructor(private taskService: TaskService) ... |
95d7ca9cb97b5c91d6990428fa68bd720664d9e2 | TypeScript | WendyChenj/burger-queen | /src/common/store/customBurgerStore/customBurgerReducer.ts | 2.84375 | 3 | import { Meat, Vegetable, BurgerState, Cheese, Sauce } from '../../models/customBurgerTypes';
import {
CustomBurgerActionTypes,
CHOOSE_BURGER_BREAD,
ADD_BURGER_MEAT,
REMOVE_BURGER_MEAT,
ADD_BURGER_VEGETABLE,
REMOVE_BURGER_VEGETABLE,
ADD_BURGER_CHEESE,
REMOVE_BURGER_CHEESE,
ADD_BURGER_SAUCE,
REMOVE_B... |
595434a543950ee2c004aafd38c9d3beac4f0863 | TypeScript | outdatedpizzatech/2djs | /src/reducers/player_reducer.ts | 2.734375 | 3 | import { GameState } from "../game_state";
import { GRID_INTERVAL } from "../common";
import { Direction, getModsFromDirection } from "../direction";
import { isPlayer, Player, playerFactory } from "../models/player";
import { GameObject } from "../game_object";
import { cloneDeep } from "../clone_deep";
export const ... |
d30550029e5d178f043dbff6b6ba42fdb5104501 | TypeScript | kierstone/RamenRanger | /RamenRanger/src/scene/msgdlg/horizontalFoodCourt/HorizontalFoodCourt_DishButton.ts | 2.515625 | 3 | class HorizontalFoodCourt_DishButton extends eui.Component implements eui.UIComponent {
private Label_Name:eui.Label;
private Group_Ramen:eui.Group;
private dishSpr:RamenSprite;
private Rect_ColorSign:eui.Rect;
private Button_Eat:eui.Button;
private Group_Buddy:eui.Group;
private Group_Ingredient:eui.Group;
p... |
b6b501de792c2ce89786e3e497a495a46780ecbc | TypeScript | homebridge/homebridge-examples | /static-platform-example-typescript/src/static-platform.ts | 3.09375 | 3 | import {AccessoryPlugin, API, HAP, Logging, PlatformConfig, StaticPlatformPlugin,} from "homebridge";
import {ExampleSwitch} from "./switch-accessory";
const PLATFORM_NAME = "ExampleStaticPlatform";
/*
* IMPORTANT NOTICE
*
* One thing you need to take care of is, that you never ever ever import anything directly f... |
045f6a434a7dd96672b82aed758064602b01a35f | TypeScript | KohlerAl/EIA2 | /Endabgabe/Form.ts | 2.828125 | 3 | namespace EIA2_Endabgabe {
export enum FORM_MOVE {
ROTATE = "rotate",
MOVE = "move"
}
export abstract class Form {
public color: string;
public size: Vector;
public position: Vector;
public rotation: number;
public moveType: FORM_MOVE;
public a... |
ecbfd283a6e64bb3f96a843cf8004e3ac763ba3a | TypeScript | Maxouize/ControlCare | /src/app/core/models/Fichier.ts | 2.90625 | 3 | export class Fichier {
idFichier: number;
nomFichier: string;
fichier: Blob;
}
export const createFichier = <T extends Partial<Fichier>>(initialValues: T): Fichier & T => {
return Object.assign(emptyFichier(), initialValues);
};
export const emptyFichier = (): Fichier => ({
idFichier: null,
no... |
9743c51d08b6cf3101fc0fd429731f8914474140 | TypeScript | jamesmanning/emotes | /ts/spec/EmoteFlags.spec.ts | 2.578125 | 3 | /// <reference path="../typings/mocha/mocha.d.ts" />
/// <reference path="../typings/should/should.d.ts" />
var should = require('should');
import EmoteFlags from '../EmoteFlags';
describe('EmoteFlags', () => {
describe('#getSpeedForDescription', () => {
it('should work for a valid description', ()... |
e435dae50ece9371a760fcac1bb5a28cc58fc203 | TypeScript | zcorky/zodash | /packages/extend/src/index.ts | 3.75 | 4 | /**
* Copy all of the properties in the source objects over to the destination object
*
* @param origin Origin Object
* @param sources Source Objects
* @returns New Object based Origin Object
*
* @example
* extend({ name: 'Any' }, { age: 18 }); // => { name: 'Any', age: 18 }
*/
export function extend<T = any>... |
8e2c626d3455cd179a3dc522e2e00ded110c7ca0 | TypeScript | a572251465/webpack5-vue3-demo | /src/assets/js/lodash.ts | 2.578125 | 3 | const merge = require('single-merge')
interface ICommon {
name: string
age: number
}
interface ICommon1 {
address: string
}
interface IMerge {
merge: (data: ICommon1, data1: ICommon) => ICommon1 & ICommon
}
const _: IMerge = {
merge
}
export default _
|
53b484f7396c3c502cb492005ad5289187942bbe | TypeScript | leonardfactory/advent-of-code-2020 | /src/day-2/part-2.ts | 3.265625 | 3 | import fs from 'fs';
let input = fs.readFileSync(__dirname + '/input.txt', 'utf-8');
let test = fs.readFileSync(__dirname + '/input-test.txt', 'utf-8');
function parse(data: string) {
const lines = data.split('\n');
return lines.map(parseRow);
}
const REGEX = /^(\d+)\-(\d+) (\w): (\w+)$/;
function parseRow(row:... |
a51bd93e83bc803345bea89d2dc542ba57f0a680 | TypeScript | whatasoda/the-pen | /src/shared/complete-axis.ts | 2.625 | 3 | import { vec3 } from 'gl-matrix';
const INDICES = [0, 1, 2];
const completeAxis = (outX: vec3, outY: vec3, outZ: vec3, inZ: number[]) => {
const absZ = [...inZ].map(Math.abs);
const [i0, i1, i2] = [...INDICES].sort((a, b) => absZ[a] - absZ[b]);
vec3.normalize(outZ, inZ);
const sign = -(Math.sign(outZ[i0]) *... |
a0074bf01daf2d29271c992ade6568781bf70956 | TypeScript | camifernweh/booksplorer | /lib/utils/strings.ts | 3.03125 | 3 | import { Country, Book } from '../types';
export const getTitleString = (
title: string | string[] | undefined,
): string => {
let titleString = 'Booksplorer';
if (title) {
titleString += ' | ';
if (Array.isArray(title)) {
titleString += title.join(' | ');
} else {
titleString += title;
... |
d09d4d75cfcfba56f472bacd8749ee91f0d4eedc | TypeScript | Ahmed-Salama/YetAnotherPhysicsEngine | /src/game_level_manager.ts | 2.78125 | 3 | import GameElement from "./game_element";
import Constants from "./constants";
import GameLevel from "./game_level";
export default class GameLevelManager extends GameElement {
public original_game_level: GameLevel;
public current_game_level: GameLevel;
public finished: boolean;
constructor(initial... |
86950f7927da6552e6204fefb36c98095aab78ee | TypeScript | N0XIRE/xivanalysis | /src/parser/core/modules/FFLogsEventNormaliser.ts | 2.828125 | 3 | import {Event} from 'fflogs'
import Module from 'parser/core/Module'
const CALCULATED_EVENTS: Array<Event['type']> = [
'calculateddamage',
'calculatedheal',
]
const BASELINE_EVENTS: Array<Event['type']> = [
'damage',
'heal',
]
export class FFLogsEventNormaliser extends Module {
static handle: string = 'fflogsEv... |
8cc05dc7b41de5dba83ec661147bee3bc781b486 | TypeScript | gaohejin/ynm3000 | /src/after.ts | 2.90625 | 3 | /**
* n次之后都会被执行
* @param n
* @param func
*/
function after(n, func) {
if (typeof func !== 'function') {
throw new TypeError('Excepted function')
}
n = n || 0
return function (...args) {
if (--n < 1) {
return func.apply(this, args)
}
}
}
export default after
|
2f1d2b9e7e353410d42ca98d151fef1faefad748 | TypeScript | GrubbyHunter/LeetCode | /Dynamic programming/hard/309.最佳买卖股票时机含冷冻期.ts | 3.59375 | 4 | /*
* @lc app=leetcode.cn id=309 lang=typescript
*
* [309] 最佳买卖股票时机含冷冻期
*/
// @lc code=start
function maxProfit(prices: number[]): number {
// 当天的状态,持有、不持有、冻结
let dp = new Array(prices.length).fill(0).map(() => new Array(3).fill(0))
dp[0][0] = -prices[0] // 第一天持有,挣的钱为-prices[0]
dp[0][1] = 0 // ... |