@trackunit/shared-utils
Advanced tools
Comparing version 0.0.68-alpha-2936c016d71.0 to 0.0.69
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.HoursAndMinutesFormat = void 0; | ||
@@ -653,3 +651,6 @@ (function (HoursAndMinutesFormat) { | ||
if (val !== value) { | ||
return Object.assign(Object.assign({}, diff), { [key]: val }); | ||
return { | ||
...diff, | ||
[key]: val, | ||
}; | ||
} | ||
@@ -701,32 +702,2 @@ } | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
var e = new Error(message); | ||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
}; | ||
const dataURItoBlob = (dataURI) => { | ||
@@ -754,9 +725,9 @@ var _a, _b, _c, _d, _e; | ||
*/ | ||
const resizeBlob = (blob, newWidth, newHeight) => __awaiter(void 0, void 0, void 0, function* () { | ||
const resizeBlob = async (blob, newWidth, newHeight) => { | ||
const url = window.URL.createObjectURL(blob); | ||
const image = yield loadSourceIntoImage(url); | ||
const image = await loadSourceIntoImage(url); | ||
const resized = resizeImageElement(image, newWidth, newHeight); | ||
window.URL.revokeObjectURL(url); | ||
return resized; | ||
}); | ||
}; | ||
/** | ||
@@ -822,9 +793,9 @@ * Resize width and height to be contained within the max parameters, while maintaining the aspect ratio | ||
} | ||
reader.onload = (readerEvent) => __awaiter(void 0, void 0, void 0, function* () { | ||
reader.onload = async (readerEvent) => { | ||
if (typeof readerEvent.target.result !== "string") { | ||
return; | ||
} | ||
const image = yield loadSourceIntoImage(readerEvent.target.result); | ||
const image = await loadSourceIntoImage(readerEvent.target.result); | ||
ok(resizeImageElement(image, maxSize, maxSize)); | ||
}); | ||
}; | ||
reader.readAsDataURL(file); | ||
@@ -831,0 +802,0 @@ }); |
@@ -649,3 +649,6 @@ var HoursAndMinutesFormat; | ||
if (val !== value) { | ||
return Object.assign(Object.assign({}, diff), { [key]: val }); | ||
return { | ||
...diff, | ||
[key]: val, | ||
}; | ||
} | ||
@@ -697,32 +700,2 @@ } | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
var e = new Error(message); | ||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
}; | ||
const dataURItoBlob = (dataURI) => { | ||
@@ -750,9 +723,9 @@ var _a, _b, _c, _d, _e; | ||
*/ | ||
const resizeBlob = (blob, newWidth, newHeight) => __awaiter(void 0, void 0, void 0, function* () { | ||
const resizeBlob = async (blob, newWidth, newHeight) => { | ||
const url = window.URL.createObjectURL(blob); | ||
const image = yield loadSourceIntoImage(url); | ||
const image = await loadSourceIntoImage(url); | ||
const resized = resizeImageElement(image, newWidth, newHeight); | ||
window.URL.revokeObjectURL(url); | ||
return resized; | ||
}); | ||
}; | ||
/** | ||
@@ -818,9 +791,9 @@ * Resize width and height to be contained within the max parameters, while maintaining the aspect ratio | ||
} | ||
reader.onload = (readerEvent) => __awaiter(void 0, void 0, void 0, function* () { | ||
reader.onload = async (readerEvent) => { | ||
if (typeof readerEvent.target.result !== "string") { | ||
return; | ||
} | ||
const image = yield loadSourceIntoImage(readerEvent.target.result); | ||
const image = await loadSourceIntoImage(readerEvent.target.result); | ||
ok(resizeImageElement(image, maxSize, maxSize)); | ||
}); | ||
}; | ||
reader.readAsDataURL(file); | ||
@@ -827,0 +800,0 @@ }); |
{ | ||
"name": "@trackunit/shared-utils", | ||
"version": "0.0.68-alpha-2936c016d71.0", | ||
"version": "0.0.69", | ||
"repository": "https://github.com/Trackunit/manager", | ||
@@ -11,3 +11,4 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
"module": "./index.esm.js", | ||
"main": "./index.cjs.js" | ||
} | ||
"main": "./index.cjs.js", | ||
"types": "./index.esm.d.ts" | ||
} |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
106178
2851