Skip to content

Commit

Permalink
fix: json indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RatakondalaArun authored and MarkOSullivan94 committed Aug 27, 2022
1 parent e1fe1dd commit 704a91b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Directory createDirIfNotExist(String dirPath) {
}

/// Returns a prettified json string
String prettifyJsonEncode(Object? map) => JsonEncoder.withIndent(' ' * 2).convert(map);
String prettifyJsonEncode(Object? map) => JsonEncoder.withIndent(' ' * 4).convert(map);

/// Check if give [File] or [Directory] exists at the give [paths],
/// if not returns the failed [FileSystemEntity] path
Expand Down
6 changes: 3 additions & 3 deletions test/utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ void main() {
});

group('#prettifyJsonEncode', () {
test('should return prettiffed json string 2 indents', () {
test('should return prettiffed json string 4 indents', () {
const expectedValue = r'''
{
"key1": "value1",
"key2": "value2"
"key1": "value1",
"key2": "value2"
}''';
final result = utils.prettifyJsonEncode({
'key1': 'value1',
Expand Down

0 comments on commit 704a91b

Please sign in to comment.