Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0",
"typedoc": "^0.13.0",
"typescript": "^3.1.6"
"typescript": "^3.1.6",
"uuid": "^3.3.2"
},
"peerDependencies": {
"aws-sdk": "^2.286.1",
"lodash": "^4.17.10",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0"
"rxjs": "^6.0.0",
"uuid": "^3.3.2"
}
}
3 changes: 2 additions & 1 deletion src/mapper/mapper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {v4 as uuidv4} from 'uuid'
import { Metadata } from '../decorator/metadata/metadata'
import { metadataForClass, metadataForProperty } from '../decorator/metadata/metadata-helper'
import { Key, PropertyMetadata } from '../decorator/metadata/property-metadata.model'
Expand All @@ -16,7 +17,7 @@ import { Binary } from './type/binary.type'
import { EnumType } from './type/enum.type'
import { NullType } from './type/null.type'
import { UndefinedType } from './type/undefined.type'
import { typeOf, typeOfFromDb, uuidv4 } from './util'
import { typeOf, typeOfFromDb } from './util'

const mapperForType: Map<AttributeValueType, MapperForType<any, any>> = new Map()

Expand Down
10 changes: 0 additions & 10 deletions src/mapper/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,3 @@ export function typeName(type: any): 'Null' | 'Undefined' | string {

throw new Error(`was not able to resolve type name for type ${type}`)
}

// FIXME UUID replace with a more bullet proof implementation node uuid module requires crypto, need to figure out how to use it with browser
export function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
// tslint:disable
let r = (Math.random() * 16) | 0,
v = c == 'x' ? r : (r & 0x3) | 0x8
return v.toString(16)
})
}