Files
doneit-web/.angular/cache/14.2.12/babel-webpack/86dff58e4954fda5bc0d61665811d083.json
T
Eudes Inácio 53b71ea16f its working
2023-06-30 09:54:21 +01:00

1 line
5.5 KiB
JSON

{"ast":null,"code":"import { FieldKeysArray } from './field/fields.interface.js';\nexport class ModelReader {\n static read(modelClassRepresentation) {\n const classInstance = new modelClassRepresentation();\n const modelName = classInstance.getModelName();\n const fieldTypes = {};\n const fields = {};\n const attributes = {};\n for (const [fieldName, Field] of Object.entries(classInstance)) {\n const type = Field === null || Field === void 0 ? void 0 : Field.fieldName;\n if (FieldKeysArray.includes(type)) {\n fields[fieldName] = Field;\n if (!fieldTypes[type]) {\n fieldTypes[type] = [];\n }\n fieldTypes[type].push(fieldName);\n for (const [FieldProperty, value] of Object.entries(Field)) {\n if (typeof value != \"function\") {\n if (!attributes[FieldProperty]) {\n attributes[FieldProperty] = [];\n }\n attributes[FieldProperty].push(fieldName);\n }\n }\n }\n }\n return {\n modelName,\n fields,\n fieldTypes,\n attributes\n };\n }\n}\nexport class LocalStorageModelReader {\n static read(modelClassRepresentation) {\n const classInstance = modelClassRepresentation;\n const fieldTypes = {};\n const attributes = {};\n const modelName = classInstance.getModelName();\n const fields = {};\n for (const [fieldName, Field] of Object.entries(classInstance)) {\n // const type = Field?.fieldName\n fields[fieldName] = Field || null;\n }\n return {\n modelName,\n fields,\n attributes,\n fieldTypes\n };\n }\n}","map":{"version":3,"names":["FieldKeysArray","ModelReader","read","modelClassRepresentation","classInstance","modelName","getModelName","fieldTypes","fields","attributes","fieldName","Field","Object","entries","type","includes","push","FieldProperty","value","LocalStorageModelReader"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/beast-orm/dist/src/models/model.reader.js"],"sourcesContent":["import { FieldKeysArray } from './field/fields.interface.js';\r\nexport class ModelReader {\r\n static read(modelClassRepresentation) {\r\n const classInstance = new modelClassRepresentation();\r\n const modelName = classInstance.getModelName();\r\n const fieldTypes = {};\r\n const fields = {};\r\n const attributes = {};\r\n for (const [fieldName, Field] of Object.entries(classInstance)) {\r\n const type = Field === null || Field === void 0 ? void 0 : Field.fieldName;\r\n if (FieldKeysArray.includes(type)) {\r\n fields[fieldName] = Field;\r\n if (!fieldTypes[type]) {\r\n fieldTypes[type] = [];\r\n }\r\n fieldTypes[type].push(fieldName);\r\n for (const [FieldProperty, value] of Object.entries(Field)) {\r\n if (typeof value != \"function\") {\r\n if (!attributes[FieldProperty]) {\r\n attributes[FieldProperty] = [];\r\n }\r\n attributes[FieldProperty].push(fieldName);\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n modelName,\r\n fields,\r\n fieldTypes,\r\n attributes,\r\n };\r\n }\r\n}\r\nexport class LocalStorageModelReader {\r\n static read(modelClassRepresentation) {\r\n const classInstance = modelClassRepresentation;\r\n const fieldTypes = {};\r\n const attributes = {};\r\n const modelName = classInstance.getModelName();\r\n const fields = {};\r\n for (const [fieldName, Field] of Object.entries(classInstance)) {\r\n // const type = Field?.fieldName\r\n fields[fieldName] = Field || null;\r\n }\r\n return {\r\n modelName,\r\n fields,\r\n attributes,\r\n fieldTypes\r\n };\r\n }\r\n}\r\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,6BAA6B;AAC5D,OAAO,MAAMC,WAAW,CAAC;EACrB,OAAOC,IAAIA,CAACC,wBAAwB,EAAE;IAClC,MAAMC,aAAa,GAAG,IAAID,wBAAwB,CAAC,CAAC;IACpD,MAAME,SAAS,GAAGD,aAAa,CAACE,YAAY,CAAC,CAAC;IAC9C,MAAMC,UAAU,GAAG,CAAC,CAAC;IACrB,MAAMC,MAAM,GAAG,CAAC,CAAC;IACjB,MAAMC,UAAU,GAAG,CAAC,CAAC;IACrB,KAAK,MAAM,CAACC,SAAS,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACT,aAAa,CAAC,EAAE;MAC5D,MAAMU,IAAI,GAAGH,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,GAAG,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