@applitools/utils
Advanced tools
Comparing version 1.2.11 to 1.2.12
@@ -6,2 +6,6 @@ # Changelog | ||
## 1.2.12 - 2022/2/9 | ||
- add string manupulation function 'pluralize' | ||
## 1.2.11 - 2021/12/28 | ||
@@ -8,0 +12,0 @@ |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toString = exports.toJSON = exports.sleep = exports.jwtDecode = exports.guid = exports.getEnvValue = void 0; | ||
exports.pluralize = exports.toString = exports.toJSON = exports.sleep = exports.jwtDecode = exports.guid = exports.getEnvValue = void 0; | ||
const types = __importStar(require("./types")); | ||
@@ -75,1 +75,11 @@ function getEnvValue(name, type) { | ||
exports.toString = toString; | ||
function pluralize(object, config) { | ||
const count = types.isArray(object) ? object.length : object; | ||
const isMany = count > 1; | ||
let res = isMany ? 's' : ''; | ||
if (config) { | ||
res = isMany ? config[0] : config[1]; | ||
} | ||
return res; | ||
} | ||
exports.pluralize = pluralize; |
{ | ||
"name": "@applitools/utils", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"keywords": [ | ||
@@ -53,3 +53,3 @@ "applitools", | ||
"devDependencies": { | ||
"@applitools/sdk-release-kit": "0.13.4", | ||
"@applitools/sdk-release-kit": "0.13.11", | ||
"@types/node": "^14.14.7", | ||
@@ -56,0 +56,0 @@ "@typescript-eslint/eslint-plugin": "^4.7.0", |
@@ -21,1 +21,2 @@ export declare function getEnvValue<T extends 'boolean' | 'number' | 'string' = 'string'>(name: string, type?: T): T extends 'boolean' ? boolean : T extends 'number' ? number : string; | ||
export declare function toString(object: Record<PropertyKey, any>): string; | ||
export declare function pluralize(object: [] | number, config?: [manyCase: string, singleCase: string]): string; |
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
52029
771