JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Aug 3, 2022 20:25
http://pastie.org/p/7el2M4OOh0HlMh8ZTuefkZ
Please, help me :( I'm getting error Property 'findByPk' does not exist on type 'T'.ts(2339).
Jan 31, 2022 23:16
uwu
Jan 31, 2022 23:10
ok
Jan 31, 2022 23:08
yeah, but I dont need to run it concurrently. I need to run in sequentually
Jan 31, 2022 23:02
macos for example
Jan 31, 2022 23:02
because now, for dev command I have a problem that it runs generate-graphql-types first
Jan 31, 2022 23:02
how can I write a command to run it as I wrote in comment?
Jan 31, 2022 23:01
Jan 2, 2022 14:58
what is the preferred way to style components in react?
Dec 7, 2021 16:22
ok thanks
Dec 7, 2021 15:46
can you explain me pls?

SQL databases are vertically scalable in most situations. You’re able to increase the load on a single server by adding more CPU, RAM, or SSD capacity. NoSQL databases are horizontally scalable. You’re able to handle higher traffic by sharding, which adds more servers to your NoSQL database. Horizontal scaling has a greater overall capacity than vertical scaling, making NoSQL databases the preferred choice for large and frequently changing data sets.
Why noSQL databases could not be scaled vertically? I can upgrade CPU or ram on the server too as with SQL-like datab
Dec 7, 2021 15:38
hey, do you have any good tech articles about comparison NoSQL and SQL-like databases?
Aug 29, 2021 14:29
and how to prevent such behavoir
Aug 29, 2021 14:28
why console.log does not print undefined values?
Aug 29, 2021 14:27
let arr = [[1, 2], undefined, [], [-4, 4]]
arr.sort((a, b) => {
  console.log(a, b)
})
Jun 23, 2021 12:22
yeah yeah, I forgot to escape \. Thanks!
Jun 23, 2021 11:55
> new RegExp('^[\dA-Za-z]+$').test('asdas2d')
false

why? is it not suppose to be true?
Jun 19, 2021 15:32
how to do it without creating new observable?
Jun 19, 2021 15:31
Can someone tell me how to sort array which is observable (rxjs) ? I'm trying to do it in Angular. When I have a service with observable array. And try to sort it from component.
Jun 8, 2021 16:49
I think the is no any difference.
Jun 8, 2021 16:36
I was thinking that destructing ...[a, b, c] we are creating new objects, but no, we are not
Jun 8, 2021 16:20
@RussianFederation as a newbie, I'm interested in the difference between using it and using vanilla js to make my stuff/ What is the difference ? will it need less code to run or what?
Jun 8, 2021 16:16
do you use rxjs?
Jun 8, 2021 16:15
hey
Jun 8, 2021 16:14
autocomplete of what?
Jun 8, 2021 16:12
can you show me an example when rxjs could make my life a lot easier than vanilla js, please?
May 25, 2021 15:58
I have one more question about react.js. https://imgur.com/Xj6ExNR.png
Why react does not redirect me to the '/' while `auth = { token: null, user: null }? When I'm typing url smth like `/asdasdasd/asdasd` it should redirects me to the '/' page, but nothing happens. Why?
May 25, 2021 15:55
@BeerusDev nono, Im just interested why I can't insert div to both of boxes like that
May 25, 2021 13:18
why new div is only inserted into the second block?
May 25, 2021 13:18
 

Trash can

Like the recycle bin, but trashier.
Aug 3, 2022 20:23
Hi, can you help me, please?

import { Model } from 'sequelize/types';

import { internalError } from '../lib/errors';

export const findByPkOrFail = async <T extends Model>(
model: T,
id?: string,
): Promise<T> => {
const doc = await model.findByPk(id);
if (!doc) {
throw internalError('Vote does not exist');
}
return doc;
};

I'm getting error on TS `Property 'findByPk' does not exist on type 'T'.ts(2339)`. What should I do?
Aug 3, 2022 20:23
Hi, can you help me, please?

import { Model } from 'sequelize/types';

import { internalError } from '../lib/errors';

export const findByPkOrFail = async <T extends Model>(
model: T,
id?: string,
): Promise<T> => {
const doc = await model.findByPk(id);
if (!doc) {
throw internalError('Vote does not exist');
}
return doc;
};

I'm getting error on TS `Property 'findByPk' does not exist on type 'T'.ts(2339)`. What should I do?
 

SO Close Vote Reviewers

This room is for support and discussion about reviewing and co...
May 19, 2022 11:10
@OlegValteriswithUkraine cuz this chat is on the top ;D. Thanks guys
May 19, 2022 10:01
sorry for offtop question. How to write 4ft 11in - 5ft 4.9in shortly? 4'11'' or something like that?
Sep 28, 2021 15:58
I want to buy new air with m1 chip, what do you think about it?
Jun 6, 2021 14:26
@Braiam how could you say that?
Jun 6, 2021 14:01
sorry for bothering and non-topic question, but: is it grammatically correct to say: a camera man who made all those things that the guy did, following him? (means, that the camera man repeat all guy's actions)
May 31, 2021 21:47
But ok, thanks anyway
May 31, 2021 21:47
its a very basic question thats why I dont want to ask such type of questions :(
May 31, 2021 21:42
@Braiam no, a simple question about WORKDIR /app and COPY package.json /app. If workdir works as cd in CMD then from where does package.json is copied?
May 31, 2021 21:41
@rene I mean I wanted to chat about it somewhere here
May 31, 2021 20:52
where can I ask about docker?
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Dec 17, 2021 21:10
hm. actually yes. thanks
Dec 17, 2021 18:47
is there any library to build such 3d figures in .obj format?
Dec 17, 2021 18:46
hi
I need to build 3d map from 2d map of the city. Just cubes and planes (roads). What should I use to build .obj file with Python?
Nov 5, 2021 13:55
rules_min = rules_min.loc[rules_min['antecedents'].str.contains('high')] I wish I could do that, but it only check 1 column 'antecedents'
Nov 5, 2021 13:55
filter by rows, than any column can contains string 'high'
Nov 5, 2021 13:54
hi, how to filter dataframe with such behavoir:
Oct 24, 2021 10:31
which server architectures do you know? for example mvc, microservices, what else?
May 16, 2021 18:16
at least for python