File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -65,18 +65,11 @@ export default function DataService() {
6565 ////////////////////////////////////////////////////////////
6666 function tryParce ( str ) {
6767 try {
68- return JSON . parse ( str , reviver ) ;
68+ return JSON . parse ( str ) ;
6969 } catch ( e ) {
7070 return str ;
7171 }
7272 }
73- function reviver ( key , value ) {
74- if ( typeof value == 'string' && ( Boolean ( value ) !== undefined ) ) {
75- if ( value === "false" ) return false ;
76- if ( value === "true" ) return true ;
77- }
78- return value ;
79- }
8073
8174 function checkData ( data ) {
8275 //console.log('start check data')
Original file line number Diff line number Diff line change @@ -14,17 +14,17 @@ const checkCard = (card) => {
1414 return (
1515 ( typeof card . id === "number" || typeof card . id === "string" ) && ! isNaN ( card . id ) &&
1616 typeof card . name === "string" &&
17- typeof card . completed === "boolean " &&
17+ typeof card . color === "string " &&
1818 typeof card . text === "string" &&
1919 card instanceof Card
2020 )
2121}
2222
2323export class Card {
24- constructor ( { id, name, completed , text } ) {
24+ constructor ( { id, name, color , text } ) {
2525 this . id = Number ( id )
2626 this . name = String ( name )
27- this . completed = Boolean ( completed )
27+ this . color = String ( color )
2828 this . text = String ( text )
2929 }
3030}
You can’t perform that action at this time.
0 commit comments