1234567891011121314151617181920 |
- "use strict";
- class Id {
- constructor(className, objectId) {
- this.className = className;
- this.objectId = objectId;
- }
- toString() {
- return this.className + ':' + this.objectId;
- }
- static fromString(str) {
- var split = str.split(':');
- if (split.length !== 2) {
- throw new TypeError('Cannot create Id object from this string');
- }
- return new Id(split[0], split[1]);
- }
- }
- module.exports = Id;
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJJZCIsImNvbnN0cnVjdG9yIiwiY2xhc3NOYW1lIiwib2JqZWN0SWQiLCJ0b1N0cmluZyIsImZyb21TdHJpbmciLCJzdHIiLCJzcGxpdCIsImxlbmd0aCIsIlR5cGVFcnJvciIsIm1vZHVsZSIsImV4cG9ydHMiXSwic291cmNlcyI6WyIuLi8uLi9zcmMvTGl2ZVF1ZXJ5L0lkLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIElkIHtcbiAgY2xhc3NOYW1lOiBzdHJpbmc7XG4gIG9iamVjdElkOiBzdHJpbmc7XG5cbiAgY29uc3RydWN0b3IoY2xhc3NOYW1lOiBzdHJpbmcsIG9iamVjdElkOiBzdHJpbmcpIHtcbiAgICB0aGlzLmNsYXNzTmFtZSA9IGNsYXNzTmFtZTtcbiAgICB0aGlzLm9iamVjdElkID0gb2JqZWN0SWQ7XG4gIH1cbiAgdG9TdHJpbmcoKTogc3RyaW5nIHtcbiAgICByZXR1cm4gdGhpcy5jbGFzc05hbWUgKyAnOicgKyB0aGlzLm9iamVjdElkO1xuICB9XG5cbiAgc3RhdGljIGZyb21TdHJpbmcoc3RyOiBzdHJpbmcpIHtcbiAgICB2YXIgc3BsaXQgPSBzdHIuc3BsaXQoJzonKTtcbiAgICBpZiAoc3BsaXQubGVuZ3RoICE9PSAyKSB7XG4gICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdDYW5ub3QgY3JlYXRlIElkIG9iamVjdCBmcm9tIHRoaXMgc3RyaW5nJyk7XG4gICAgfVxuIC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