Skip to content

Commit 52af6f4

Browse files
Merge pull request #28 from xanthous-tech/uniqid
Uniqid
2 parents 1a32e8f + ab436dd commit 52af6f4

6 files changed

Lines changed: 20 additions & 48 deletions

File tree

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@xanthous/dgraph-orm",
3-
"version": "0.2.0-alpha9",
3+
"version": "0.3.2",
44
"description": "dgraph ORM in TypeScript",
55
"main": "dist/index.js",
66
"author": "Xanthous Tech Developers <hi@x-tech.io>",
@@ -19,9 +19,7 @@
1919
"scripts": {
2020
"clean": "rimraf dist",
2121
"build": "tsc -p tsconfig.build.json",
22-
"postinstall": "npm run clean && npm run build",
23-
"prestart": "npm run postinstall",
24-
"prepublish": "npm run test && npm run postinstall",
22+
"prepublish": "npm run test && npm run clean && npm run build",
2523
"lint": "eslint ./src --ext .ts",
2624
"lint:fix": "eslint --fix",
2725
"format": "prettier --write",
@@ -41,6 +39,7 @@
4139
"@babel/preset-env": "^7.7.1",
4240
"@babel/preset-typescript": "^7.7.2",
4341
"@types/jest": "^24.0.23",
42+
"@types/uniqid": "^4.1.3",
4443
"@typescript-eslint/eslint-plugin": "^2.16.0",
4544
"@typescript-eslint/parser": "^2.16.0",
4645
"eslint": "^6.8.0",
@@ -64,9 +63,9 @@
6463
"debug": "^4.1.1",
6564
"dgraph-js": "^2.0.2",
6665
"grpc": "^1.24.2",
67-
"instauuid": "^1.0.4",
6866
"lodash": "^4.17.15",
69-
"reflect-metadata": "^0.1.13"
67+
"reflect-metadata": "^0.1.13",
68+
"uniqid": "^5.2.0"
7069
},
7170
"volta": {
7271
"node": "10.18.1",

src/transaction/transaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Quad } from 'n3';
2-
import * as UUID from 'instauuid';
2+
import uniqid from 'uniqid';
33
import { plainToClass } from 'class-transformer';
44

55
import { IPredicate } from '..';
@@ -109,7 +109,7 @@ export class Transaction<T extends Object, V> implements ITransaction<T> {
109109
// new created node instance when assigning data to it.
110110
delete data.uid;
111111
} else {
112-
id = UUID('hex').toString();
112+
id = uniqid();
113113
this.tempIDS.set(nodeInstance, id);
114114
}
115115

tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"module": "commonjs",
77
"declaration": true,
88
"removeComments": true,
9+
"esModuleInterop": true,
910
"emitDecoratorMetadata": true,
1011
"experimentalDecorators": true,
1112
"target": "es2015",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"module": "commonjs",
77
"declaration": true,
88
"removeComments": true,
9+
"esModuleInterop": true,
910
"emitDecoratorMetadata": true,
1011
"experimentalDecorators": true,
1112
"target": "es2015",

types/instauuid.d.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

yarn.lock

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,11 @@
989989
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
990990
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
991991

992+
"@types/uniqid@^4.1.3":
993+
version "4.1.3"
994+
resolved "https://registry.yarnpkg.com/@types/uniqid/-/uniqid-4.1.3.tgz#db256fb3e7717e9e4c292a5cfd12cb9e0e6d0ffa"
995+
integrity sha512-MZIMT54byy2Oqjf+fk4xI13JuMe/cWbXxAGz99LvvCmpZVErKO7W+7XYVXSy+zKRwvc1hbyDCMvzBW/fhMDeTw==
996+
992997
"@types/validator@10.11.3":
993998
version "10.11.3"
994999
resolved "https://registry.yarnpkg.com/@types/validator/-/validator-10.11.3.tgz#945799bef24a953c5bc02011ca8ad79331a3ef25"
@@ -2923,14 +2928,6 @@ inquirer@^7.0.0:
29232928
strip-ansi "^5.1.0"
29242929
through "^2.3.6"
29252930

2926-
instauuid@^1.0.4:
2927-
version "1.0.4"
2928-
resolved "https://registry.yarnpkg.com/instauuid/-/instauuid-1.0.4.tgz#6cbbd38d97d898f3630d72f8b09bb5c70c512644"
2929-
integrity sha1-bLvTjZfYmPNjDXL4sJu1xwxRJkQ=
2930-
dependencies:
2931-
long "^2.2.3"
2932-
nan "^2.0.9"
2933-
29342931
interpret@^1.0.0:
29352932
version "1.2.0"
29362933
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
@@ -3957,11 +3954,6 @@ log-update@^2.3.0:
39573954
cli-cursor "^2.0.0"
39583955
wrap-ansi "^3.0.1"
39593956

3960-
long@^2.2.3:
3961-
version "2.4.0"
3962-
resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f"
3963-
integrity sha1-n6GAux2VAM3CnEFWdmoZleH0Uk8=
3964-
39653957
long@~3:
39663958
version "3.2.0"
39673959
resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b"
@@ -4157,7 +4149,7 @@ mute-stream@0.0.8:
41574149
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
41584150
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
41594151

4160-
nan@^2.0.9, nan@^2.12.1, nan@^2.13.2:
4152+
nan@^2.12.1, nan@^2.13.2:
41614153
version "2.14.0"
41624154
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
41634155
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==
@@ -5905,6 +5897,11 @@ union-value@^1.0.0:
59055897
is-extendable "^0.1.1"
59065898
set-value "^2.0.1"
59075899

5900+
uniqid@^5.2.0:
5901+
version "5.2.0"
5902+
resolved "https://registry.yarnpkg.com/uniqid/-/uniqid-5.2.0.tgz#0d0589a7e9ce07116848126764fbff0b68e74329"
5903+
integrity sha512-LH8zsvwJ/GL6YtNfSOmMCrI9piraAUjBfw2MCvleNE6a4pVKJwXjG2+HWhkVeFcSg+nmaPKbMrMOoxwQluZ1Mg==
5904+
59085905
unique-string@^1.0.0:
59095906
version "1.0.0"
59105907
resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a"

0 commit comments

Comments
 (0)