These are chat archives for exceptionless/Discuss

20th
Nov 2015
Blake Niemyjski
@niemyjski
Nov 20 2015 00:14
@tekmaven This one is for you exceptionless/Exceptionless@ecae673
Frank Ebersoll
@frankebersoll
Nov 20 2015 06:38
@niemyjski I wrecked my environment by updating Node yesterday. Sorry. I hope to get it up and running this weekend again.
Blake Niemyjski
@niemyjski
Nov 20 2015 06:43
Dang
Brew upgrade?
I'm running node 5
Frank Ebersoll
@frankebersoll
Nov 20 2015 16:18
found out how to nuke node. now running v5.1.0
Blake Niemyjski
@niemyjski
Nov 20 2015 16:19
how’d you do it?
I installed mine with brew
which doesn’t require sudo
Frank Ebersoll
@frankebersoll
Nov 20 2015 16:21
hey there :)
the no-sudo-thing sounds great. i should brew more often
Eric J. Smith
@ejsmith
Nov 20 2015 16:21
hah
that sounds funny
Frank Ebersoll
@frankebersoll
Nov 20 2015 16:22
?
Eric J. Smith
@ejsmith
Nov 20 2015 16:22
"i should brew more often"
Frank Ebersoll
@frankebersoll
Nov 20 2015 16:22
yes, i only use it to install tools i never use again.
then forget about its existence.
Blake Niemyjski
@niemyjski
Nov 20 2015 16:23
haha
I try to install everything from there or the mac store
much quicker to update
brew update && brew upgrade
I think I’ve ran that before
Frank Ebersoll
@frankebersoll
Nov 20 2015 16:24
it's like chocolatey
Blake Niemyjski
@niemyjski
Nov 20 2015 16:24
I don’t use it tho
all the packages I’d want seem crazy out of date
brew seems to be up-to-date all the time. I get node 5.1 the same or next day after release
I really wonder how good oneget will get
hear no one talking about it
and it’s baked into win10
or so I thought
Frank Ebersoll
@frankebersoll
Nov 20 2015 17:00
did you install karma-chrome-launcher globally?
Blake Niemyjski
@niemyjski
Nov 20 2015 17:00
nope into the package
Frank Ebersoll
@frankebersoll
Nov 20 2015 17:00
ok
i find it spectacular how node went from 0 to 5 in about a month
Blake Niemyjski
@niemyjski
Nov 20 2015 17:02
yeah
keeps on revving
too fast
Frank Ebersoll
@frankebersoll
Nov 20 2015 17:04
i finally got the chrome runner working. i like it.
Blake Niemyjski
@niemyjski
Nov 20 2015 17:05
yeah wish the phantom one would work good like that
Frank Ebersoll
@frankebersoll
Nov 20 2015 17:06
i think sooner or later we can use mocha without any external dependencies
just have one thing left there which is about source maps
i don't know if it's the fault of the source maps or VSCode
i want to set a breakpoint inside a test or implementation in typescript, then hit Debug and break into it.
right in vscode or studio.
Blake Niemyjski
@niemyjski
Nov 20 2015 17:14
yeah
that would be ideal
Frank Ebersoll
@frankebersoll
Nov 20 2015 19:37
okay, i found the error.
Blake Niemyjski
@niemyjski
Nov 20 2015 19:38
What was it
Frank Ebersoll
@frankebersoll
Nov 20 2015 19:39
well, it's in Utils.stringify
it doesn't respect inheritance
so, if you have property A in the object and property B in the object's prototype, it will only serialize A
the test that fails checks if inherited properties are supported
Frank Ebersoll
@frankebersoll
Nov 20 2015 19:44
i know that default implementations of JSON.stringify only serialize own properties
but i had the use case of inherited error classes myself already, so i thought it would make sense to have inherited properties get collected, too
Frank Ebersoll
@frankebersoll
Nov 20 2015 19:50
so, if we don't want that, just delete the test. else we have to iterate over the properties and stringify each of them.
Blake Niemyjski
@niemyjski
Nov 20 2015 20:10
Hmm
Is there a away to make json stringify to do that without iterating?
I think we want that even for set property
Frank Ebersoll
@frankebersoll
Nov 20 2015 20:15
no, there is no way.
Blake Niemyjski
@niemyjski
Nov 20 2015 20:30
We could have stringify flatten it first
Doesn't seem bad
Why do you think?
Frank Ebersoll
@frankebersoll
Nov 20 2015 20:31
how would that work?
Blake Niemyjski
@niemyjski
Nov 20 2015 20:40
that stack overflow post anwser has it
and the last response

To preserve the prototype chain, clever tricks are necessary (like those used in HydrateJS). If this is not what you are aiming for, maybe you just need to "flatten" the object before stringifying it. To do that, you could e.g. iterate all the properties of the object, regardless of whether they are own or not and re-assign them (this will ensure they get defined on the object itself instead of just inherited from the prototype).

function flatten(obj) {
var result = Object.create(obj);
for(var key in result) {
result[key] = result[key];
}
return result;
}
The way the function is written it doesn't mutate the original object. So using

console.log(JSON.stringify(flatten(a)));
you'll get the output you want and a will stay the same.

probably need to do a typecheck to see if it’s object..
wonder if we should worry about anything that’s not on the root level
Frank Ebersoll
@frankebersoll
Nov 20 2015 20:41
yes, i meant that by "iterating over it"
Blake Niemyjski
@niemyjski
Nov 20 2015 20:41
yeah
Frank Ebersoll
@frankebersoll
Nov 20 2015 20:42
you asked, if we can do it without iterating
Blake Niemyjski
@niemyjski
Nov 20 2015 20:42
yeah
I know, hehe guess that’s a big fat no
Frank Ebersoll
@frankebersoll
Nov 20 2015 20:42
seems like ir
it
Blake Niemyjski
@niemyjski
Nov 20 2015 21:02
anyone here go hunting?
Kinda excited for tomorrow, @ejsmith thinks I’m crazy lol
Frank Ebersoll
@frankebersoll
Nov 20 2015 21:04
excited about what?
Blake Niemyjski
@niemyjski
Nov 20 2015 21:05
deer hunting
awe yes!
Screen Shot 2015-11-20 at 3.05.13 PM.png
Frank Ebersoll
@frankebersoll
Nov 20 2015 21:06
using it since two days. i like it
Blake Niemyjski
@niemyjski
Nov 20 2015 21:08
yeah it seems pretty nice
Blake Niemyjski
@niemyjski
Nov 20 2015 21:16
exceptionless/Exceptionless#158
@modesto for pr 155, I think we need two routes
the existing one and then one that is /organizations/organizationId/project/check-name
Modesto San Juan
@modesto
Nov 20 2015 21:52
@niemyjski ok! I'll make a pull request with this change
Blake Niemyjski
@niemyjski
Nov 20 2015 22:02
ok
I can do the client side one
that * is really important in that route
means it will allow you to have / in the name part