Skip to content

Fix lodash.clonedeep module issue and add module key to package.json #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 9, 2021

Conversation

patrick-tolosa
Copy link
Contributor

@patrick-tolosa patrick-tolosa commented Sep 2, 2021

  • Copy lodash.clonedeep to a file instead of importing it
  • Add a module key to package.json
  • Fix various linting issues (Delete unused lines, add missing return types)

Pull request for @cloudinary/url-gen

What does this PR solve?

... A few words

Final checklist

  • Implementation is aligned to Spec.
  • Tests - Add proper tests to the added code.

- Copy lodash.clonedeep to a file instead of importing it
- Add a module key to package.json
- Fix various linting issues (Delete unused lines, add missing return types)
@patrick-tolosa patrick-tolosa requested review from strausr and a user September 2, 2021 15:46
@@ -33,16 +31,6 @@ class CloudinaryConfig {
return this;
}

setAPIConfig(apiConfig: IApiConfig): this {
// placeholder
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added as a placeholder but was never used.

@@ -11,5 +11,6 @@
},
"main": "./bundles/umd/base.js",
"browser": "./index.js",
"module": "./index.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module is used by some build tools instead of main to correctly infer where the ESM code lives.

* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
Copy link

@ghost ghost Sep 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing as we already have an isObject function, and this file includes an isObject and this util and others, maybe we should move such functions to their own file and import here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but I wouldn't change this specific file, as it's an exact copy of lodash (we could potentially introduce new bugs by changing the implementation.

what do you think?

@patrick-tolosa patrick-tolosa merged commit a6dbf82 into master Sep 9, 2021
@patrick-tolosa patrick-tolosa deleted the fix/copy-clonedeep-due-to-module-errors branch September 9, 2021 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants