Skip to content

Commit

Permalink
build: release 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Dec 18, 2018
1 parent cf6def8 commit 2d3a78c
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 181 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## next
## 1.0.3 (Dec 18, 2018)

- Convert `TypedArray` to `Array` manually instead of using Babel helpers for better browser compatibility (#60).

Expand Down
37 changes: 14 additions & 23 deletions dist/compressor.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Compressor.js v1.0.2
* Compressor.js v1.0.3
* https://fengyuanchen.github.io/compressorjs
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2018-12-10T13:23:38.356Z
* Date: 2018-12-18T14:20:45.661Z
*/

'use strict';
Expand Down Expand Up @@ -84,26 +84,6 @@ function _objectSpread(target) {
return target;
}

function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}

function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

return arr2;
}
}

function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}

function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
Expand Down Expand Up @@ -342,6 +322,16 @@ var DEFAULTS = {
var IN_BROWSER = typeof window !== 'undefined';
var WINDOW = IN_BROWSER ? window : {};

var slice = Array.prototype.slice;
/**
* Convert array-like or iterable object to an array.
* @param {*} value - The value to convert.
* @returns {Array} Returns a new array.
*/

function toArray(value) {
return Array.from ? Array.from(value) : slice.call(value);
}
var REGEXP_IMAGE_TYPE = /^image\/.+$/;
/**
* Check if the given value is a mime type of image.
Expand Down Expand Up @@ -401,7 +391,8 @@ function arrayBufferToDataURL(arrayBuffer, mimeType) {
var uint8 = new Uint8Array(arrayBuffer);

while (uint8.length > 0) {
chunks.push(fromCharCode.apply(void 0, _toConsumableArray(uint8.subarray(0, chunkSize))));
// eslint-disable-next-line prefer-spread
chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
uint8 = uint8.subarray(chunkSize);
}

Expand Down
37 changes: 14 additions & 23 deletions dist/compressor.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Compressor.js v1.0.2
* Compressor.js v1.0.3
* https://fengyuanchen.github.io/compressorjs
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2018-12-10T13:23:38.356Z
* Date: 2018-12-18T14:20:45.661Z
*/

function _classCallCheck(instance, Constructor) {
Expand Down Expand Up @@ -82,26 +82,6 @@ function _objectSpread(target) {
return target;
}

function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}

function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

return arr2;
}
}

function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}

function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
Expand Down Expand Up @@ -340,6 +320,16 @@ var DEFAULTS = {
var IN_BROWSER = typeof window !== 'undefined';
var WINDOW = IN_BROWSER ? window : {};

var slice = Array.prototype.slice;
/**
* Convert array-like or iterable object to an array.
* @param {*} value - The value to convert.
* @returns {Array} Returns a new array.
*/

function toArray(value) {
return Array.from ? Array.from(value) : slice.call(value);
}
var REGEXP_IMAGE_TYPE = /^image\/.+$/;
/**
* Check if the given value is a mime type of image.
Expand Down Expand Up @@ -399,7 +389,8 @@ function arrayBufferToDataURL(arrayBuffer, mimeType) {
var uint8 = new Uint8Array(arrayBuffer);

while (uint8.length > 0) {
chunks.push(fromCharCode.apply(void 0, _toConsumableArray(uint8.subarray(0, chunkSize))));
// eslint-disable-next-line prefer-spread
chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
uint8 = uint8.subarray(chunkSize);
}

Expand Down
43 changes: 17 additions & 26 deletions dist/compressor.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*!
* Compressor.js v1.0.2
* Compressor.js v1.0.3
* https://fengyuanchen.github.io/compressorjs
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2018-12-10T13:23:38.356Z
* Date: 2018-12-18T14:20:45.661Z
*/

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Compressor = factory());
}(this, (function () { 'use strict';
global.Compressor = factory();
}(typeof self !== 'undefined' ? self : this, function () { 'use strict';

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
Expand Down Expand Up @@ -88,26 +88,6 @@
return target;
}

function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}

function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

return arr2;
}
}

function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}

function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
Expand Down Expand Up @@ -346,6 +326,16 @@
var IN_BROWSER = typeof window !== 'undefined';
var WINDOW = IN_BROWSER ? window : {};

var slice = Array.prototype.slice;
/**
* Convert array-like or iterable object to an array.
* @param {*} value - The value to convert.
* @returns {Array} Returns a new array.
*/

function toArray(value) {
return Array.from ? Array.from(value) : slice.call(value);
}
var REGEXP_IMAGE_TYPE = /^image\/.+$/;
/**
* Check if the given value is a mime type of image.
Expand Down Expand Up @@ -405,7 +395,8 @@
var uint8 = new Uint8Array(arrayBuffer);

while (uint8.length > 0) {
chunks.push(fromCharCode.apply(void 0, _toConsumableArray(uint8.subarray(0, chunkSize))));
// eslint-disable-next-line prefer-spread
chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
uint8 = uint8.subarray(chunkSize);
}

Expand Down Expand Up @@ -919,4 +910,4 @@

return Compressor;

})));
}));
6 changes: 3 additions & 3 deletions dist/compressor.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>Compressor.js <small class="h6">v1.0.2</small></h1>
<h1>Compressor.js <small class="h6">v1.0.3</small></h1>
<p class="lead">JavaScript image compressor.</p>
</div>
<div class="col-md">
Expand Down Expand Up @@ -240,8 +240,8 @@ <h3 class="card-title">Output (compressed)</h3>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<script src="https://unpkg.com/vue@2.5.19/dist/vue.min.js"></script>
<script src="https://fengyuanchen.github.io/js/common.js"></script>
<script src="https://unpkg.com/vue@2/dist/vue.min.js"></script>
<script src="https://fengyuanchen.github.io/shared/google-analytics.js"></script>
<script src="js/compressor.js"></script>
<script src="js/main.js"></script>
</body>
Expand Down
43 changes: 17 additions & 26 deletions docs/js/compressor.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*!
* Compressor.js v1.0.2
* Compressor.js v1.0.3
* https://fengyuanchen.github.io/compressorjs
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2018-12-10T13:23:38.356Z
* Date: 2018-12-18T14:20:45.661Z
*/

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Compressor = factory());
}(this, (function () { 'use strict';
global.Compressor = factory();
}(typeof self !== 'undefined' ? self : this, function () { 'use strict';

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
Expand Down Expand Up @@ -88,26 +88,6 @@
return target;
}

function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}

function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

return arr2;
}
}

function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}

function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
Expand Down Expand Up @@ -346,6 +326,16 @@
var IN_BROWSER = typeof window !== 'undefined';
var WINDOW = IN_BROWSER ? window : {};

var slice = Array.prototype.slice;
/**
* Convert array-like or iterable object to an array.
* @param {*} value - The value to convert.
* @returns {Array} Returns a new array.
*/

function toArray(value) {
return Array.from ? Array.from(value) : slice.call(value);
}
var REGEXP_IMAGE_TYPE = /^image\/.+$/;
/**
* Check if the given value is a mime type of image.
Expand Down Expand Up @@ -405,7 +395,8 @@
var uint8 = new Uint8Array(arrayBuffer);

while (uint8.length > 0) {
chunks.push(fromCharCode.apply(void 0, _toConsumableArray(uint8.subarray(0, chunkSize))));
// eslint-disable-next-line prefer-spread
chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
uint8 = uint8.subarray(chunkSize);
}

Expand Down Expand Up @@ -919,4 +910,4 @@

return Compressor;

})));
}));
Loading

0 comments on commit 2d3a78c

Please sign in to comment.