mirror of
https://github.com/nasa/openmct.git
synced 2025-04-17 15:59:09 +00:00
[Persistence] Expose IdentifierService
This commit is contained in:
parent
177c1874b9
commit
d8f3f0f430
@ -114,6 +114,12 @@
|
||||
"type": "provider",
|
||||
"implementation": "views/ViewProvider.js",
|
||||
"depends": [ "views[]", "$log" ]
|
||||
},
|
||||
{
|
||||
"provides": "identifierService",
|
||||
"type": "provider",
|
||||
"implementation": "identifiers/IdentifierProvider.js",
|
||||
"depends": [ "PERSISTENCE_SPACE" ]
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
|
@ -29,11 +29,11 @@ define(
|
||||
/**
|
||||
* Parses and generates domain object identifiers.
|
||||
*/
|
||||
function IdentifierService(defaultSpace) {
|
||||
function IdentifierProvider(defaultSpace) {
|
||||
this.defaultSpace = defaultSpace;
|
||||
}
|
||||
|
||||
IdentifierService.prototype.generate = function (space) {
|
||||
IdentifierProvider.prototype.generate = function (space) {
|
||||
var id = uuid();
|
||||
if (arguments.length > 0) {
|
||||
id = space + ":" + id;
|
||||
@ -41,10 +41,10 @@ define(
|
||||
return id;
|
||||
};
|
||||
|
||||
IdentifierService.prototype.parse = function (id) {
|
||||
IdentifierProvider.prototype.parse = function (id) {
|
||||
return new Identifier(id, this.defaultSpace);
|
||||
};
|
||||
|
||||
return IdentifierService;
|
||||
return IdentifierProvider;
|
||||
}
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user