-
Notifications
You must be signed in to change notification settings - Fork 368
feat: allow empty array in createAll method #2410
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
base: master
Are you sure you want to change the base?
Conversation
@@ -512,11 +512,18 @@ DataAccessObject.createAll = function(dataArray, options, cb) { | |||
options = options || {}; | |||
cb = cb || utils.createPromiseCallback(); | |||
|
|||
assert(typeof dataArray === 'object' && dataArray.length, | |||
'The data argument must be an array with length > 0'); | |||
assert(typeof dataArray === 'object' && Array.isArray(dataArray), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it configurable in order to ensure backward compatibility ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added sir
Also please sign off your commit. Follow DCO here - https://loopback.io/doc/en/contrib/code-contrib.html |
Signed-off-by: Ajay Prajapati <ajay.prajapati@Ajay-SFIN957.local>
723ab31
to
f6eee84
Compare
Pull Request Test Coverage Report for Build 15629436334Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Can you please add a test case for this option ? |
Added code to allow empty array in createAll method. Currently it throws error.
Include references to all related GitHub issues and other pull requests, for example:
Fixes #2409
-->
Checklist
npm test
passes on your machine