@applitools/utils
Advanced tools
Comparing version 1.3.8 to 1.3.9
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.withPadding = exports.divide = exports.equals = exports.contains = exports.isIntersected = exports.intersect = exports.offsetNegative = exports.offset = exports.scale = exports.rotate = exports.ceil = exports.round = exports.isEmpty = exports.region = exports.size = exports.location = void 0; | ||
exports.withPadding = exports.divide = exports.equals = exports.contains = exports.isIntersected = exports.intersect = exports.offsetNegative = exports.offset = exports.scale = exports.rotate = exports.floor = exports.ceil = exports.round = exports.isEmpty = exports.region = exports.size = exports.location = void 0; | ||
const types = __importStar(require("./types")); | ||
@@ -75,2 +75,15 @@ const guard = __importStar(require("./guard")); | ||
exports.ceil = ceil; | ||
function floor(target) { | ||
const result = { ...target }; | ||
if (types.has(target, ['x', 'y'])) { | ||
result.x = Math.floor(target.x); | ||
result.y = Math.floor(target.y); | ||
} | ||
if (types.has(target, ['width', 'height'])) { | ||
result.width = Math.floor(target.width + (types.has(target, 'x') ? target.x - result.x : 0)); | ||
result.height = Math.floor(target.height + (types.has(target, 'y') ? target.y - result.y : 0)); | ||
} | ||
return result; | ||
} | ||
exports.floor = floor; | ||
function rotate(target, degrees, size) { | ||
@@ -77,0 +90,0 @@ degrees = (360 + degrees) % 360; |
{ | ||
"name": "@applitools/utils", | ||
"version": "1.3.8", | ||
"version": "1.3.9", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "applitools", |
@@ -26,2 +26,5 @@ declare type Location = { | ||
export declare function ceil(region: Location): Location; | ||
export declare function floor(region: Region): Region; | ||
export declare function floor(region: RectangleSize): RectangleSize; | ||
export declare function floor(region: Location): Location; | ||
export declare function rotate(size: RectangleSize, degrees: number): RectangleSize; | ||
@@ -28,0 +31,0 @@ export declare function rotate(region: Region, degrees: number, size: RectangleSize): Region; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61240
1038