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/modules / ___dist / identifier / toThingIdentifier.js
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.toThingIdentifier = toThingIdentifier;

var _toIdentityHash = require("./toIdentityHash");

var _IDENTIFIER_REGISTRY = require("./IDENTIFIER_REGISTRY");

/**
 * @alias toValueEqIdentity
 */

/**
 * we extract the 3 key properties into this
 */
const small = Object.seal({
  label: '',
  value: '',
  type: '' // meta: '',
  // if we had, why use this
  // identifier: '',

});

function toThingIdentifier(obj) {
  if (_IDENTIFIER_REGISTRY.IDENTIFIER_REFERENCE_REGISTRY.has(obj)) {
    return _IDENTIFIER_REGISTRY.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 (0, _toIdentityHash.toIdentityHash)(small);
}