v12.8.0
What's Changed
Minor Changes
-
06dcdc3: Type
camelizeResponse: falseaccurately on the rawapi.get,api.postandapi.requestescape hatch.The option turns off the snake_case to camelCase rewrite for one call, but the declared return type stayed
Camelize<T>either way. Passing a snake_caseTtherefore produced a type claiming camelCase properties the response did not have, and reading one compiled and returnedundefined.Each of the three methods now carries two signatures. Writing the literal
falseselects the one that returns the rawT; every other spelling returnsCamelize<T>exactly as before. That covers{ camelizeResponse: false }written at the call site, an options object declaredas const, and a spread that keeps the literal.Two spellings get
Camelize<T>back regardless of the value: abooleanvariable the compiler cannot see the value of, and an options object from a plainconstdeclaration, which widens the property toboolean. That type is right when the value turns out to betrueand wrong when it isfalse, which is the original mismatch. Both compile as they did before, so nothing that works today stops working. The README says which spellings land where.Potentially breaking for type-checking. A call passing a literal
falsewith a snake_caseTnow returns that snake_case type, so code reading a camelCase property off it stops compiling. That code was already readingundefinedat runtime. Nothing in the SDK's own typed methods changes:getTraitsis the package's user of the option, andCamelize<T>passes index signatures through untouched, so its raw and camelized types are the same.
Full Changelog: v12.7.0...v12.8.0