<commit_before>/** @directiv data-stateless */

exports.requires = ['hyper-store'];

exports.exposes = [
  'data-hyper-img',
  'data-hyper-image',
  'data-src'
];

exports.compile = function(input) {
  var path = input.split('.');
  return {
    path: input,
    target: path[path.length - 1]
  };
};

exports.state = function(config, state) {
  var res = this('hyper-store').get(config.path, state.get());
  if (!res.completed) return false;
  return state.set(config.target, res.value);
};

exports.props = function(config, state, props) {
  var image = state.get(config.target);
  if (!image || !image.src) return props;
  var commit = {
    src: {$set: image.src}
  };
  if (image.title) commit.title = {
    $set: image.title
  }
  return props.set(commit);
};<commit_msg>update the interface<commit_after>/**
 * Module dependencies
 */

hyperImg.requires = ['store-hyper'];

/**
 * Expose the 'hyper-img' directive
 */

module.exports = hyperImg;

/**
 * Initialize the 'hyper-img' directive
 *
 * @param {StoreHyper} store
 */

function hyperImg(store) {
  this.compile = function(input) {
    var path = input.split('.');
    return {
      path: input,
      target: path[path.length - 1]
    };
  };

  this.state = function(config, state) {
    var res = store.get(config.path, state);
    if (!res.completed) return false;
    return state.set(config.target, res.value);
  };

  this.props = function(config, state, props) {
    var image = state.get(config.target);
    if (!image || !image.src) return props;
    if (image.title) props = props.set('title', image.title);
    return props.set('src', image.src);
  };
}
{'fraction_non_alphanumeric': 0.1747394236664623, 'fraction_numerical': 0.001226241569589209, 'mean_word_length': 3.294736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3324992', 'n_tokens_mistral': 557, 'n_tokens_neox': 547, 'n_words': 125}