@applitools/utils
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,2 +0,2 @@ | ||
# Change Log | ||
# Changelog | ||
@@ -6,2 +6,6 @@ ## Unreleased | ||
## 1.1.1 - 2021/3/25 | ||
- add `general.toJSON` one argument signature to convert class instances to plain objects | ||
## 1.1.0 - 2021/3/24 | ||
@@ -8,0 +12,0 @@ |
@@ -42,4 +42,4 @@ "use strict"; | ||
return null; | ||
const original = Object.values(props); | ||
const keys = types.isArray(props) ? original : Object.keys(props); | ||
const original = props ? Object.values(props) : Object.keys(object); | ||
const keys = !props || types.isArray(props) ? original : Object.keys(props); | ||
return keys.reduce((plain, key, index) => { | ||
@@ -46,0 +46,0 @@ const value = object[original[index]]; |
{ | ||
"name": "@applitools/utils", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"keywords": [ | ||
@@ -38,3 +38,3 @@ "applitools", | ||
"devDependencies": { | ||
"@applitools/sdk-release-kit": "0.12.0", | ||
"@applitools/sdk-release-kit": "0.13.0", | ||
"@types/node": "^14.14.7", | ||
@@ -41,0 +41,0 @@ "@typescript-eslint/eslint-plugin": "^4.7.0", |
@@ -15,3 +15,8 @@ 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 toJSON<TObject extends Record<PropertyKey, any>>(object: TObject): { | ||
[key in keyof Omit<TObject, symbol>]: TObject[key] extends { | ||
toJSON(): any; | ||
} ? ReturnType<TObject[key]['toJSON']> : TObject[key]; | ||
}; | ||
export declare function toString(object: Record<PropertyKey, any>): string; | ||
//# sourceMappingURL=general.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
70055
593