1
0
mirror of https://github.com/MikeMcl/decimal.js.git synced 2024-10-27 20:34:12 +00:00

v2.1.0 Amend UMD for browserify

This commit is contained in:
Michael Mclaughlin 2014-06-04 23:07:51 +01:00
parent cb4c245896
commit 7524fbaefe
4 changed files with 29 additions and 22 deletions

View File

@ -198,6 +198,9 @@ See LICENCE.
## Change Log ## Change Log
####2.1.0
* 4/06/2014 Amend UMD
####2.0.3 ####2.0.3
* 8/05/2014 Fix NaN toNumber * 8/05/2014 Fix NaN toNumber

View File

@ -1,10 +1,10 @@
/*! decimal.js v2.0.3 https://github.com/MikeMcl/decimal.js/LICENCE */ /*! decimal.js v2.1.0 https://github.com/MikeMcl/decimal.js/LICENCE */
;(function (global) { ;(function (global) {
'use strict'; 'use strict';
/* /*
* decimal.js v2.0.3 * decimal.js v2.1.0
* An arbitrary-precision Decimal type for JavaScript. * An arbitrary-precision Decimal type for JavaScript.
* https://github.com/MikeMcl/decimal.js * https://github.com/MikeMcl/decimal.js
* Copyright (c) 2014 Michael Mclaughlin <M8ch88l@gmail.com> * Copyright (c) 2014 Michael Mclaughlin <M8ch88l@gmail.com>
@ -767,7 +767,7 @@
a = x['s']; a = x['s'];
id = 10; id = 10;
y = new Decimal( y, b ) ; y = new Decimal( y, b );
b = y['s']; b = y['s'];
// Either NaN? // Either NaN?
@ -846,7 +846,7 @@
// Only start adding at yc.length - 1 as the further digits of #xc can be left as they are. // Only start adding at yc.length - 1 as the further digits of #xc can be left as they are.
for ( a = yc.length, b = 0; a; xc[a] %= 10 ) { for ( a = yc.length, b = 0; a; xc[a] %= 10 ) {
b = ( xc[--a] = xc[a] + yc[a] + b ) / 10 | 0; b = ( xc[--a] = xc[a] + yc[a] + b ) / 10 | 0;
} }
if (b) { if (b) {
@ -3594,30 +3594,34 @@
// Export. // Export.
// AMD.
if ( typeof define == 'function' && define.amd ) {
crypto = global['crypto'];
define(function () {
return DecimalConstructor;
});
// Node and other CommonJS-like environments that support module.exports. // Node and other CommonJS-like environments that support module.exports.
if ( typeof module != 'undefined' && module && module.exports ) { } else if ( typeof module != 'undefined' && module && module.exports ) {
module.exports = DecimalConstructor; module.exports = DecimalConstructor;
if ( typeof require == 'function' ) { if ( typeof require == 'function' ) {
crypto = require('crypto'); crypto = require('crypto');
} }
// Browser.
} else { } else {
crypto = global['crypto']; crypto = global['crypto'];
noConflict = global['Decimal'];
//AMD. DecimalConstructor['noConflict'] = function () {
if ( typeof define == 'function' && define.amd ) { global['Decimal'] = noConflict;
define( function () { return DecimalConstructor } );
//Browser. return DecimalConstructor;
} else { };
noConflict = global['Decimal'];
DecimalConstructor['noConflict'] = function () { global['Decimal'] = DecimalConstructor;
global['Decimal'] = noConflict;
return DecimalConstructor;
};
global['Decimal'] = DecimalConstructor;
}
} }
})(this); })(this);

4
decimal.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"name": "decimal.js", "name": "decimal.js",
"description": "An arbitrary-precision Decimal type for JavaScript.", "description": "An arbitrary-precision Decimal type for JavaScript.",
"version": "2.0.3", "version": "2.1.0",
"keywords": [ "keywords": [
"arbitrary", "arbitrary",
"precision", "precision",
@ -31,6 +31,6 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "node ./test/every-test.js", "test": "node ./test/every-test.js",
"build": "uglifyjs decimal.js -c -m -o decimal.min.js --preamble '/* decimal.js v2.0.3 https://github.com/MikeMcl/decimal.js/LICENCE */'" "build": "uglifyjs decimal.js -c -m -o decimal.min.js --preamble '/* decimal.js v2.1.0 https://github.com/MikeMcl/decimal.js/LICENCE */'"
} }
} }