From 5d75efba9d1d95c9695ebafaf8d09d4889b3e3f2 Mon Sep 17 00:00:00 2001 From: SenchaPencha Date: Sun, 3 Sep 2023 01:55:15 +0300 Subject: [PATCH 1/2] deep-map-object to recursive-object-map --- automation/generate-schema.ts | 4 ++-- package-lock.json | 6 ------ package.json | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/automation/generate-schema.ts b/automation/generate-schema.ts index a74d99f..d2e0e63 100644 --- a/automation/generate-schema.ts +++ b/automation/generate-schema.ts @@ -2,7 +2,7 @@ import * as TJS from 'typescript-json-schema'; import * as path from 'path' import * as fs from 'fs' import _ from 'lodash'; -import {deepMapObject} from '@freephoenix888/deep-map-object'; +import {recursiveObjectMap} from '@freephoenix888/recursive-object-map'; import yargs from 'yargs/yargs'; import { hideBin } from 'yargs/helpers'; import {capitalCase} from 'case-anything' @@ -31,7 +31,7 @@ async function main () { throw new Error("Failed to generate schema") } - schema = await deepMapObject(schema, ({key, value}) => ({newKey: key, newValue: (key === 'title') ? capitalCase(value) : value})); + schema = await recursiveObjectMap(schema, (key, value) => ({newKey: key, newValue: (key === 'title') ? capitalCase(value) : value})); if(cliOptions.outputJsonFilePath) { fs.writeFileSync(path.resolve(cliOptions.outputJsonFilePath), JSON.stringify(schema, null, 2)); } else { diff --git a/package-lock.json b/package-lock.json index 58f6366..15ca7f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,6 @@ "@deep-foundation/store": "^0.0.19", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", - "@freephoenix888/deep-map-object": "^3.0.1", "@google-cloud/speech": "^5.4.0", "@google-cloud/vision": "^3.1.2", "@ionic/pwa-elements": "^3.1.1", @@ -5038,11 +5037,6 @@ "@deep-foundation/core": "^0.0.2" } }, - "node_modules/@freephoenix888/deep-map-object": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@freephoenix888/deep-map-object/-/deep-map-object-3.0.1.tgz", - "integrity": "sha512-0ww0NDZBlLMYZ4NwY+nnSsXY3GrYZxbyDpPdCEiA2OYOJaueeCN96lSKHihkA/pNzuARCU6ButULxiloxTma3g==" - }, "node_modules/@freephoenix888/deepclient-extensions": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@freephoenix888/deepclient-extensions/-/deepclient-extensions-0.5.0.tgz", diff --git a/package.json b/package.json index fe2a66b..9c014ed 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,6 @@ "@deep-foundation/store": "^0.0.19", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", - "@freephoenix888/deep-map-object": "^3.0.1", "@google-cloud/speech": "^5.4.0", "@google-cloud/vision": "^3.1.2", "@ionic/pwa-elements": "^3.1.1", From b491d4ea9f33723b023e755da096f3042815047d Mon Sep 17 00:00:00 2001 From: SenchaPencha Date: Sun, 3 Sep 2023 01:55:15 +0300 Subject: [PATCH 2/2] deep-map-object to recursive-object-map --- automation/generate-schema.ts | 4 ++-- package-lock.json | 15 +++++++++------ package.json | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/automation/generate-schema.ts b/automation/generate-schema.ts index a74d99f..d2e0e63 100644 --- a/automation/generate-schema.ts +++ b/automation/generate-schema.ts @@ -2,7 +2,7 @@ import * as TJS from 'typescript-json-schema'; import * as path from 'path' import * as fs from 'fs' import _ from 'lodash'; -import {deepMapObject} from '@freephoenix888/deep-map-object'; +import {recursiveObjectMap} from '@freephoenix888/recursive-object-map'; import yargs from 'yargs/yargs'; import { hideBin } from 'yargs/helpers'; import {capitalCase} from 'case-anything' @@ -31,7 +31,7 @@ async function main () { throw new Error("Failed to generate schema") } - schema = await deepMapObject(schema, ({key, value}) => ({newKey: key, newValue: (key === 'title') ? capitalCase(value) : value})); + schema = await recursiveObjectMap(schema, (key, value) => ({newKey: key, newValue: (key === 'title') ? capitalCase(value) : value})); if(cliOptions.outputJsonFilePath) { fs.writeFileSync(path.resolve(cliOptions.outputJsonFilePath), JSON.stringify(schema, null, 2)); } else { diff --git a/package-lock.json b/package-lock.json index 58f6366..3a1babf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "@deep-foundation/store": "^0.0.19", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", - "@freephoenix888/deep-map-object": "^3.0.1", + "@freephoenix888/recursive-object-map": "^1.0.0", "@google-cloud/speech": "^5.4.0", "@google-cloud/vision": "^3.1.2", "@ionic/pwa-elements": "^3.1.1", @@ -5038,11 +5038,6 @@ "@deep-foundation/core": "^0.0.2" } }, - "node_modules/@freephoenix888/deep-map-object": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@freephoenix888/deep-map-object/-/deep-map-object-3.0.1.tgz", - "integrity": "sha512-0ww0NDZBlLMYZ4NwY+nnSsXY3GrYZxbyDpPdCEiA2OYOJaueeCN96lSKHihkA/pNzuARCU6ButULxiloxTma3g==" - }, "node_modules/@freephoenix888/deepclient-extensions": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@freephoenix888/deepclient-extensions/-/deepclient-extensions-0.5.0.tgz", @@ -5074,6 +5069,14 @@ "@deep-foundation/core": "^0.0.2" } }, + "node_modules/@freephoenix888/recursive-object-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@freephoenix888/recursive-object-map/-/recursive-object-map-1.0.0.tgz", + "integrity": "sha512-eRXb8Ew3ZA4EnsyXo+UrizwuibBG5TLH8DyWs3CdpYmwHzdE8EPXYFTuQf0RvhyA2qDA7tYj8O2beJSwdatz9w==", + "dependencies": { + "@deep-foundation/core": "^0.0.2" + } + }, "node_modules/@google-cloud/common": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-4.0.3.tgz", diff --git a/package.json b/package.json index fe2a66b..26c6ab6 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@deep-foundation/store": "^0.0.19", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", - "@freephoenix888/deep-map-object": "^3.0.1", + "@freephoenix888/recursive-object-map": "^1.0.0", "@google-cloud/speech": "^5.4.0", "@google-cloud/vision": "^3.1.2", "@ionic/pwa-elements": "^3.1.1",