@applitools/utils
Advanced tools
Comparing version 1.2.13 to 1.2.14
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.divide = exports.equals = exports.contains = exports.isIntersected = exports.intersect = exports.offsetNegative = exports.offset = exports.scale = exports.rotate = exports.round = exports.isEmpty = exports.region = exports.size = exports.location = void 0; | ||
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; | ||
const types = __importStar(require("./types")); | ||
@@ -57,2 +57,16 @@ const guard = __importStar(require("./guard")); | ||
exports.round = round; | ||
function ceil(target) { | ||
const result = Object.assign({}, target); | ||
if (types.has(target, ['x', 'y'])) { | ||
// intentionally using Math.round and not Math.ceil here, because the point is that for width and height it makes sense to use ceil, but not for x and y | ||
result.x = Math.round(target.x); | ||
result.y = Math.round(target.y); | ||
} | ||
if (types.has(target, ['width', 'height'])) { | ||
result.width = Math.ceil(target.width); | ||
result.height = Math.ceil(target.height); | ||
} | ||
return result; | ||
} | ||
exports.ceil = ceil; | ||
function rotate(target, degrees, size) { | ||
@@ -59,0 +73,0 @@ degrees = (360 + degrees) % 360; |
{ | ||
"name": "@applitools/utils", | ||
"version": "1.2.13", | ||
"version": "1.2.14", | ||
"keywords": [ | ||
@@ -53,3 +53,3 @@ "applitools", | ||
"devDependencies": { | ||
"@applitools/sdk-release-kit": "0.13.11", | ||
"@applitools/bongo": "^2.0.2", | ||
"@types/node": "^14.14.7", | ||
@@ -56,0 +56,0 @@ "@typescript-eslint/eslint-plugin": "^4.7.0", |
@@ -23,2 +23,5 @@ declare type Location = { | ||
export declare function round(region: Location): Location; | ||
export declare function ceil(region: Region): Region; | ||
export declare function ceil(region: RectangleSize): RectangleSize; | ||
export declare function ceil(region: Location): Location; | ||
export declare function rotate(size: RectangleSize, degrees: number): RectangleSize; | ||
@@ -25,0 +28,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
809
51909
18
2