dist/tulipan.cjs.js
/**
   * Cache a fragment using track-by or the object key.
   *
   * @param {*} value
   * @param {Fragment} frag
   * @param {Number} index
   * @param {String} [key]
   */
Cache a fragment using track-by or the object key.
Cache a fragment using track - by or the object key .
function cacheFrag(value, frag, index, key) {
    var trackByKey = this.params.trackBy;
    var cache = this.cache;
    var primitive = !isObject(value);
    var id;
    if (key || trackByKey || primitive) {
      id = getTrackByKey(index, key, value, trackByKey);
      if (!cache[id]) {
        cache[id] = frag;
      } else if (trackByKey !== '$index') {
        'development' !== 'production' && this.warnDuplicate(value);
      }
    } else {
      id = this.id;
      if (hasOwn(value, id)) {
        if (value[id] === null) {
          value[id] = frag;
        } else {
          'development' !== 'production' && this.warnDuplicate(value);
        }
      } else if (Object.isExtensible(value)) {
        def(value, id, frag);
      } else if ('development' !== 'production') {
        warn('Frozen tp-for objects cannot be automatically tracked, make sure to ' + 'provide a track-by key.');
      }
    }
    frag.raw = value;
  }
function cacheFrag ( value , frag , index , key ) { var trackByKey = this . params . trackBy ; var cache = this . cache ; var primitive = ! isObject ( value ) ; var id ; if ( key || trackByKey || primitive ) { id = getTrackByKey ( index , key , value , trackByKey ) ; if ( ! cache [ id ] ) { cache [ id ] = frag ; } else if ( trackByKey !== '$index' ) { 'development' !== 'production' && this . warnDuplicate ( value ) ; } } else { id = this . id ; if ( hasOwn ( value , id ) ) { if ( value [ id ] === null ) { value [ id ] = frag ; } else { 'development' !== 'production' && this . warnDuplicate ( value ) ; } } else if ( Object . isExtensible ( value ) ) { def ( value , id , frag ) ; } else if ( 'development' !== 'production' ) { warn ( 'Frozen tp-for objects cannot be automatically tracked, make sure to ' + 'provide a track-by key.' ) ; } } frag . raw = value ; }
Cache a fragment using track-by or the object key.
Cache a fragment using track - by or the object key .