ciscoheat
ciscoheat
Explore posts from servers
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Gotta take some rest now, nice chatting
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
I'm stumped
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Subclassing in typescript compiles to something messy?
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
And arrays are "objects"
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Maybe because the prototype of freeze is on Object
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Yes, I didn't know that
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
I'm sure you'll figure something out. 🙂
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
If you need the extra features of the subclass
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Maybe you can use that internally, and call Array.from when you're about to return the errors?
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Yes
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Ok, yeah, I guess it's a bit of a problem if the error path doesn't behave just like an array
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
What was the problem with the (real) array in the first place?
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
No description
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
The Array constructor defies all logic
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
const result = schema(data);
if (!(result instanceof type.errors)) {
return "OK";
}
const issues = [];
for (const error of result) {
issues.push({ message: error.message, path: error.path.slice() });
}
const result = schema(data);
if (!(result instanceof type.errors)) {
return "OK";
}
const issues = [];
for (const error of result) {
issues.push({ message: error.message, path: error.path.slice() });
}
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
It didn't work with slice
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
But I managed to fix it so it works with Array.from
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Yeah, arrays are messy in that way
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Yes
166 replies
Aarktype
Created by francis on 11/14/2024 in #questions
Is there a way to set a default value that is not valid?
Solved it with Array.from(error.path)
166 replies