Skip to content

Commit a0b268f

Browse files
committed
Removing deprecated suffixes option with a major version bump, updating README & LICENSE copyrights, updating dev dependencies
1 parent 5bcc3c4 commit a0b268f

15 files changed

+4992
-2182
lines changed

.npmignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
/test/
88
.idea
99
.eslintrc
10+
.gitignore
1011
.travis.yml
11-
Gruntfile.js
1212
bower.json
1313
composer.json
14+
Gruntfile.js

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: node_js
22
node_js:
33
- node
4+
- 10
5+
- 9
46
- 8
57
- 7
68
- 6

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018, Jason Mulligan
1+
Copyright (c) 2019, Jason Mulligan
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,13 @@ _*(number)*_ Decimal place, default is `2`
3333
_*(string)*_ Decimal separator character, default is `.`
3434

3535
### spacer
36-
_*(string)*_ Character between the `result` and `suffix`, default is `" "`
36+
_*(string)*_ Character between the `result` and `symbol`, default is `" "`
3737

3838
### standard
3939
_*(string)*_ Standard unit of measure, can be `iec` or `jedec`, default is `jedec`; can be overruled by `base`
4040

4141
### symbols
42-
_*(object)*_ Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
43-
44-
### suffixes (deprecated: use 'symbols')
45-
_*(object)*_ Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
42+
_*(object)*_ Dictionary of SI/JEDEC/IEC symbols to replace for localization, defaults to english if no match is found
4643

4744
### unix
4845
_*(boolean)*_ Enables unix style human readable output, e.g `ls -lh`, default is `false`
@@ -84,5 +81,5 @@ filesize.js supports AMD loaders (require.js, curl.js, etc.), node.js & npm (```
8481
An ES6 version is bundled with an npm install, but requires you load it with the full path, e.g. `require(path.join(__dirname, 'node_modules', 'filesize', 'lib', 'filesize.es6.js'))`.
8582

8683
## License
87-
Copyright (c) 2018 Jason Mulligan
84+
Copyright (c) 2019 Jason Mulligan
8885
Licensed under the BSD-3 license.

lib/filesize.es6.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* filesize
33
*
4-
* @copyright 2018 Jason Mulligan <[email protected]>
4+
* @copyright 2019 Jason Mulligan <[email protected]>
55
* @license BSD-3-Clause
6-
* @version 3.6.1
6+
* @version 4.0.0
77
*/
88
(function (global) {
99
const b = /^(b|B)$/,
@@ -45,7 +45,7 @@
4545
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
4646
separator = descriptor.separator !== void 0 ? descriptor.separator || "" : "";
4747
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
48-
symbols = descriptor.symbols || descriptor.suffixes || {};
48+
symbols = descriptor.symbols || {};
4949
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
5050
output = descriptor.output || "string";
5151
full = descriptor.fullform === true;
@@ -121,7 +121,7 @@
121121
}
122122

123123
if (output === "object") {
124-
return {value: result[0], suffix: result[1], symbol: result[1]};
124+
return {value: result[0], symbol: result[1]};
125125
}
126126

127127
if (full) {
@@ -141,10 +141,8 @@
141141
// CommonJS, AMD, script tag
142142
if (typeof exports !== "undefined") {
143143
module.exports = filesize;
144-
} else if (typeof define === "function" && define.amd) {
145-
define(() => {
146-
return filesize;
147-
});
144+
} else if (typeof define === "function" && define.amd !== void 0) {
145+
define(() => filesize);
148146
} else {
149147
global.filesize = filesize;
150148
}

lib/filesize.es6.min.js

+18-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/filesize.es6.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/filesize.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/**
44
* filesize
55
*
6-
* @copyright 2018 Jason Mulligan <[email protected]>
6+
* @copyright 2019 Jason Mulligan <[email protected]>
77
* @license BSD-3-Clause
8-
* @version 3.6.1
8+
* @version 4.0.0
99
*/
1010
(function (global) {
1111
var b = /^(b|B)$/,
@@ -63,7 +63,7 @@
6363
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
6464
separator = descriptor.separator !== void 0 ? descriptor.separator || "" : "";
6565
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
66-
symbols = descriptor.symbols || descriptor.suffixes || {};
66+
symbols = descriptor.symbols || {};
6767
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
6868
output = descriptor.output || "string";
6969
full = descriptor.fullform === true;
@@ -139,7 +139,7 @@
139139
}
140140

141141
if (output === "object") {
142-
return { value: result[0], suffix: result[1], symbol: result[1] };
142+
return { value: result[0], symbol: result[1] };
143143
}
144144

145145
if (full) {
@@ -163,7 +163,7 @@
163163
// CommonJS, AMD, script tag
164164
if (typeof exports !== "undefined") {
165165
module.exports = filesize;
166-
} else if (typeof define === "function" && define.amd) {
166+
} else if (typeof define === "function" && define.amd !== void 0) {
167167
define(function () {
168168
return filesize;
169169
});

lib/filesize.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/filesize.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)