Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/identifier / dist / toThingIdentifier.js
Size: Mime:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * @alias toValueEqIdentity
 */
const toIdentityHash_1 = require("./toIdentityHash");
const IDENTIFIER_REGISTRY_1 = require("./IDENTIFIER_REGISTRY");
/**
 * we extract the 3 key properties into this
 */
const small = Object.seal({
    label: '',
    value: '',
    type: '',
});
function toThingIdentifier(obj) {
    if (IDENTIFIER_REGISTRY_1.IDENTIFIER_REFERENCE_REGISTRY.has(obj)) {
        return IDENTIFIER_REGISTRY_1.IDENTIFIER_REFERENCE_REGISTRY.get(obj);
    }
    // reuse for perf
    small.label = obj.label;
    small.value = obj.value;
    small.type = obj.type;
    // could simplify here or ignore
    // small.meta = obj.meta
    return toIdentityHash_1.toIdentityHash(small);
}
exports.toThingIdentifier = toThingIdentifier;
//# sourceMappingURL=toThingIdentifier.js.map