Skip to content

Commit

Permalink
Сортировка ключей при генерации json файлов
Browse files Browse the repository at this point in the history
  • Loading branch information
timbaev committed Mar 28, 2024
1 parent dfbfc77 commit 94d06a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/FigmaGenTools/Assets/AssetNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension AssetNode {

try folderPath.mkpath()

let contentsEncoder = JSONEncoder(outputFormatting: .prettyPrinted)
let contentsEncoder = JSONEncoder(outputFormatting: [.prettyPrinted, .sortedKeys])
let contentsData = try contentsEncoder.encode(contents)
let contentsPath = folderPath.appending(.contentsPath)

Expand Down
2 changes: 1 addition & 1 deletion Sources/FigmaGenTools/Assets/Folder/AssetFolder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public struct AssetFolder {
try saveNodes(imageSets, in: folderPath)
try saveFolders(in: folderPath)

let contentsEncoder = JSONEncoder(outputFormatting: .prettyPrinted)
let contentsEncoder = JSONEncoder(outputFormatting: [.prettyPrinted, .sortedKeys])
let contentsData = try contentsEncoder.encode(contents)
let contentsPath = folderPath.appending(.contentsPath)

Expand Down

0 comments on commit 94d06a1

Please sign in to comment.