<commit_before>/*jshint node:true */

'use strict';

var lcFactory = require('linear-converter');

module.exports = function factory(Decimal) {
  var lc = lcFactory(Decimal);

  function LinearConversion(conversion) {
    this.getConversion = function getConversion() {
      return conversion;
    };
  }

  LinearConversion.reviver = function(key, x) {
    return new LinearConversion(x);
  };

  var proto = LinearConversion.prototype;

  proto.convert = function convert(x) {
    return lc.convert(this.getConversion(), x);
  };

  proto.invert = function invert() {
    return new LinearConversion(lc.invertPreset(this.getConversion()));
  };

  proto.compose = function compose(linearConversion) {
    var composition = lc.composePresets(this.getConversion(), linearConversion.getConversion());

    return new LinearConversion(composition);
  };

  proto.getCoefficientA = function getCoefficientA() {
    return lc.getCoefficientA(this.getConversion());
  };

  proto.getCoefficientB = function getCoefficientB() {
    return lc.getCoefficientB(this.getConversion());
  };

  proto.equates = function equates(linearConversion) {
    return lc.equivalentPresets(this.getConversion(), linearConversion.getConversion());
  };

  proto.valueOf = proto.toJSON = function toString() {
    return this.getConversion();
  };

  proto.toString = function toString() {
    return this.getConversion().toString();
  };

  return LinearConversion;
}
<commit_msg>chore(converter): adapt to latest version of linear-converter<commit_after>/*jshint node:true */

'use strict';

var lcFactory = require('linear-converter');

module.exports = function factory(Decimal) {
  var lc = lcFactory(Decimal);

  function LinearConversion(conversion) {
    this.getConversion = function getConversion() {
      return conversion;
    };
  }

  LinearConversion.reviver = function(key, x) {
    return new LinearConversion(x);
  };

  var proto = LinearConversion.prototype;

  proto.convert = function convert(x) {
    return lc.convert(this.getConversion(), x);
  };

  proto.invert = function invert() {
    return new LinearConversion(lc.invertConversion(this.getConversion()));
  };

  proto.compose = function compose(linearConversion) {
    var composition = lc.composeConversions(this.getConversion(), linearConversion.getConversion());

    return new LinearConversion(composition);
  };

  proto.getCoefficientA = function getCoefficientA() {
    return lc.getCoefficientA(this.getConversion());
  };

  proto.getCoefficientB = function getCoefficientB() {
    return lc.getCoefficientB(this.getConversion());
  };

  proto.equates = function equates(linearConversion) {
    return lc.equivalentConversions(this.getConversion(), linearConversion.getConversion());
  };

  proto.valueOf = proto.toJSON = function toString() {
    return this.getConversion();
  };

  proto.toString = function toString() {
    return this.getConversion().toString();
  };

  return LinearConversion;
};

{'fraction_non_alphanumeric': 0.1232784682566342, 'fraction_numerical': 0.0, 'mean_word_length': 4.434306569343065, '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': '6478229', 'n_tokens_mistral': 945, 'n_tokens_neox': 894, 'n_words': 166}