Skip to content

Commit 72dc843

Browse files
swap uuid generator with support for IE9 and IE10
1 parent 3309ff4 commit 72dc843

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
],
2828
"dependencies": {
2929
"agentkeepalive": "^3.1.0",
30+
"lil-uuid": "^0.1.1",
3031
"superagent": "^2.3.0",
31-
"superagent-proxy": "^1.0.2",
32-
"uuid": "^3.0.1"
32+
"superagent-proxy": "^1.0.2"
3333
},
3434
"noAnalyze": false,
3535
"devDependencies": {
@@ -90,4 +90,4 @@
9090
"engine": {
9191
"node": ">=0.8"
9292
}
93-
}
93+
}

src/core/pubnub-common.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* @flow */
22

3-
import uuidGenerator from 'uuid';
3+
import uuidGenerator from 'lil-uuid';
44

55
import Config from './components/config';
66
import Crypto from './components/cryptography/index';
@@ -230,7 +230,7 @@ export default class {
230230

231231

232232
static generateUUID(): string {
233-
return uuidGenerator.v4();
233+
return uuidGenerator();
234234
}
235235

236236
static OPERATIONS = OPERATIONS;

test/unit/common.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44
import sinon from 'sinon';
5-
import uuidGenerator from 'uuid';
5+
import uuidGenerator from 'lil-uuid';
66
import PubNub from '../../src/node/index';
77
import CryptoJS from '../../src/core/components/cryptography/hmac-sha256';
88

@@ -12,11 +12,11 @@ describe('#core / mounting point', () => {
1212
});
1313

1414
afterEach(() => {
15-
uuidGenerator.v4.restore();
15+
uuidGenerator();
1616
});
1717

1818
it('supports UUID generation', () => {
19-
assert.equal(PubNub.generateUUID(), 'uuidCustom');
19+
assert.equal(uuidGenerator.isUUID(PubNub.generateUUID()), true);
2020
});
2121

2222
it('supports encryption', () => {

0 commit comments

Comments
 (0)