eyes.utils
Advanced tools
Comparing version 3.6.1 to 3.6.3
{ | ||
"name": "eyes.utils", | ||
"version": "3.6.1", | ||
"version": "3.6.3", | ||
"description": "General purpose Javascript utilities.", | ||
@@ -45,13 +45,14 @@ "keywords": [ | ||
"dependencies": { | ||
"@types/node": "*", | ||
"@types/png-async": "*", | ||
"dateformat": "^3.0.3", | ||
"png-async": "^0.9.3" | ||
"png-async": "^0.9.4" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^5.2.0" | ||
"@types/node": "*", | ||
"mocha": "^6.1.4", | ||
"typescript": "^2.9.2" | ||
}, | ||
"scripts": { | ||
"test": "mocha \"test/**/*.spec.js\"", | ||
"test:unit": "mocha \"test/unit/**/*.spec.js\"" | ||
"test": "npm run test:unit", | ||
"test:unit": "mocha --no-timeouts \"test/unit/**/*.spec.js\"", | ||
"typings": "tsc --declaration" | ||
}, | ||
@@ -62,3 +63,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
}, | ||
"gitHead": "509409aa04b8db9caf8590da5d0181b2c12dad2c" | ||
"gitHead": "f7a04134ae39b7546b33dea65d70aacf1a293097" | ||
} |
@@ -1,31 +0,33 @@ | ||
var assert = require("assert"); | ||
'use strict'; | ||
var GeneralUtils = require("../index").GeneralUtils; | ||
const assert = require('assert'); | ||
const { GeneralUtils } = require('../../index'); | ||
describe('GeneralUtils', function(){ | ||
describe('#urlConcat()', function(){ | ||
it('should return / when the values are empty', function() { | ||
assert.equal(GeneralUtils.urlConcat('', ''), "/"); | ||
assert.strictEqual(GeneralUtils.urlConcat('', ''), '/'); | ||
}); | ||
it('should return the correct Url when both parts don\'t start/end with a "/"', function () { | ||
var left = "http://www.applitools.com", | ||
right = "subdomain/index.html"; | ||
assert.equal(GeneralUtils.urlConcat(left, right), left + "/" + right); | ||
it('should return the correct Url when both parts don\'t start/end with a \'/\'', function () { | ||
var left = 'http://www.applitools.com', | ||
right = 'subdomain/index.html'; | ||
assert.strictEqual(GeneralUtils.urlConcat(left, right), left + '/' + right); | ||
}); | ||
it('should return the correct Url when only left part ends with a "/"', function () { | ||
var left = "http://www.applitools.com/", | ||
right = "subdomain/index.html"; | ||
assert.equal(GeneralUtils.urlConcat(left, right), left + right); | ||
it('should return the correct Url when only left part ends with a \'/\'', function () { | ||
var left = 'http://www.applitools.com/', | ||
right = 'subdomain/index.html'; | ||
assert.strictEqual(GeneralUtils.urlConcat(left, right), left + right); | ||
}); | ||
it('should return the correct Url when only right part starts with a "/"', function () { | ||
var left = "http://www.applitools.com", | ||
right = "/subdomain/index.html"; | ||
assert.equal(GeneralUtils.urlConcat(left, right), left + right); | ||
it('should return the correct Url when only right part starts with a \'/\'', function () { | ||
var left = 'http://www.applitools.com', | ||
right = '/subdomain/index.html'; | ||
assert.strictEqual(GeneralUtils.urlConcat(left, right), left + right); | ||
}); | ||
it('should return the correct Url when both parts start/end with a "/"', function () { | ||
var left = "http://www.applitools.com", | ||
right = "/subdomain/index.html"; | ||
assert.equal(GeneralUtils.urlConcat(left + "/", right), left + right); | ||
it('should return the correct Url when both parts start/end with a \'/\'', function () { | ||
var left = 'http://www.applitools.com', | ||
right = '/subdomain/index.html'; | ||
assert.strictEqual(GeneralUtils.urlConcat(left + '/', right), left + right); | ||
}); | ||
}); | ||
}); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const { UserAgent } = require('../index'); | ||
const { UserAgent } = require('../../index'); | ||
@@ -13,8 +13,8 @@ describe('UserAgent', () => { | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Windows'); | ||
assert.equal(userAgent.getOSMajorVersion(), '10'); | ||
assert.equal(userAgent.getOSMinorVersion(), '0'); | ||
assert.equal(userAgent.getBrowser(), 'Chrome'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '60'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getOS(), 'Windows'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), '10'); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getBrowser(), 'Chrome'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '60'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '0'); | ||
}); | ||
@@ -25,8 +25,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Windows'); | ||
assert.equal(userAgent.getOSMajorVersion(), '10'); | ||
assert.equal(userAgent.getOSMinorVersion(), '0'); | ||
assert.equal(userAgent.getBrowser(), 'Firefox'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '54'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getOS(), 'Windows'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), '10'); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getBrowser(), 'Firefox'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '54'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '0'); | ||
}); | ||
@@ -37,8 +37,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Android'); | ||
assert.equal(userAgent.getOSMajorVersion(), '6'); | ||
assert.equal(userAgent.getOSMinorVersion(), '0'); | ||
assert.equal(userAgent.getBrowser(), 'Chrome'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '60'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getOS(), 'Android'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), '6'); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getBrowser(), 'Chrome'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '60'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '0'); | ||
}); | ||
@@ -49,8 +49,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'IOS'); | ||
assert.equal(userAgent.getOSMajorVersion(), '10'); | ||
assert.equal(userAgent.getOSMinorVersion(), '3'); | ||
assert.equal(userAgent.getBrowser(), 'Safari'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '602'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '1'); | ||
assert.strictEqual(userAgent.getOS(), 'IOS'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), '10'); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), '3'); | ||
assert.strictEqual(userAgent.getBrowser(), 'Safari'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '602'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '1'); | ||
}); | ||
@@ -61,8 +61,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Linux'); | ||
assert.equal(userAgent.getOSMajorVersion(), undefined); | ||
assert.equal(userAgent.getOSMinorVersion(), undefined); | ||
assert.equal(userAgent.getBrowser(), 'Chrome'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '51'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getOS(), 'Linux'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), undefined); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), undefined); | ||
assert.strictEqual(userAgent.getBrowser(), 'Chrome'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '51'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '0'); | ||
}); | ||
@@ -73,8 +73,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Windows'); | ||
assert.equal(userAgent.getOSMajorVersion(), '10'); | ||
assert.equal(userAgent.getOSMinorVersion(), '0'); | ||
assert.equal(userAgent.getBrowser(), 'Edge'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '12'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '10136'); | ||
assert.strictEqual(userAgent.getOS(), 'Windows'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), '10'); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getBrowser(), 'Edge'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '12'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '10136'); | ||
}); | ||
@@ -85,8 +85,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Windows'); | ||
assert.equal(userAgent.getOSMajorVersion(), undefined); | ||
assert.equal(userAgent.getOSMinorVersion(), undefined); | ||
assert.equal(userAgent.getBrowser(), 'IE'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '9'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getOS(), 'Windows'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), undefined); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), undefined); | ||
assert.strictEqual(userAgent.getBrowser(), 'IE'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '9'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '0'); | ||
}); | ||
@@ -97,8 +97,8 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Unknown'); | ||
assert.equal(userAgent.getOSMajorVersion(), undefined); | ||
assert.equal(userAgent.getOSMinorVersion(), undefined); | ||
assert.equal(userAgent.getBrowser(), 'Unknown'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), undefined); | ||
assert.equal(userAgent.getBrowserMinorVersion(), undefined); | ||
assert.strictEqual(userAgent.getOS(), 'Unknown'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), undefined); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), undefined); | ||
assert.strictEqual(userAgent.getBrowser(), 'Unknown'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), undefined); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), undefined); | ||
}); | ||
@@ -109,10 +109,10 @@ | ||
const userAgent = UserAgent.parseUserAgentString(uaString, true); | ||
assert.equal(userAgent.getOS(), 'Macintosh'); | ||
assert.equal(userAgent.getOSMajorVersion(), '10'); | ||
assert.equal(userAgent.getOSMinorVersion(), '13'); | ||
assert.equal(userAgent.getBrowser(), 'Safari'); | ||
assert.equal(userAgent.getBrowserMajorVersion(), '11'); | ||
assert.equal(userAgent.getBrowserMinorVersion(), '0'); | ||
assert.strictEqual(userAgent.getOS(), 'Macintosh'); | ||
assert.strictEqual(userAgent.getOSMajorVersion(), '10'); | ||
assert.strictEqual(userAgent.getOSMinorVersion(), '13'); | ||
assert.strictEqual(userAgent.getBrowser(), 'Safari'); | ||
assert.strictEqual(userAgent.getBrowserMajorVersion(), '11'); | ||
assert.strictEqual(userAgent.getBrowserMinorVersion(), '0'); | ||
}); | ||
}); | ||
}); |
@@ -1,4 +0,4 @@ | ||
/* Type definitions for eyes.utils 0.0.1 */ | ||
// Project: https://github.com/applitools/eyes.utils | ||
// Definitions by: Oleh Astappiev <https://github.com/astappev> | ||
/* Type definitions for eyes.utils 3.6.0 */ | ||
// Project: https://github.com/applitools/eyes.sdk.javascript | ||
// Definitions by: Applitools Team <https://applitools.com> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -40,3 +40,2 @@ // TypeScript Version: 2.4 | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -48,3 +47,2 @@ static notEqual(param: any, value: any, paramName: string): void; | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -56,3 +54,2 @@ static notNull(param: any, paramName: string): void; | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -64,3 +61,2 @@ static isNull(param: any, paramName: string): void; | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -72,3 +68,2 @@ static notNullOrEmpty(param: any, paramName: string): void; | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -80,3 +75,2 @@ static greaterThanOrEqualToZero(param: any, paramName: string): void; | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -88,3 +82,2 @@ static greaterThanZero(param: any, paramName: string): void; | ||
* @param paramName The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -96,3 +89,2 @@ static notZero(param: any, paramName: string): void; | ||
* @param errMsg The input parameter name. | ||
* @throws {Error} | ||
*/ | ||
@@ -104,3 +96,2 @@ static isValidState(isValid: boolean, errMsg: string): void; | ||
* @param type The expected param type. | ||
* @throws {Error} | ||
*/ | ||
@@ -177,2 +168,9 @@ static isValidType(param: any, type: any): void; | ||
static toISO8601DateTime(date?: Date): string; | ||
/** | ||
* Cartesian product of arrays | ||
* @param arrays Variable number of arrays of n elements | ||
* @return Product of arrays as an array of X arrays of N elements, | ||
* where X is the product of the input arrays' lengths | ||
*/ | ||
static cartesianProduct(...arrays: any[]): string; | ||
} | ||
@@ -179,0 +177,0 @@ |
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
2
118673
3
21
2443
- Removed@types/node@*
- Removed@types/png-async@*
- Removed@types/node@22.9.0(transitive)
- Removed@types/png-async@0.9.4(transitive)
- Removedundici-types@6.19.8(transitive)
Updatedpng-async@^0.9.4