@hubspot/project-parsing-lib 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -1
- package/src/lib/transform.d.ts +1 -0
- package/src/lib/transform.js +4 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { isTranslationError } from './lib/errors';
|
|
|
5
5
|
export { IntermediateRepresentation, IntermediateRepresentationNode, IntermediateRepresentationLocalDev, IntermediateRepresentationNodeLocalDev, TranslationContext, };
|
|
6
6
|
export { migrate } from './lib/migrate';
|
|
7
7
|
export { validateUid } from './lib/uid';
|
|
8
|
+
export { mapToUserFriendlyName } from './lib/transform';
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateUid = exports.migrate = exports.isTranslationError = void 0;
|
|
6
|
+
exports.mapToUserFriendlyName = exports.validateUid = exports.migrate = exports.isTranslationError = void 0;
|
|
7
7
|
exports.translate = translate;
|
|
8
8
|
exports.translateForLocalDev = translateForLocalDev;
|
|
9
9
|
const files_1 = require("./lib/files");
|
|
@@ -52,3 +52,5 @@ var migrate_1 = require("./lib/migrate");
|
|
|
52
52
|
Object.defineProperty(exports, "migrate", { enumerable: true, get: function () { return migrate_1.migrate; } });
|
|
53
53
|
var uid_1 = require("./lib/uid");
|
|
54
54
|
Object.defineProperty(exports, "validateUid", { enumerable: true, get: function () { return uid_1.validateUid; } });
|
|
55
|
+
var transform_2 = require("./lib/transform");
|
|
56
|
+
Object.defineProperty(exports, "mapToUserFriendlyName", { enumerable: true, get: function () { return transform_2.mapToUserFriendlyName; } });
|
package/src/lib/transform.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FileParseResult, IntermediateRepresentation, Transformation } from './types';
|
|
2
2
|
export declare function mapToUserFacingType(type: string): string;
|
|
3
|
+
export declare function mapToUserFriendlyName(internalType: string): string;
|
|
3
4
|
export declare function transform(fileParseResults: FileParseResult[]): Transformation[];
|
|
4
5
|
export declare function getIntermediateRepresentation(transformations: Transformation[], skipValidation: boolean | undefined): IntermediateRepresentation;
|
package/src/lib/transform.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapToUserFacingType = mapToUserFacingType;
|
|
4
|
+
exports.mapToUserFriendlyName = mapToUserFriendlyName;
|
|
4
5
|
exports.transform = transform;
|
|
5
6
|
exports.getIntermediateRepresentation = getIntermediateRepresentation;
|
|
6
7
|
const constants_1 = require("./constants");
|
|
@@ -33,6 +34,9 @@ function mapToUserFacingType(type) {
|
|
|
33
34
|
.toLowerCase()
|
|
34
35
|
.replace(/_/g, '-');
|
|
35
36
|
}
|
|
37
|
+
function mapToUserFriendlyName(internalType) {
|
|
38
|
+
return constants_1.Components[mapToUserFacingType(internalType)]?.userFriendlyName || '';
|
|
39
|
+
}
|
|
36
40
|
function transform(fileParseResults) {
|
|
37
41
|
const parentTypes = Object.keys(constants_1.ProjectStructure);
|
|
38
42
|
const parentComponents = {};
|