Skip to content

Commit 1436f0a

Browse files
committed
only urlEndpoint is required parameter
1 parent 4a0a434 commit 1436f0a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const ImageKit = function(opts) {
4646
};
4747

4848
function mandatoryParametersAvailable(options) {
49-
return options.publicKey && options.urlEndpoint;
49+
return options.urlEndpoint;
5050
}
5151

5252
function privateKeyPassed(options) {

test/initialization.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,16 @@ describe("Initialization checks", function () {
2121
expect(imagekit.url).to.exist.and.to.be.a('function');
2222
expect(imagekit.upload).to.exist.and.to.be.a('function');
2323
});
24+
25+
it('only urlEndpoint is required parameter', function () {
26+
let imagekit = new ImageKit({
27+
urlEndpoint: initializationParams.urlEndpoint
28+
});
29+
30+
expect(imagekit.options).to.be.an('object');
31+
expect(imagekit.options).to.have.property('urlEndpoint').to.be.equal(initializationParams.urlEndpoint);
32+
expect(imagekit.url).to.exist.and.to.be.a('function');
33+
expect(imagekit.upload).to.exist.and.to.be.a('function');
34+
35+
});
2436
});

0 commit comments

Comments
 (0)