mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(devtools): don't round decimal vals previews in the state serializer
The actual numerical data can only be checked in the prop edit mode. This fixes that and makes the real value visible all the time.
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ const typeToDescriptorPreview: Formatter<string> = {
|
||||
[PropType.Function]: (prop: Function) => `${prop.name}(...)`,
|
||||
[PropType.HTMLNode]: (prop: Node) => prop.constructor.name,
|
||||
[PropType.Null]: (_: null) => 'null',
|
||||
[PropType.Number]: (prop: any) => parseInt(prop, 10).toString(),
|
||||
[PropType.Number]: (prop: any) => prop.toString(),
|
||||
[PropType.Object]: (prop: Object) => (getKeys(prop).length > 0 ? '{...}' : '{}'),
|
||||
[PropType.Symbol]: (symbol: symbol) => `Symbol(${symbol.description})`,
|
||||
[PropType.Undefined]: (_: undefined) => 'undefined',
|
||||
|
||||
+17
@@ -51,6 +51,7 @@ const QUERY_1_2 = [
|
||||
|
||||
const dir1 = {
|
||||
one: 1,
|
||||
pi: 3.14159,
|
||||
nested: {
|
||||
arr: [
|
||||
{
|
||||
@@ -95,6 +96,14 @@ describe('deeplySerializeSelectedProperties', () => {
|
||||
value: 1,
|
||||
containerType: null,
|
||||
},
|
||||
pi: {
|
||||
type: PropType.Number,
|
||||
expandable: false,
|
||||
editable: true,
|
||||
preview: '3.14159',
|
||||
value: 3.14159,
|
||||
containerType: null,
|
||||
},
|
||||
nested: {
|
||||
type: PropType.Object,
|
||||
editable: false,
|
||||
@@ -125,6 +134,14 @@ describe('deeplySerializeSelectedProperties', () => {
|
||||
value: 1,
|
||||
containerType: null,
|
||||
},
|
||||
pi: {
|
||||
type: PropType.Number,
|
||||
expandable: false,
|
||||
editable: true,
|
||||
preview: '3.14159',
|
||||
value: 3.14159,
|
||||
containerType: null,
|
||||
},
|
||||
nested: {
|
||||
type: PropType.Object,
|
||||
editable: false,
|
||||
|
||||
Reference in New Issue
Block a user