You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
That is, while the dash is not allowed in a function name / function call likeoc(response).headers.Content-Type(), it is still a valid object key.
Maybe a check on the argument? That is, if it matches a property in the object return that, else consider it the default argument. Examples:
// expected "application/json"constcontentType=oc(response).headers("Content-Type");// expected 0 as default value because content-length property does not exist.constcontentLength=oc(response).headers("Content-Length",0);// expected empty object / default value because argument does not match one of headers' properties.constheaders=oc(response).headers({})
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there a way to replace
_.get()
withts-optchain
for the following use case?That is, while the dash is not allowed in a function name / function call like
oc(response).headers.Content-Type()
, it is still a valid object key.Maybe a check on the argument? That is, if it matches a property in the object return that, else consider it the default argument. Examples:
The text was updated successfully, but these errors were encountered: