This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
178 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ | |
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
"node": true, | ||
"es6": true | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// @flow | ||
import { List, Map as ImMap, Set as ImSet, OrderedMap, OrderedSet, Stack, Seq } from 'immutable'; | ||
import objType from 'react-json-tree/lib/objType'; | ||
|
||
type Type = | ||
string | | ||
'Immutable List' | | ||
'Immutable Map' | | ||
'Immutable Set' | | ||
'Immutable OrderedMap' | | ||
'Immutable OrderedSet' | | ||
'Immutable Stack' | | ||
'Immutable Seq'; | ||
|
||
export default function getType(value: any): Type { | ||
if (List.isList(value)) { | ||
return 'Immutable List'; | ||
} else if (ImMap.isMap(value)) { | ||
return 'Immutable Map'; | ||
} else if (ImSet.isSet(value)) { | ||
return 'Immutable Set'; | ||
} else if (OrderedMap.isOrderedMap(value)) { | ||
return 'Immutable OrderedMap'; | ||
} else if (OrderedSet.isOrderedSet(value)) { | ||
return 'Immutable OrderedSet'; | ||
} else if (Stack.isStack(value)) { | ||
return 'Immutable Stack'; | ||
} else if (Seq.isSeq(value)) { | ||
return 'Immutable Seq'; | ||
} | ||
|
||
return objType(value); | ||
} |
Oops, something went wrong.