Closed asaarnak closed 6 years ago
Created this PR because current *Custom()
method typings give runtime error that method is missing.
These index.js
*Custom()
methods are now in custom.js
file.
See: https://github.com/catamphetamine/libphonenumber-js/blob/master/custom.js
@asaarnak, looks like ES6 version re-exports stuff from custom.js - @catamphetamine, perhaps index.common.js should also reexport stuff from custom.js instead of changing type definitions with this PR?
Thanks.
Released libphonenumber-js@1.2.15
.
@catamphetamine, I guess You didn't notice my comment/question - perhaps this should have been solved differently? I'm just suspecting that the approach of current PR might break things for es6 distribution users
@atsu85 Oh, there's a comment there... I didn't see it.
looks like ES6 version re-exports stuff from custom.js - @catamphetamine, perhaps index.common.js should also reexport stuff from custom.js instead of changing type definitions with this PR?
The thing with ES6 is that it supports "tree shaking" (in theory, but most likely it currently doesn't work in Webpack). So one can export everything in a single ES6 file and the resulting bundle would still only include those functions which are being exported. Common.js doesn't support "tree shaking" so custom and non-custom functions must reside in separate files.
ok, thanks for giving a thought on in
Removed invalid type definitions from index.d.ts.