@aws-amplify/core
Advanced tools
Comparing version 1.0.26-unstable.0 to 1.0.26-unstable.1
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.0.26-unstable.1"></a> | ||
## [1.0.26-unstable.1](https://github.com/aws/aws-amplify/compare/@aws-amplify/core@1.0.26-unstable.0...@aws-amplify/core@1.0.26-unstable.1) (2019-04-17) | ||
### Bug Fixes | ||
* **@aws-amplify/core:** directly return if input is null for function transferKeyToUpperCase/transferKeyToLowerCase ([1600cfb](https://github.com/aws/aws-amplify/commit/1600cfb)) | ||
<a name="1.0.26-unstable.0"></a> | ||
@@ -8,0 +19,0 @@ ## [1.0.26-unstable.0](https://github.com/aws/aws-amplify/compare/@aws-amplify/core@1.0.25...@aws-amplify/core@1.0.26-unstable.0) (2019-04-12) |
@@ -30,2 +30,8 @@ export default class JS { | ||
static transferKeyToUpperCase(obj: any, whiteListForItself?: any[], whiteListForChildren?: any[]): any; | ||
/** | ||
* Return true if the object is a strict object | ||
* which means it's not Array, Function, Number, String, Boolean or Null | ||
* @param obj the Object | ||
*/ | ||
static isStrictObject(obj: any): boolean; | ||
} |
@@ -158,3 +158,3 @@ "use strict"; | ||
if (whiteListForChildren === void 0) { whiteListForChildren = []; } | ||
if (typeof obj !== 'object' || Array.isArray(obj)) | ||
if (!JS.isStrictObject(obj)) | ||
return obj; | ||
@@ -183,3 +183,3 @@ var ret = {}; | ||
if (whiteListForChildren === void 0) { whiteListForChildren = []; } | ||
if (typeof obj !== 'object' || Array.isArray(obj)) | ||
if (!JS.isStrictObject(obj)) | ||
return obj; | ||
@@ -199,2 +199,15 @@ var ret = {}; | ||
}; | ||
/** | ||
* Return true if the object is a strict object | ||
* which means it's not Array, Function, Number, String, Boolean or Null | ||
* @param obj the Object | ||
*/ | ||
JS.isStrictObject = function (obj) { | ||
return ((obj instanceof Object) && | ||
!(obj instanceof Array) && | ||
!(obj instanceof Function) && | ||
!(obj instanceof Number) && | ||
!(obj instanceof String) && | ||
!(obj instanceof Boolean)); | ||
}; | ||
return JS; | ||
@@ -201,0 +214,0 @@ }()); |
{ | ||
"name": "@aws-amplify/core", | ||
"version": "1.0.26-unstable.0", | ||
"version": "1.0.26-unstable.1", | ||
"description": "Core category of aws-amplify", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -171,4 +171,3 @@ /* | ||
static transferKeyToLowerCase(obj, whiteListForItself=[], whiteListForChildren=[]) { | ||
if (typeof obj !== 'object' || Array.isArray(obj)) return obj; | ||
if (!JS.isStrictObject(obj)) return obj; | ||
const ret = {}; | ||
@@ -202,4 +201,3 @@ | ||
static transferKeyToUpperCase(obj, whiteListForItself=[], whiteListForChildren=[]) { | ||
if (typeof obj !== 'object' || Array.isArray(obj)) return obj; | ||
if (!JS.isStrictObject(obj)) return obj; | ||
const ret = {}; | ||
@@ -225,2 +223,17 @@ | ||
} | ||
/** | ||
* Return true if the object is a strict object | ||
* which means it's not Array, Function, Number, String, Boolean or Null | ||
* @param obj the Object | ||
*/ | ||
static isStrictObject(obj) { | ||
return ((obj instanceof Object) && | ||
!(obj instanceof Array) && | ||
!(obj instanceof Function) && | ||
!(obj instanceof Number) && | ||
!(obj instanceof String) && | ||
!(obj instanceof Boolean) | ||
); | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4109924
33485