Two correctness fixes for isSupported(). Both change the boolean returned in
some cases, hence the major bump.
The public API itself is unchanged.
- Fixed: features flagged with a caniuse note are no longer reported as
unsupported. caniuse stores full support asy, sometimes followed by a note
(y #2) or a flag (y x); we now only check the leading support indicator
instead of matching the whole value.
(#82
via #90
by @underbyte)- e.g.
isSupported("es6", "chrome 74")now returnstrue(wasfalse).
- e.g.
- Fixed: an unknown browser version is now reported as unsupported instead of
supported. A query resolving to no known browser (e.g.safari 12.0.2)
previously returnedtruebecause of a vacuously-true[].every(…); it now
returnsfalse. (#83
via #90
by @underbyte)- e.g.
isSupported("intersectionobserver", "safari 12.0.2")now returns
false(wastrue). isSupportedstill throws on a malformed query ("not a real browser")
and on an unknown feature name, as before.
- e.g.
- Added: built-in TypeScript type declarations. The package is now written in
TypeScript and ships its own.d.ts, so@types/caniuse-apiis no longer
needed.
By @MoOx. - Changed: internal rewrite, no runtime behaviour change. The previous build
step was replaced bytsc(sources run natively under modern Node and are
compiled to CommonJS for publishing), and thelodash.memoize/lodash.uniq
dependencies were inlined — two fewer runtime dependencies.
By @MoOx.
Note for tooling authors (e.g. cssnano / postcss-merge-rules): more features
are now considered supported than before, which can change generated output.
The new behaviour matches caniuse.com (dark green = supported).