Category "typescript"

Typed Indexing variable is not of the same type as the object being indexed

I have a slightly complex object that has typed keys on the top-most level of the object, as well as the deepest level of the object, and I can't seem to be abl

Material table cells with specific width according to predefined length

I will show my code first. <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef> No. </th> <td mat-cell *matC

Is getting Ansible to work with Pulumi possible?

I wish to create several droplets (DigitalOcean) in a loop and then run Ansible afterwards on the droplets to setup the required software and security measures.

Why does mat-tree toggle throws error when used to create story file?

I have created a tree component using mat-tree in a storybook module, and when I use it inside a component it works just fine. The problem is when I use it to c

How to make data() key function to work with TypeScript?

I am trying to use a custom key function for .data() with .selectAll() selection in D3. But, making it TypeScript compatible is becoming such a pain. The eleme

How to cache yarn packages in GitHub Actions

I am using GitHub Actions to build my TypeScript project. Everytime I run action I am waiting 3 minutes for all dependencies to get installed. Is there way to

'TypeError: Converting circular structure to JSON' in a Lerna workspace with CRA and Typescript

I have a Lerna Workspace with some packages and a webapp created with create-react-app using TypeScript. When I try to add node-sass (needed for customizing ag-

Create a global function like jest does

I am working on a meta framework that will use react. I would like to offer some functions that are directly available without the need of an import, exactly li

How to order an array of object during a forEach()?

So, basically I have this array of objects and I need to order them dependently on the value caricoData, which is a date. Problem is, the value is a string and

Enforce Typescript object has exactly one key from a set

Basic Question and Context I'm trying to type an array of objects where each object has exactly one key from a set. For example: const foo = [ { a: 'foo' },

Angular: Dynamically find headers when converting JSON array to HTML table

In Angular, I want to convert a JSON array to an HTML table. I have seen an old answer for AngularJS: <table> <thead> <tr> &

How to find the length of data source using typescript in angular application

Unable to find length of data source(array) using typescript in angular application this.activatedRoute.data.subscribe( (res) => { console.log(re

Routing in Aurelia2

After I click Save Device, I want it to return to my default route where is list with all my devices, it adds a new Device but it show error on : "this.router.l

Is there a way to combine ES6 imports and commonJS require in TS compiled files?

I have changed the code of a project made in NodeJS to Typescript. Everything is working fine, except for the fact that apparently a third-part package (file-ty

Mochawesome use AddContext in afterEach with cypress

I spent the last 10 days trying to use the function addContext in the afterEach function as I'm using in "test:after:run" post action. The reason to do this is

How to access vue router in Vuex store module actions with Quasar framework?

I am using Quasar Framework v2 Beta Vue 3 Composition Api Vuex 4 Typescript My problem: When I import router and try to redirect User in Vuex store module actio

Upload single image from axios to FastAPI: "Expected UploadFile, received: <class 'str'>"

I try to upload an image from my react-admin app to FastAPI using axios. The ImageInput component returns a File object which I cast to a Blob and try to upload

Use react-intl imperative formatMessage with TypeScript?

I want to use formatMessage from react-intl (v5.25.1) for creating a string in order to use them later (in an event callback). For example this for my message (

React Router Dom v6 - Image not found in nested routes

In my tsconfig.json file, I have a "compilerOptions":{baseUrl} that enables me to look for images in public/images/foo.png like this <img src='images/foo.png

Material Icon showing as the name when site first loads

There is an issue with Angular 7 and materials icon where the name of the icon shows when the site is initially loading. Is there a way to prevent this