« first day (5049 days earlier)      last day (121 days later) » 

01:03
@user7886229 Node.js uses regular fetch() now, so you don't need additional packages. Should be an easy fix, just remove the import and make sure the functions are named "fetch".
 
1 hour later…
02:22
@ParkingMaster fixed this
now there is an issue with typescript
02:43
i cant figure it out
for some reason typescript used to produce files directly in thebuild directly, now it's creating directories for each package in the build directory
so for example plugins/build now was bot, platforms, and plugins folders instead of just putting the plugins files directly in the build folder
James is dead until someone figures out how to fix it :(
@user7886229 Wish I could help but I don't know typescript - maybe @KevinB or @VLAZ could help with this?
 
2 hours later…
05:05
@user7886229 See if this might help. It describes how to get a flat directory output from TS. It's more involved than just flipping a setting like outputFlatDirectoryStrructure. You apparently need to set two pieces of config for that instead.
 
13 hours later…
17:53
how would you type an object with key string and type
var dictionary[key: string]: Person] = {};
18:12
dictionary: Record<string, Person> = {}
You can also use dictionary: {[key: string]: Person} = {} but it's exactly the same. Record<T, U> is {[key: T]: U}
Record is more idiomatic
What's the difference between these. They both seem to work:
{key: string, MyType}
{[key: string]: MyType}
correction, they don't seem to work together but the first one works in the function return type
getDictionary(abc): {key: string, MyType} {
   var dictionary:{[key: string]: MyType} = {};
@1.21gigawatts I don't think the first one would work. At best it describes an object which has one key called key with a value which is a string. But MyType should be a syntax error. Unless a newer version of TS made it the same as MyType: MyType, in which case the object also has a second key called MyType where the value is MyType (to follow short object properties in JS).
Doesn't seem like the first one is valid in TS 5.5: Playground Link
Using [] inside {} means it's an index signature. It defines the type of the key. Note that key is entirely superfluous - it can be any arbitrary string. It's only there to give a name for the key. It's the string of [key: string] that defines the type of the key. { [potato: string]: string } would work exactly the same if you change key
18:45
Is there a way to make an object return a string?
I am getting this "Bounds: [object Object]"
when I want this: "Bounds: {top:0,left:0,width:100,height:100}"
My code is "Bounds: " + bounds
Nevermind I'll just use JSON.stringify(bounds)
19:06
Yes, JSON.stringify() is a good way to do it. You can also override toString() and/or @@toPrimitive() but I find it's rarely needed. More precisely, I think I've never used it for any real code. Occasionally for some toy code.
||> const foo = {a: 1, b: 2, toString() { return `{a: ${this.a}, b: ${this.b}}`}};
console.log(String(foo));
oh, right James is dead
oh, hah, i didn't even pick up who was pinging me, thought it was just some rando so i politely ignored

« first day (5049 days earlier)      last day (121 days later) »