Skip to content

Commit

Permalink
fix(core): prevent json stringify limit when exporting classifications
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Oct 23, 2024
1 parent 25ee0aa commit 5c2eaa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components",
"description": "Collection of core functionalities to author BIM apps.",
"version": "2.4.0-alpha.9",
"version": "2.4.0-alpha.10",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
10 changes: 4 additions & 6 deletions packages/core/src/fragments/Classifier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,21 +524,19 @@ export class Classifier extends Component implements Disposable {
}
}

return JSON.stringify(exported);
return exported;
}

/**
* Imports a classification previously exported with .export().
* @param data the serialized classification to import.
*/
import(data: string) {
const imported = JSON.parse(data) as ExportedClassification;

for (const systemName in imported) {
import(data: ExportedClassification) {
for (const systemName in data) {
if (!this.list[systemName]) {
this.list[systemName] = {};
}
const system = imported[systemName];
const system = data[systemName];
for (const groupName in system) {
const group = system[groupName];
this.list[systemName][groupName] = {
Expand Down

0 comments on commit 5c2eaa5

Please sign in to comment.