type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
FunctionDeclaration
export function transformInertiaVector(transform: Transform, inertiaVector: Vector3, mass: number): Matrix3x3 { const sqrd = calculateSqrdComponentsFromInertiaVector(inertiaVector); const rotatedComponents = transformSqrdComponentsByMatrix3x3(transform.orientation, sqrd); const translatedComponents = calculateTrans...
flurrux/rigidbody-rotation-sim
lib/inertia-tensor-transformation.ts
TypeScript
TypeAliasDeclaration
type Matrix3x3 = Matrix3;
flurrux/rigidbody-rotation-sim
lib/inertia-tensor-transformation.ts
TypeScript
ArrowFunction
() => { it("can be constructed with default fees", async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const openedClient = (client as un...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const openedClient = (client as unknown) as PrivateSigningStargateClient; expect(op...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const registry = new Registry(); registry.register("/custom.MsgCustom", MsgSend); const options = { registry: registry }; const client = await SigningStargateClient.conn...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const gasPrice = GasPrice.fromString("3.14utest"); const options = { gasPrice: gasPrice }; const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, w...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const gasLimits = { send: 160000, delegate: 120000, }; const options = { gasLimits: gasLimits }; const client = await SigningStargateClient.connectWithSi...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const gasPrice = GasPrice.fromString("3.14utest"); const gasLimits = { send: 160000, }; const options = { gasPrice: gasPrice, gasLimits: gasLimits }; const...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
() => { it("works with direct signer", async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const transferAmount = coins(7890, "ucosm"); ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const transferAmount = coins(7890, "ucosm"); const beneficiaryAddress = makeRandom...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const transferAmount = coins(7890, "ucosm"); const beneficiaryAddress = makeRandomAddres...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
() => { it("works", async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg = MsgDelegate.fromPartial({ delega...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg = MsgDelegate.fromPartial({ delegatorAddress: faucet.address...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await ModifyingDirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg = MsgDelegate.fromPartial({ delegatorAddress: fauce...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msgSend: MsgSend = { fromAddress: faucet.address0, toAddress...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msgDelegate: MsgDelegate = { delegatorAddress: faucet.address0, ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const customRegistry = new Registry(); const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate"; interface CustomMsgDelegate { customDelegatorAddress?: ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
({ customDelegatorAddress, customValidatorAddress, customAmount, }: CustomMsgDelegate): AminoMsgDelegate["value"] => { assert(customDelegatorAddress, "missing customDelegatorAddress"); assert(customValidatorAddress, "missing ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
({ delegator_address, validator_address, amount, }: AminoMsgDelegate["value"]): CustomMsgDelegate => ({ customDelegatorAddress: delegator_address, customValidatorAddress: validator_address, customAmount: Coin....
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await ModifyingSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg: MsgDelegate = { delegatorAddress: faucet.address0, ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
() => { it("works", async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg = MsgDelegate.fromPartial({ delega...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg = MsgDelegate.fromPartial({ delegatorAddress: faucet.address...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await ModifyingDirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg = MsgDelegate.fromPartial({ delegatorAddress: fauce...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msgSend: MsgSend = { fromAddress: faucet.address0, toAddress...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msgDelegate: MsgDelegate = { delegatorAddress: faucet.address0, ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic); const customRegistry = new Registry(); const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate"; interface CustomMsgDelegate { customDelegatorAddress?: ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ArrowFunction
async () => { pendingWithoutSimapp(); const wallet = await ModifyingSecp256k1HdWallet.fromMnemonic(faucet.mnemonic); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, wallet); const msg: MsgDelegate = { delegatorAddress: faucet.address0, ...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
InterfaceDeclaration
interface CustomMsgDelegate { customDelegatorAddress?: string; customValidatorAddress?: string; customAmount?: Coin; }
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
MethodDeclaration
// Adapted from autogenerated MsgDelegate implementation encode( message: CustomMsgDelegate, writer: protobuf.Writer = protobuf.Writer.create(), ): protobuf.Writer { writer.uint32(10).string(message.customDelegatorAddress ?? ""); writer.uint32(18).string(message...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
MethodDeclaration
decode(): CustomMsgDelegate { throw new Error("decode method should not be required"); }
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
MethodDeclaration
fromJSON(): CustomMsgDelegate { throw new Error("fromJSON method should not be required"); }
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
MethodDeclaration
fromPartial(object: DeepPartial<CustomMsgDelegate>): CustomMsgDelegate { const message = { ...baseCustomMsgDelegate } as CustomMsgDelegate; if (object.customDelegatorAddress !== undefined && object.customDelegatorAddress !== null) { message.customDelegatorAddress = object.customDe...
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
MethodDeclaration
toJSON(): unknown { throw new Error("toJSON method should not be required"); }
AlexBHarley/cosmjs
packages/stargate/src/signingstargateclient.spec.ts
TypeScript
ClassDeclaration
class Rental { public movie: Movie; public days: number; constructor(movie: Movie, days: number) { this.movie = movie; this.days = days; } public getRentalPrice(): Money { const moviePrice = this.movie.price; return this.computeRentalPrice( moviePrice.b...
kwirke/webflix-js-ports-adapters
src/domain/model/Rental.ts
TypeScript
MethodDeclaration
public getRentalPrice(): Money { const moviePrice = this.movie.price; return this.computeRentalPrice( moviePrice.basePrice, moviePrice.pricePerExtraDay, this.movie.rentalDays, this.days); }
kwirke/webflix-js-ports-adapters
src/domain/model/Rental.ts
TypeScript
MethodDeclaration
public getFrequentRenterPoints(): number { if (this.days < this.movie.frequentRenterMinimumDays) { return this.movie.frequentRenterBasePoints; } else { return this.movie.frequentRenterPointsForExtraDays; } }
kwirke/webflix-js-ports-adapters
src/domain/model/Rental.ts
TypeScript
MethodDeclaration
public computeRentalPrice(basePrice: Money, pricePerExtraDay: Money, minimumRentalDays: number, daysRented: number): Money { if (daysRented <= 0) { throw new Error('daysRented must be higher than zero'); ...
kwirke/webflix-js-ports-adapters
src/domain/model/Rental.ts
TypeScript
ClassDeclaration
@Injectable() export class DeleteAccountByIdService { constructor( private readonly publisher: EventPublisher, private readonly repository: IAccountRepository, ) {} async main( id: AccountId, constraint?: QueryStatement, cQMetadata?: CQMetadata, ): Promise<void>...
techedge-group/aurora-cli
src/templates/packages/back/o-auth/src/@apps/iam/account/application/delete/delete-account-by-id.service.ts
TypeScript
MethodDeclaration
async main( id: AccountId, constraint?: QueryStatement, cQMetadata?: CQMetadata, ): Promise<void> { // get object to delete const account = await this.repository.findById(id, { constraint, cQMetadata }); // it is not necessary to pass the constraint in the delet...
techedge-group/aurora-cli
src/templates/packages/back/o-auth/src/@apps/iam/account/application/delete/delete-account-by-id.service.ts
TypeScript
ArrowFunction
() => { it('is rule', () => { assert.instanceOf(new Factor(0), AbstractRule); }); it('values is valid', () => { assert.isTrue(new Factor(1).validate('1')); assert.isTrue(new Factor(6).validate('1')); assert.isTrue(new Factor(1).validate(1)); assert.isTrue(new Facto...
cknow/awesome-validator
test/rules/factor.ts
TypeScript
ArrowFunction
() => { assert.instanceOf(new Factor(0), AbstractRule); }
cknow/awesome-validator
test/rules/factor.ts
TypeScript
ArrowFunction
() => { assert.isTrue(new Factor(1).validate('1')); assert.isTrue(new Factor(6).validate('1')); assert.isTrue(new Factor(1).validate(1)); assert.isTrue(new Factor(2).validate(1)); assert.isTrue(new Factor(2).validate(2)); assert.isTrue(new Factor(3).validate(1)); ...
cknow/awesome-validator
test/rules/factor.ts
TypeScript
ArrowFunction
() => { assert.isFalse(new Factor(1).validate(1.1)); assert.isFalse(new Factor(1).validate(-1.1)); assert.isFalse(new Factor(1).validate('0.2')); assert.isFalse(new Factor(1).validate('.2')); assert.isFalse(new Factor(1).validate('-.2')); assert.isFalse(new Factor(1).val...
cknow/awesome-validator
test/rules/factor.ts
TypeScript
FunctionDeclaration
export function setup(router: CuriRouter) { const _initial = router.current(); _navAndresp.navigation = _initial.navigation; _navAndresp.response = _initial.response; return router.observe(({ response, navigation }) => { _navAndresp.navigation = navigation; _navAndresp.response = response; }); }
danhtran94/vue-project-template
lib/curi-router-plugin/router.ts
TypeScript
ArrowFunction
({ response, navigation }) => { _navAndresp.navigation = navigation; _navAndresp.response = response; }
danhtran94/vue-project-template
lib/curi-router-plugin/router.ts
TypeScript
ClassDeclaration
export default class UsersController { public async create(request: Request, response: Response): Promise<Response> { try { const { name, email, password } = request.body; const createUser = container.resolve(CreateUserService); const user = await createUser.execute({ name, email, password })...
ruandsx/gobarber-backend
src/modules/users/infra/http/controllers/UsersController.ts
TypeScript
MethodDeclaration
public async create(request: Request, response: Response): Promise<Response> { try { const { name, email, password } = request.body; const createUser = container.resolve(CreateUserService); const user = await createUser.execute({ name, email, password }); return response.json({ user: cla...
ruandsx/gobarber-backend
src/modules/users/infra/http/controllers/UsersController.ts
TypeScript
ClassDeclaration
@Component({ tag: 'svg-stepper', styleUrl: 'svg-stepper.css', }) export class SvgStepper { render() { return ( <div> <p>Hello SvgStepper!</p> </div> ); } }
tm-3/svg-comp-lib
src/components/svg-stepper/svg-stepper.tsx
TypeScript
MethodDeclaration
render() { return ( <div> <p>Hello SvgStepper!</p> </div> ); }
tm-3/svg-comp-lib
src/components/svg-stepper/svg-stepper.tsx
TypeScript
InterfaceDeclaration
interface HTMLElementTagNameMap { 'sp-icons-editor': IconsEditor; }
gaoding-inc/Iliad-ui
packages/icons/sp-icons-editor.ts
TypeScript
FunctionDeclaration
function computeCustomTemplatesPath(configPath: string | undefined, customTemplatesPath: string) { if (configPath) { return path.resolve(path.dirname(configPath), customTemplatesPath) } else { return customTemplatesPath } }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
(config, context) => { const javaLikeContext: JavaLikeContext = { ...context, defaultConstantStyle: ConstantStyle.allCapsSnake, } const generatorOptions: CodegenOptionsDocumentation = { ...javaLikeOptions(config, javaLikeContext), customTemplatesPath: config.customTemplates && computeCustomTemplatesPath(c...
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
() => CodegenGeneratorType.DOCUMENTATION
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
(value, options) => { if (value === undefined) { return context.generator().defaultValue(options).literalValue } return `${value}` }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
(options) => { const { type, format } = options if (type === 'string') { if (format) { return new context.NativeType(format, { serializedType: 'string', }) } } else if (type === 'integer') { if (format) { return new context.NativeType(format, { serializedType: 'number', ...
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
(options) => { const { componentNativeType } = options return new context.NativeType(`${componentNativeType}[]`) }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
(options) => { const { keyNativeType, componentNativeType } = options return new context.NativeType(`{ [name: ${keyNativeType}]: ${componentNativeType} }`) }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
({ nullable }) => ({ default: function(nativeType, nativeTypeString) { if (nullable) { return `${nativeTypeString} | null` } return nativeTypeString }, /* We don't transform the concrete type as the concrete type is never null; we use it to make new objects */ concreteType: null, })
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
() => { return { value: null, literalValue: 'undefined' } }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
(name) => { return name }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
() => { return context.operationGroupingStrategies.addToGroupsByTagOrPath }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
() => { const result = [path.resolve(__dirname, '..', 'templates')] result.push(path.resolve(__dirname, '..', 'less')) result.push(path.resolve(__dirname, '..', 'static')) if (config.customTemplates) { result.push(computeCustomTemplatesPath(config.configPath, config.customTemplates)) } return res...
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
() => { return { ...aCommonGenerator.templateRootContext(), ...generatorOptions, generatorClass: '@openapi-generator-plus/plain-documentation-generator', } }
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
async(outputPath, doc) => { const hbs = Handlebars.create() registerStandardHelpers(hbs, context) // eslint-disable-next-line @typescript-eslint/no-explicit-any hbs.registerHelper('eachSorted', function(this: unknown, context: unknown, options: Handlebars.HelperOptions) { if (!context) { return o...
grantyb/openapi-generator-plus-generators
packages/plain-documentation/src/index.ts
TypeScript
ArrowFunction
() => new SharePlugin()
AMoo-Miki/OpenSearch-Dashboards
src/plugins/share/public/index.ts
TypeScript
ArrowFunction
({ cadPackage }: { cadPackage: string }) => { return <DevIdePage cadPackage={cadPackage} /> }
lucas-barros/cadhub
app/web/src/pages/DraftProjectPage/DraftProjectPage.tsx
TypeScript
ArrowFunction
():void => { i18next.addResourceBundle('PT', 'StaticPeoplesDevelopment', LanguagePT); i18next.addResourceBundle('PT', 'StaticIntroduction', LanguagePtFs); i18next.addResourceBundle('ENG', 'StaticPeoplesDevelopment', LanguageENG); i18next.addResourceBundle('ENG', 'StaticIntroduction', LanguageEngFs); useEffe...
RicardoGaefke/profile4d
src/Web.Admin/React/Components/FixedContent/PeoplesDevelopment/Language.ts
TypeScript
ArrowFunction
(): void => { if (!i18next.hasResourceBundle('PT', 'StaticPeoplesDevelopment')) { i18next.addResourceBundle('PT', 'StaticPeoplesDevelopment', LanguagePT); i18next.addResourceBundle('PT', 'StaticIntroduction', LanguagePtFs); } if (!i18next.hasResourceBundle('ENG', 'StaticPeoplesDevelopment')) { ...
RicardoGaefke/profile4d
src/Web.Admin/React/Components/FixedContent/PeoplesDevelopment/Language.ts
TypeScript
ArrowFunction
(): void => { i18next.removeResourceBundle('PT', 'StaticPeoplesDevelopment'); i18next.removeResourceBundle('PT', 'StaticIntroduction'); i18next.removeResourceBundle('ENG', 'StaticPeoplesDevelopment'); i18next.removeResourceBundle('ENG', 'StaticIntroduction'); }
RicardoGaefke/profile4d
src/Web.Admin/React/Components/FixedContent/PeoplesDevelopment/Language.ts
TypeScript
ArrowFunction
() => { let modeHandler: ModeHandler; const { newTest, newTestOnly, newTestSkip } = getTestingFunctions(); setup(async () => { await setupWorkspace(); modeHandler = await getAndUpdateModeHandler(); }); teardown(cleanUpWorkspace); test('can be activated', async () => { modeHandler.vimState.e...
andrewharvey/Vim
test/mode/modeVisualBlock.test.ts
TypeScript
ArrowFunction
async () => { await setupWorkspace(); modeHandler = await getAndUpdateModeHandler(); }
andrewharvey/Vim
test/mode/modeVisualBlock.test.ts
TypeScript
ArrowFunction
async () => { modeHandler.vimState.editor = vscode.window.activeTextEditor!; await modeHandler.handleKeyEvent('<C-v>'); assert.strictEqual(modeHandler.currentMode, Mode.VisualBlock); await modeHandler.handleKeyEvent('<C-v>'); assert.strictEqual(modeHandler.currentMode, Mode.Normal); }
andrewharvey/Vim
test/mode/modeVisualBlock.test.ts
TypeScript
ArrowFunction
() => { if (process.platform === 'darwin') { return; } test('<C-c> copies and sets mode to normal', async () => { await modeHandler.handleMultipleKeyEvents('ione two three'.split('')); await modeHandler.handleMultipleKeyEvents(['<Esc>', 'Y', 'p', 'p']); assertEqualLines(['one two ...
andrewharvey/Vim
test/mode/modeVisualBlock.test.ts
TypeScript
ArrowFunction
async () => { await modeHandler.handleMultipleKeyEvents('ione two three'.split('')); await modeHandler.handleMultipleKeyEvents(['<Esc>', 'Y', 'p', 'p']); assertEqualLines(['one two three', 'one two three', 'one two three']); await modeHandler.handleMultipleKeyEvents(['<Esc>', 'H', '<C-v>', 'e...
andrewharvey/Vim
test/mode/modeVisualBlock.test.ts
TypeScript
ArrowFunction
() => { this.props.dispatcher.refreshRepository(this.props.repository) }
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
ArrowFunction
() => { this.props.dispatcher.removeRepositories([this.props.repository], false) }
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
ArrowFunction
() => { this.props.dispatcher.relocateRepository(this.props.repository) }
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
ArrowFunction
async () => { const gitHubRepository = this.props.repository.gitHubRepository if (!gitHubRepository) { return } const cloneURL = gitHubRepository.cloneURL if (!cloneURL) { return } try { await this.props.dispatcher.cloneAgain( cloneURL, this.props.reposit...
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
ClassDeclaration
/** The view displayed when a repository is missing. */ export class MissingRepository extends React.Component< IMissingRepositoryProps, {} > { public render() { const buttons = new Array<JSX.Element>() buttons.push( <Button key="locate" onClick={this.locate} type="submit"> Locate… </B...
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
InterfaceDeclaration
interface IMissingRepositoryProps { readonly dispatcher: Dispatcher readonly repository: Repository }
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
MethodDeclaration
public render() { const buttons = new Array<JSX.Element>() buttons.push( <Button key="locate" onClick={this.locate} type="submit"> Locate… </Button> ) if (this.canCloneAgain()) { buttons.push( <Button key="clone-again" onClick={this.cloneAgain}> Clone Again ...
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
MethodDeclaration
private canCloneAgain() { const gitHubRepository = this.props.repository.gitHubRepository return gitHubRepository && gitHubRepository.cloneURL }
DaceyC/desktop
app/src/ui/missing-repository.tsx
TypeScript
FunctionDeclaration
function calculateOptions (colors: (string | undefined)[] = [], legends: string[], labels: string[], values: (number | BN)[][]): State { const chartData = values.reduce((chartData, values, index): Config => { const color = colors[index] || alphaColor(COLORS[index]); const data = values.map((value): number =>...
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
FunctionDeclaration
function LineChart ({ className, colors, labels, legends, values }: LineProps): React.ReactElement<LineProps> | null { const { chartData, chartOptions } = useMemo( () => calculateOptions(colors, legends, labels, values), [colors, labels, legends, values] ); return ( <div className={className}> ...
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
ArrowFunction
(hexColor: string): string => // eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access ChartJs.helpers.color(hexColor).alpha(0.65).rgbString()
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
ArrowFunction
(chartData, values, index): Config => { const color = colors[index] || alphaColor(COLORS[index]); const data = values.map((value): number => BN.isBN(value) ? value.toNumber() : value); chartData.datasets.push({ backgroundColor: color, borderColor: color, data, fill: false, ho...
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
ArrowFunction
(value): number => BN.isBN(value) ? value.toNumber() : value
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
ArrowFunction
() => calculateOptions(colors, legends, labels, values)
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
InterfaceDeclaration
interface State { chartData: ChartJs.ChartData; chartOptions: ChartJs.ChartOptions; }
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
InterfaceDeclaration
interface Dataset { data: number[]; fill: boolean; label: string; backgroundColor: string; borderColor: string; hoverBackgroundColor: string; }
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
InterfaceDeclaration
interface Config { labels: string[]; datasets: Dataset[]; }
199305a/apps
packages/react-components/src/Chart/Line.tsx
TypeScript
InterfaceDeclaration
export interface DataStoryContext { // Used to expose API routes as named HTTPRequest Nodes apis?: { name: string; url?: string; }[]; // Used to expose data as named ResolveContextFeature Nodes models?: { [others: string]: unknown; }; // We may put custom keys in the context [others: string...
Lenivaya/core
src/server/DataStoryContext.ts
TypeScript
ClassDeclaration
@Component() export class BlocksService { constructor( @InjectRepository(Block) private readonly blockRepository: Repository<Block> ) { } async findAll(): Promise<ThinBlock[]> { return await this.blockRepository.find(); } async find(id: number): Promise<Block> { re...
ssigg/ticketbox-server-nestjs
src/block/blocks.service.ts
TypeScript
MethodDeclaration
async findAll(): Promise<ThinBlock[]> { return await this.blockRepository.find(); }
ssigg/ticketbox-server-nestjs
src/block/blocks.service.ts
TypeScript
MethodDeclaration
async find(id: number): Promise<Block> { return await this.blockRepository.findOne({ id: id }); }
ssigg/ticketbox-server-nestjs
src/block/blocks.service.ts
TypeScript
MethodDeclaration
async create(dto: BlockDto): Promise<Block> { const block = await this.blockRepository.create(); block.updateFromDto(dto); const savedBlock = await this.blockRepository.save(block); return savedBlock; }
ssigg/ticketbox-server-nestjs
src/block/blocks.service.ts
TypeScript
MethodDeclaration
async update(id: number, dto: BlockDto): Promise<Block> { const block = await this.blockRepository.findOne({ id: id }); block.updateFromDto(dto); const savedBlock = await this.blockRepository.save(block); return savedBlock; }
ssigg/ticketbox-server-nestjs
src/block/blocks.service.ts
TypeScript
MethodDeclaration
async delete(id: number): Promise<DeleteResult> { return await this.blockRepository.delete({ id }); }
ssigg/ticketbox-server-nestjs
src/block/blocks.service.ts
TypeScript
ArrowFunction
({ children, id}) => { return <ContentContainer id = {id} className={styles.container}>{children}</ContentContainer>; }
navikt/permitteringsportal
src/app/components/Container.tsx
TypeScript
TypeAliasDeclaration
export type ContainerProps = { id?: string; };
navikt/permitteringsportal
src/app/components/Container.tsx
TypeScript