@syncot/presence
Advanced tools
Comparing version
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.0.22](https://github.com/SyncOT/SyncOT/compare/@syncot/presence@0.0.21...@syncot/presence@0.0.22) (2020-11-03) | ||
**Note:** Version bump only for package @syncot/presence | ||
## [0.0.21](https://github.com/SyncOT/SyncOT/compare/@syncot/presence@0.0.20...@syncot/presence@0.0.21) (2020-01-28) | ||
@@ -8,0 +16,0 @@ |
import { createInvalidEntityError } from '@syncot/error'; | ||
import { validate } from '@syncot/util'; | ||
export const validatePresence = validate([ | ||
presence => typeof presence === 'object' && presence != null | ||
(presence) => typeof presence === 'object' && presence != null | ||
? undefined | ||
: createInvalidEntityError('Presence', presence, null), | ||
presence => typeof presence.sessionId === 'string' | ||
(presence) => typeof presence.sessionId === 'string' | ||
? undefined | ||
: createInvalidEntityError('Presence', presence, 'sessionId'), | ||
presence => typeof presence.userId === 'string' | ||
(presence) => typeof presence.userId === 'string' | ||
? undefined | ||
: createInvalidEntityError('Presence', presence, 'userId'), | ||
presence => typeof presence.locationId === 'string' | ||
(presence) => typeof presence.locationId === 'string' | ||
? undefined | ||
: createInvalidEntityError('Presence', presence, 'locationId'), | ||
presence => typeof presence.lastModified === 'number' && | ||
(presence) => typeof presence.lastModified === 'number' && | ||
Number.isFinite(presence.lastModified) | ||
? undefined | ||
: createInvalidEntityError('Presence', presence, 'lastModified'), | ||
presence => presence.hasOwnProperty('data') | ||
(presence) => presence.hasOwnProperty('data') | ||
? undefined | ||
: createInvalidEntityError('Presence', presence, 'data'), | ||
]); |
{ | ||
"name": "@syncot/presence", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Interfaces and type definitions related to global presence management.", | ||
@@ -30,10 +30,10 @@ "keywords": [ | ||
"dependencies": { | ||
"@syncot/error": "^0.2.0", | ||
"@syncot/events": "^0.1.1", | ||
"@syncot/util": "^1.0.1", | ||
"@syncot/error": "^0.2.1", | ||
"@syncot/events": "^0.1.2", | ||
"@syncot/util": "^1.0.2", | ||
"@types/readable-stream": "^2.3.1", | ||
"readable-stream": "^3.3.0", | ||
"tslib": "^1.9.3" | ||
"tslib": "^2.0.3" | ||
}, | ||
"gitHead": "4c301b17359a9fc7e7da55677f752f7b74a4b2e3" | ||
"gitHead": "2399fa565e50dcfc2f4d37afd567c6cbcfdccb15" | ||
} |
8498
2.31%- Removed
Updated
Updated
Updated
Updated