Dmitry Munda
01/26/2023, 3:16 PMincludeWipPactsSince: isCI ? new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split("T")[0] : undefined,
throws TypeError: includeWipPactsSince
doesnt work properly in non-CI env, with any of undefined/null/“”
any ideas ?Dmitry Munda
01/26/2023, 3:18 PMincludeWipPactsSince?: string;
which [empty] string will make it happy ? 🙂Timothy Jones
01/27/2023, 6:15 AMTimothy Jones
01/27/2023, 6:15 AMTimothy Jones
01/27/2023, 6:15 AMincludeWipPactsSince?: string;
^ This says the property includeWipPactsSince is optional. And it must be a stringTimothy Jones
01/27/2023, 6:16 AMundefined or null, because they are not stringsTimothy Jones
01/27/2023, 6:16 AMTimothy Jones
01/27/2023, 6:17 AM...(isCI
? {
includeWipPactsSince: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)
.toISOString()
.split('T')[0],
}
: {}),Dmitry Munda
01/27/2023, 6:18 AMTimothy Jones
01/27/2023, 6:18 AMTimothy Jones
01/27/2023, 6:19 AMTimothy Jones
01/27/2023, 6:19 AM{ someProp: undefined } and {}, even if typescript thinks you canTimothy Jones
01/27/2023, 6:20 AMTimothy Jones
01/27/2023, 6:21 AM