Skip to content

Commit 6b21a74

Browse files
committed
chore: remove unused dependency
1 parent da0b778 commit 6b21a74

File tree

3 files changed

+2
-33
lines changed

3 files changed

+2
-33
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
"homepage": "https://github.com/Leanplum/Leanplum-JavaScript-SDK#readme",
110110
"dependencies": {
111111
"@qiwi/semrel-metabranch": "^3.1.2",
112-
"clevertap-web-sdk": "^1.3.3",
113-
"sha.js": "2.4.9"
112+
"clevertap-web-sdk": "^1.3.3"
114113
}
115114
}

src/MigrationManager.ts

-22
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { CreateRequestFunction, MigrationState } from './types/internal'
33
import StorageManager from './StorageManager'
44
import Constants from './Constants'
55
import ArgsBuilder from './ArgsBuilder'
6-
import shajs from 'sha.js'
76

87
type Region = 'eu1' | 'in1' | 'sg1' | 'us1' | 'sk1';
98

@@ -244,7 +243,6 @@ export enum IdentityState {
244243

245244
export class IdentityManager {
246245
private state: IdentityState = IdentityState.ANONYMOUS
247-
private anonymousLoginUserId: string
248246

249247
constructor(
250248
private userId: string,
@@ -255,7 +253,6 @@ export class IdentityManager {
255253

256254
public setUserId(userId: string): void {
257255
if (this.state === IdentityState.ANONYMOUS) {
258-
this.anonymousLoginUserId = userId
259256
this.state = IdentityState.IDENTIFIED
260257
}
261258
this.userId = userId
@@ -270,33 +267,14 @@ export class IdentityManager {
270267
}
271268

272269
public identifyNonAnonymous(): void {
273-
if (this.state === IdentityState.ANONYMOUS) {
274-
this.anonymousLoginUserId = this.userId
275-
}
276270
this.state = IdentityState.IDENTIFIED
277271
}
278272

279-
public get cleverTapID(): string {
280-
if (this.userId !== this.anonymousLoginUserId && !this.isAnonymous) {
281-
const sha = this.sha256(this.userId)
282-
283-
return `${this.deviceId}_${sha}`
284-
}
285-
286-
return this.deviceId
287-
}
288-
289273
public get profile(): { [key: string]: string } {
290274
return { Identity: this.userId }
291275
}
292276

293277
public get isAnonymous(): boolean {
294278
return this.userId === this.deviceId
295279
}
296-
297-
private sha256(s: string): string {
298-
const sha = new shajs.sha256().update(s).digest('hex')
299-
300-
return sha.substring(0, 10)
301-
}
302280
}

yarn.lock

+1-9
Original file line numberDiff line numberDiff line change
@@ -6575,7 +6575,7 @@ rxjs@^6.5.3:
65756575
dependencies:
65766576
tslib "^1.9.0"
65776577

6578-
safe-buffer@^5.0.1, safe-buffer@^5.1.0:
6578+
safe-buffer@^5.1.0:
65796579
version "5.2.1"
65806580
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
65816581
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
@@ -6728,14 +6728,6 @@ set-value@^2.0.0, set-value@^2.0.1:
67286728
is-plain-object "^2.0.3"
67296729
split-string "^3.0.1"
67306730

6731-
6732-
version "2.4.9"
6733-
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d"
6734-
integrity sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==
6735-
dependencies:
6736-
inherits "^2.0.1"
6737-
safe-buffer "^5.0.1"
6738-
67396731
shallow-clone@^3.0.0:
67406732
version "3.0.1"
67416733
resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"

0 commit comments

Comments
 (0)