diff --git a/ui/package.json b/ui/package.json index 51e89e7..dc8ffc4 100755 --- a/ui/package.json +++ b/ui/package.json @@ -24,12 +24,13 @@ "@angular/platform-browser-dynamic": "^6.1.7", "@angular/router": "^6.1.7", "@auth0/angular-jwt": "^2.0.0", + "@types/hashids": "^1.0.30", "angular2-toaster": "^6.1.0", "bootswatch": "^4.1.3", "clipboard": "^1.7.1", "core-js": "^2.4.1", "font-awesome": "^4.7.0", - "hashids": "^1.1.1", + "hashids": "^1.2.2", "markdown-it": "^8.3.1", "moment": "^2.22.1", "ngx-bootstrap": "^2.0.5", diff --git a/ui/src/app/shared/tools.class.ts b/ui/src/app/shared/tools.class.ts index b73b341..ccc93e2 100755 --- a/ui/src/app/shared/tools.class.ts +++ b/ui/src/app/shared/tools.class.ts @@ -1,6 +1,6 @@ import { MessageType, User, Candidate, Question, DecodedHashId } from './'; -import * as Hashids from 'hashids'; +import {default as Hashids} from 'hashids'; export class Tools { @@ -67,22 +67,22 @@ export class Tools { static decodeHashId(hashId: string): DecodedHashId { - let hashids = new Hashids(); + let hashids = new Hashids(""); if (hashId.startsWith(this.hashIdReadOnlyPrefix)) { return { - id: hashids.decode(hashId.split(this.hashIdReadOnlyPrefix)[1]), + id: hashids.decode(hashId.split(this.hashIdReadOnlyPrefix)[1])[0], readOnly: true } } else { return { - id: hashids.decode(hashId), + id: hashids.decode(hashId)[0], readOnly: false } } } static encodeHashId(id: number, readOnly: boolean = false): string { - let hashids = new Hashids(); + let hashids = new Hashids(""); if (!readOnly) { return hashids.encode(id); diff --git a/ui/yarn.lock b/ui/yarn.lock index f060f68..7222898 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -241,11 +241,23 @@ semver "^5.3.0" semver-intersect "^1.1.2" +"@types/hashids@^1.0.30": + version "1.0.30" + resolved "https://registry.yarnpkg.com/@types/hashids/-/hashids-1.0.30.tgz#c0a056b25c5b13c80bf330fb8d379ac4d4049999" + integrity sha512-ESXJxz/GRY+SGa3n0WuWZLR0xM3k8LTr4+2xOoj/a0ZThglF/UfEeKVaMQNNFvFQ+mw3ng8LbC3gmJx/GmR5EQ== + dependencies: + "@types/node" "*" + "@types/jasmine@2.5.38": version "2.5.38" resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.5.38.tgz#a4379124c4921d4e21de54ec74669c9e9b356717" integrity sha1-pDeRJMSSHU4h3lTsdGacnps1Zxc= +"@types/node@*": + version "10.11.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.3.tgz#c055536ac8a5e871701aa01914be5731539d01ee" + integrity sha512-3AvcEJAh9EMatxs+OxAlvAEs7OTy6AG94mcH1iqyVDwVVndekLxzwkWQ/Z4SDbY6GO2oyUXyWW8tQ4rENSSQVQ== + "@types/node@^6.0.46", "@types/node@~6.0.60": version "6.0.117" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.117.tgz#ccfc2506001404708528d657aad9c1b931111646" @@ -3079,7 +3091,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hashids@^1.1.1: +hashids@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/hashids/-/hashids-1.2.2.tgz#28635c7f2f7360ba463686078eee837479e8eafb" integrity sha512-dEHCG2LraR6PNvSGxosZHIRgxF5sNLOIBFEHbj8lfP9WWmu/PWPMzsip1drdVSOFi51N2pU7gZavrgn7sbGFuw==