11/**
22 * linear-converter - Copyright 2015 Javier Cejudo <javier@javiercejudo.com> (http://www.javiercejudo.com)
3- * @version v6.0.0
3+ * @version v6.0.2
44 * @link https://github.com/javiercejudo/linear-converter#readme
55 * @license MIT
66 */
@@ -27,58 +27,56 @@ module.exports = function factory(Decimal) {
2727
2828'use strict' ;
2929
30+ var normaliseFactory = require ( 'normalise' ) ;
31+ var scaleFactory = require ( 'scale-normalised' ) ;
32+
3033module . exports = function factory ( Decimal ) {
34+ var normalise = normaliseFactory ( Decimal ) . normalise ;
35+ var scale = scaleFactory ( Decimal ) . scale ;
3136 var api = { } ;
3237
33- api . scale = function scaleNormalised ( scale , x ) {
34- var scale0 = new Decimal ( scale [ 0 ] . toString ( ) ) ;
35-
36- return new Decimal ( scale [ 1 ] . toString ( ) ) . minus ( scale0 )
37- . times ( new Decimal ( x . toString ( ) ) ) . plus ( scale0 ) ;
38+ api . rescale = function rescale ( oldScale , newScale , x ) {
39+ return scale ( newScale , normalise ( oldScale , x ) ) ;
3840 } ;
3941
4042 return api ;
4143} ;
4244
43- } , { } ] , 3 :[ function ( require , module , exports ) {
45+ } , { "normalise" : 1 , "scale-normalised" : 3 } ] , 3 :[ function ( require , module , exports ) {
4446/*jshint node:true */
4547
4648'use strict' ;
4749
48- var normaliseFactory = require ( 'normalise' ) ;
49- var scaleFactory = require ( 'scale-normalised' ) ;
50-
5150module . exports = function factory ( Decimal ) {
52- var normalise = normaliseFactory ( Decimal ) . normalise ;
53- var scale = scaleFactory ( Decimal ) . scale ;
5451 var api = { } ;
5552
56- api . rescale = function rescale ( oldScale , newScale , x ) {
57- return scale ( newScale , normalise ( oldScale , x ) ) ;
53+ api . scale = function scaleNormalised ( scale , x ) {
54+ var scale0 = new Decimal ( scale [ 0 ] . toString ( ) ) ;
55+
56+ return new Decimal ( scale [ 1 ] . toString ( ) ) . minus ( scale0 )
57+ . times ( new Decimal ( x . toString ( ) ) ) . plus ( scale0 ) ;
5858 } ;
5959
6060 return api ;
6161} ;
6262
63- } , { "normalise" : 1 , "scale-normalised" : 2 } ] , 4 :[ function ( require , module , exports ) {
63+ } , { } ] , 4 :[ function ( require , module , exports ) {
6464/* jshint node:true */
6565
6666'use strict' ;
6767
68- module . exports = [ 0 , 1 ] ;
68+ var unitScale = require ( 'unit-scale' ) ;
6969
70- } , { } ] , 5 :[ function ( require , module , exports ) {
70+ module . exports = [ unitScale , unitScale ] ;
71+
72+ } , { "unit-scale" :5 } ] , 5 :[ function ( require , module , exports ) {
7173/* jshint node:true */
7274
7375'use strict' ;
7476
75- var unitScale = require ( 'unit-scale' ) ;
76-
77- module . exports = [ unitScale , unitScale ] ;
78-
79- } , { "unit-scale" :4 } ] , "linear-converter" :[ function ( require , module , exports ) {
80- /*jshint node:true */
77+ module . exports = [ 0 , 1 ] ;
8178
79+ } , { } ] , "linear-converter" :[ function ( require , module , exports ) {
8280'use strict' ;
8381
8482var rescaleFactory = require ( 'rescale' ) ;
@@ -167,4 +165,4 @@ module.exports = function factory(Decimal) {
167165 return api ;
168166} ;
169167
170- } , { "rescale" :3 , "unit-preset" :5 } ] } , { } , [ ] ) ;
168+ } , { "rescale" :2 , "unit-preset" :4 } ] } , { } , [ ] ) ;
0 commit comments