Category "typescript"

Update a single property of local JSON file using put call in Angular 8

I want to update my JSON file which I have placed in my assets folder, so If I am updating just one property of my JSON object so it should update that property

ERROR Error: Cannot find control with path: 'products -> Quantity'

When I add one product in my form, show this error. My code ts: this.products = this.ps.getProduct(); this.addform = this.fb.group({ 'invoice_number': new F

Create container module - export * as x from 'y'

I have this in a module: export const Category = require('./category'); export const Roles = require('./roles'); export const FunctionalTeams = require('./func

React, Graphql schema type declaration

I'm using graphql in React and Apollo:generate to create types from the graphql schema. I'm also using react-apollo-hooks useQuery to output the data. Everyth

babel-node with typescript throws "Cannot use import statement outside a module" in command line

So, I saw many similar issues, but most of them refer to built code, and this one is actually a CLI script. My command is: node_modules/.bin/babel-node -x .js,.

How to save a nested object using typeorm and Nestjs?

I have the following Data entity: @PrimaryGeneratedColumn() id: number @Column() dataA: string @Column() dataB: string @Column() dataC: number @Colum

How to update only matching subset of object properties in TypeScript?

Let's say I have two types that share some properties: type A = { shared1: string; shared2: string; notShared1: string; }; type B = { shared1: string;

How to pass parameters in Next.js without SSR?

I try pass params as docs says here: https://nextjs.org/docs/routing/dynamic-routes but the received params are not string??!! How could it be string array? I u

NextJS props shown warning

I've just started to learn Next, have some question. When I'm trying to send props from parent to child and I'm receiveng some error: Type '({ name }: { name: a

Preserve type argument in Redux connected component

I have a simple component that takes a type argument on props. When used, it infers the prop type and contextually types a callback param. However, when I wrap

Ineffective mark-compacts near heap limit Allocation Angular 8 - JavaScript heap out of memory

42% building 274/275 modules 1 active ...\src\index.js??extracted!D:\Clients\app\node_modules\sass-loader\lib\loader.js??ref--15-3!D:\src\styles.scss <

Convert binary string to flags in typescript

I have a binary string which I want to convert to the equivalent flag enum value. My attempt: const permissionNum = parseInt(this.auth.decodedToken.permissions

How to install Next.js Tailwind explicitly with .js?

I created a Next.js project and I only have .tsx (TypeScript) as the extension everywhere. I know TypeScript is just extended like Java but I just want .js as t

TypeScript: aliasing namespaced declarations in global namespace

I'm working on a TypeScript project (for the browser) where we're using a third party library with type definitions from DefinitelyTyped. In the type definition

Type union not checking for excess properties

let's imagine a have an object that either have properties A and B or C, e.g.: const temp = { A: 1, B: 2, } or const temp = { C: 3, } And intuitively I

ngx-translate Problems with unit testing

0 I'm using ngx-translate library and having some issues with unit testing because it wont find certain provides. The issue its that even tho i place a provider

res.session undefined graphql apollo-server-express

I am having trouble with sessions. For some reason, the req.session is undefined even though I'm using the session middleware. I was trying to use redis but I c

How to use jest to mock out a private variable

I am trying to write a unit test for a function like this: export class newClass { private service: ServiceToMock; constructor () { this.service =

Mongoose 5.11.11 SchemaDefinition Typing

Mongoose recently updated to accept a model generic it works well with a string type but not with a boolean type. Type 'boolean' is not assignable to type 'Sche

type for useRef if used with setInterval, react-typescript

I am doing a simple animation in a next.js app. let flipInterval = useRef(); const startAnimation = () => { flipInterval.current = setInterval(() =>