From d92657b13081fb9893228400822776e06dbf5a81 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 27 May 2020 23:50:07 +0000 Subject: [PATCH] fix(core): update --- package.json | 1 - ts/lik.objectmap.ts | 10 +++++++++- ts/lik.plugins.ts | 3 +-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4f7d126..8992a2d 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartrx": "^2.0.15", "@pushrocks/smarttime": "^3.0.18", - "@pushrocks/smartunique": "^3.0.3", "@types/minimatch": "^3.0.3", "symbol-tree": "^3.2.4" }, diff --git a/ts/lik.objectmap.ts b/ts/lik.objectmap.ts index 21fca52..8e6dbe9 100644 --- a/ts/lik.objectmap.ts +++ b/ts/lik.objectmap.ts @@ -1,6 +1,14 @@ import * as plugins from './lik.plugins'; import { FastMap } from './lik.fastmap'; +export const uni = (prefix: string = 'uni') => { + return `${prefix}xxxxxxxxxxx`.replace(/[xy]/g, c => { + const r = (Math.random() * 16) | 0; + const v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); +}; + export interface IObjectmapForEachFunction { (itemArg: T): void; } @@ -64,7 +72,7 @@ export class ObjectMap { } // otherwise lets create it - const uniqueKey = plugins.smartunique.shortId(); + const uniqueKey = uni('key'); this.addMappedUnique(uniqueKey, objectArg); return uniqueKey; } diff --git a/ts/lik.plugins.ts b/ts/lik.plugins.ts index 784d0b7..821bb6a 100644 --- a/ts/lik.plugins.ts +++ b/ts/lik.plugins.ts @@ -6,9 +6,8 @@ import * as smartmatch from '@pushrocks/smartmatch'; import * as smartpromise from '@pushrocks/smartpromise'; import * as smartrx from '@pushrocks/smartrx'; import * as smarttime from '@pushrocks/smarttime'; -import * as smartunique from '@pushrocks/smartunique'; -export { smartdelay, smartmatch, smartpromise, smartrx, smarttime, smartunique }; +export { smartdelay, smartmatch, smartpromise, smartrx, smarttime }; // ============== // third party