ReadonlyDeep: Fix handling of objects with call signatures#359
ReadonlyDeep: Fix handling of objects with call signatures#359sindresorhus merged 5 commits intosindresorhus:mainfrom
ReadonlyDeep: Fix handling of objects with call signatures#359Conversation
491f069 to
16a7a70
Compare
16a7a70 to
25b24bc
Compare
Do you think it should be handled? |
…natures instead just leave them as be (mutable)
25b24bc to
d179825
Compare
ReadonlyDeep: Fix handling of objects with call signatures
|
@sindresorhus It's a rare case but probably should be handled for completeness. Edit: Actually I don't think it's possible to to make a native map or set callable. Thus this will be a very rare case. |
I agree. It would be great if you could handle it then. |
|
@sindresorhus I've made that change locally to support maps and sets but then I realized that with how this type currently works, only native maps and sets are supported. As native map and set can't be made callable (as far as I know), my local change will have no benefit. I'd say the PR is currently ready in its current state. |
|
Thanks :) |
partial fix of #337
Makes objects with a call signatures readonly.
Limitations:
Current this PR assumes that any object that has an call signatures is not a map or set. I can extends this PR to handle maps and sets with call signatures.