<ljharb>
what value is freezing if it can be undone
<ljharb>
a guarantee that can be revoked isn't one
<pikajude>
you could, say, freeze an object, pass it into a function called `validate` to make sure that your validatior function doesn't, say, modify its input
<pikajude>
then unfreeze when you're done
<ljharb>
you couldn't guarantee the validator function didn't setTimeout and modify it later
<ljharb>
so making a copy is the only safe approach.
<pikajude>
i sure couldn't, but who on earth would do that
<ljharb>
who on earth would write a validator function that modifies its input
<ljharb>
BOOM lawyered
<pikajude>
i'm glad you asked
<pikajude>
the answer is "the maintainers of the jsonschema package"
<ljharb>
ok so then don't trust them to not maintain a reference to your object and modify it later, either :-p
<pikajude>
fair enough
<pikajude>
i mean, freeze would be a bandaid solution
<pikajude>
the real root problem with the language is that that class of bugs can happen
<ljharb>
sure, welcome to most programming languages that ever exist
<pikajude>
i know
<pikajude>
it's a very common root problem
<pikajude>
fortunately with the advent of modern technology we've been able to make some progress
Hrorek has joined #elliottcable
Rurik has quit [Ping timeout: 264 seconds]
Hrorek has quit [Ping timeout: 252 seconds]
Hrorek has joined #elliottcable
<gkatsev>
jsonschema mutates the input?
<gkatsev>
oh god
<pikajude>
ya
<pikajude>
well, that specific package does
<pikajude>
it's not, er, part of the spec :)
<ec>
hi all
<ec>
pikajude: so, as somebody who's last use of XML was XMPP,
<ec>
pikajude: can you explain the *purpose* of jsonschema to me in laymens' terms?
<pikajude>
its a schema you write in json
eligrey has joined #elliottcable
<gkatsev>
ec: the purpose is to relive the glory of XML in json@
<gkatsev>
!
<pikajude>
the purpose is to be able to define a schema in a format that everybody and their grandmother can read
<mkroman>
jo
<mkroman>
er.
<ljharb>
there should be a tomlschema module
<pikajude>
or a yamlschema
Hrorek has quit [Ping timeout: 264 seconds]
<ec>
‘and their grandmother’
<ec>
sexist and ageist, plzdon't <3
<ec>
idk, “everybody, even their computer-illiterate frands?”
Rurik has joined #elliottcable
Rurik has joined #elliottcable
<ec>
currently accidentally learning Hapi.js and ioredis?