Category "typescript"

Cannot add cli parameters to DataSourceOptions in TypeORM

In the typeORM documentation a cli parameter can be added to DataSourceOptions according to https://github.com/typeorm/typeorm/blob/master/docs/data-source-opti

Web Crypto Api fails to verify signature after converting from string

I am storing my data, including the signature in string format, and after converting the signature to and from strings following the MDN Documentation the verif

HERE REST API - React/Typescript - OAuth Signature mismatch

I am trying to implement the OAuth authentication for HERE REST API following this documentation: https://developer.here.com/documentation/identity-access-manag

Getting error when submitting multiple file attachments to list item using sp/pnp latest version

I'm using sp/pnp to submit a list item with multiple attachments: export const CreateListItem = async (listName: string, item: any, files: File[]) => { c

How to add types to Cypress.env?

I have this cypress.json config file: { "env": { "example": "Hello World!" } } In my tests: Cypress.env("example") Can I add any kind of type defintio

Ionic 6 - localization of Google Maps API

I am using Angular 13 and Ionic 6 to add Google Maps API V3. Here is a simple example provided by Google to add the map using TypeScript. When using Ionic, I am

Assign a documents values as a <Type>

Making an Observable <Hero[]> out of a collection works perfectly and gives me access to all its documents, but I am unable to assign individual documents

Type '{ name: string; }' is not assignable to type 'ReactNode'

I want to render names that are in the State. But I get this error: Type '{ name: string; }' is not assignable to type 'ReactNode'. I understand that ReactNode

How to use an object with const assertion (as const) as an unique symbol for another type key

I have a list of routes : const N: any = "N"; // get const from non typed lib for example or typed as "string" const PREFIX = `Route_${N}` as const; const Route

Postgres TypeORM - FK to PK that is also FK to another table - constraint error

In my NestJS application with postgres db I have these 3 entities: User, Writer, Book and a class named UserBaseEntity. export class UserBaseEntity { @Prim

Can't run a TS node + ES app - either get `ERR_UNKNOWN_FILE_EXTENSION ` or `new ERR_MODULE_NOT_FOUND`

I'm trying to compile my code as ES code (using "type": "module" inside package.json and "module": "esnext" inside tsconfig.json). I can't run it using any of t

Jest: How to transform import.meta.url using Next 12 with SWC

I am using Jest in a Next.js 12 App with the Rust Compiler. Since I'm using WebWorkers I have a file in which I use import.meta.url. to construct the worker The

NestJs Swagger: How to define Api Property for dynamic classes

I have below class export class DocumentsSteps { @ApiProperty({type: ???}) [type: string]: DocumentStep; } How should I define ApiProperty type?

TypeScript: Is it possible to safely access nested properties of an object given an array of keys? Can this be done in a type safe and composable way?

I'd like to write a function which gets a value from an object given an array of property keys. It would look something like this: function getValue<O, K ext

TypeORM error when trying to create migration in CLI

I'm trying to use the TypeORM CLI to create a migration. I followed their guide but when I run yarn run typeorm migration:generate I get the error: $ typeorm-ts

Angular_Improper_Type_Pipe_Usage in checkmarx scan

We are using a tool called checkmarx to scan code vulnerability. I am getting Angular_Improper_Type_Pipe_Usage warning for the below Angular code in checkmarx s

How to get the contents of a file as a String

I am new to Typescript and node. I have this function sftp.connect(config) //CONNECT TO STFP .then(() => { sftp.list(remoteFilePath) //LIST THE FILES IN

Issue while updated the styles from opactiy 0 to opacity 1 in angular through async call in html

Below is the piece of code I am using in angular <div class="root" [class.loaded]="loaded$ | async"> The styles applied to the class as follow div.root {

No Typescript error for unresolved types in .d.ts files?

For as long as I can remember, Typescript didn't warn about unresolved/undefined types in .d.ts files. I could run tsc and it wouldn't have any errors. I alrea

Error : Module '"@angular/material"' has no exported member "..."

i create a custom Angular material module, material.module.ts file and import the following Angular material UI components in this file like given below. import