Skip to content

Commit

Permalink
Removing deprecated suffixes option with a major version bump, upda…
Browse files Browse the repository at this point in the history
…ting README & LICENSE copyrights, updating dev dependencies
  • Loading branch information
avoidwork committed Jan 12, 2019
1 parent 5bcc3c4 commit a0b268f
Show file tree
Hide file tree
Showing 15 changed files with 4,992 additions and 2,182 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/test/
.idea
.eslintrc
.gitignore
.travis.yml
Gruntfile.js
bower.json
composer.json
Gruntfile.js
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- node
- 10
- 9
- 8
- 7
- 6
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018, Jason Mulligan
Copyright (c) 2019, Jason Mulligan
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ _*(number)*_ Decimal place, default is `2`
_*(string)*_ Decimal separator character, default is `.`

### spacer
_*(string)*_ Character between the `result` and `suffix`, default is `" "`
_*(string)*_ Character between the `result` and `symbol`, default is `" "`

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

### symbols
_*(object)*_ Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found

### suffixes (deprecated: use 'symbols')
_*(object)*_ Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
_*(object)*_ Dictionary of SI/JEDEC/IEC symbols to replace for localization, defaults to english if no match is found

### unix
_*(boolean)*_ Enables unix style human readable output, e.g `ls -lh`, default is `false`
Expand Down Expand Up @@ -84,5 +81,5 @@ filesize.js supports AMD loaders (require.js, curl.js, etc.), node.js & npm (```
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'))`.

## License
Copyright (c) 2018 Jason Mulligan
Copyright (c) 2019 Jason Mulligan
Licensed under the BSD-3 license.
14 changes: 6 additions & 8 deletions lib/filesize.es6.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* filesize
*
* @copyright 2018 Jason Mulligan <[email protected]>
* @copyright 2019 Jason Mulligan <[email protected]>
* @license BSD-3-Clause
* @version 3.6.1
* @version 4.0.0
*/
(function (global) {
const b = /^(b|B)$/,
Expand Down Expand Up @@ -45,7 +45,7 @@
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
separator = descriptor.separator !== void 0 ? descriptor.separator || "" : "";
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
symbols = descriptor.symbols || descriptor.suffixes || {};
symbols = descriptor.symbols || {};
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
output = descriptor.output || "string";
full = descriptor.fullform === true;
Expand Down Expand Up @@ -121,7 +121,7 @@
}

if (output === "object") {
return {value: result[0], suffix: result[1], symbol: result[1]};
return {value: result[0], symbol: result[1]};
}

if (full) {
Expand All @@ -141,10 +141,8 @@
// CommonJS, AMD, script tag
if (typeof exports !== "undefined") {
module.exports = filesize;
} else if (typeof define === "function" && define.amd) {
define(() => {
return filesize;
});
} else if (typeof define === "function" && define.amd !== void 0) {
define(() => filesize);
} else {
global.filesize = filesize;
}
Expand Down
21 changes: 18 additions & 3 deletions lib/filesize.es6.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/filesize.es6.min.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/filesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/**
* filesize
*
* @copyright 2018 Jason Mulligan <[email protected]>
* @copyright 2019 Jason Mulligan <[email protected]>
* @license BSD-3-Clause
* @version 3.6.1
* @version 4.0.0
*/
(function (global) {
var b = /^(b|B)$/,
Expand Down Expand Up @@ -63,7 +63,7 @@
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
separator = descriptor.separator !== void 0 ? descriptor.separator || "" : "";
spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
symbols = descriptor.symbols || descriptor.suffixes || {};
symbols = descriptor.symbols || {};
standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
output = descriptor.output || "string";
full = descriptor.fullform === true;
Expand Down Expand Up @@ -139,7 +139,7 @@
}

if (output === "object") {
return { value: result[0], suffix: result[1], symbol: result[1] };
return { value: result[0], symbol: result[1] };
}

if (full) {
Expand All @@ -163,7 +163,7 @@
// CommonJS, AMD, script tag
if (typeof exports !== "undefined") {
module.exports = filesize;
} else if (typeof define === "function" && define.amd) {
} else if (typeof define === "function" && define.amd !== void 0) {
define(function () {
return filesize;
});
Expand Down
6 changes: 3 additions & 3 deletions lib/filesize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/filesize.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a0b268f

Please sign in to comment.