2018-08-25 13:11:54 +09:00
|
|
|
import config from '../../../config';
|
|
|
|
import * as uuid from 'uuid';
|
|
|
|
|
|
|
|
export default (x: any) => {
|
2018-11-17 03:25:48 +09:00
|
|
|
if (x == null) return null;
|
|
|
|
|
2018-08-25 13:11:54 +09:00
|
|
|
if (x !== null && typeof x === 'object' && x.id == null) {
|
|
|
|
x.id = `${config.url}/${uuid.v4()}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Object.assign({
|
|
|
|
'@context': [
|
|
|
|
'https://www.w3.org/ns/activitystreams',
|
|
|
|
'https://w3id.org/security/v1',
|
|
|
|
{ Hashtag: 'as:Hashtag' }
|
|
|
|
]
|
|
|
|
}, x);
|
|
|
|
};
|