@takeshape/schema 8.39.3 → 8.42.1

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.
@@ -2,6 +2,7 @@ import { resolveTemplate, isValidTemplate } from './template-shapes';
2
2
  import { getAllRefs } from './schema-util';
3
3
  import set from 'lodash/set';
4
4
  import { deepClone } from '@takeshape/util';
5
+ import { refItemToShapeName } from './refs';
5
6
  export function flattenTemplates(projectSchema) {
6
7
  const templateRefs = getAllRefs(projectSchema, ref => Boolean(ref.template));
7
8
 
@@ -16,7 +17,7 @@ export function flattenTemplates(projectSchema) {
16
17
  const {
17
18
  shapeName,
18
19
  dependencies
19
- } = resolveTemplate(projectSchema, ref.template, ref.typeName);
20
+ } = resolveTemplate(projectSchema, ref.template, refItemToShapeName(ref));
20
21
  set(newSchema, ref.path, shapeName);
21
22
  Object.assign(newSchema.shapes, dependencies);
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flatten-templates.d.ts","sourceRoot":"","sources":["../../src/flatten-templates.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAK/C,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAgB5E"}
1
+ {"version":3,"file":"flatten-templates.d.ts","sourceRoot":"","sources":["../../src/flatten-templates.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAM/C,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAgB5E"}
@@ -13,6 +13,8 @@ var _set = _interopRequireDefault(require("lodash/set"));
13
13
 
14
14
  var _util = require("@takeshape/util");
15
15
 
16
+ var _refs = require("./refs");
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
20
  function flattenTemplates(projectSchema) {
@@ -29,7 +31,7 @@ function flattenTemplates(projectSchema) {
29
31
  const {
30
32
  shapeName,
31
33
  dependencies
32
- } = (0, _templateShapes.resolveTemplate)(projectSchema, ref.template, ref.typeName);
34
+ } = (0, _templateShapes.resolveTemplate)(projectSchema, ref.template, (0, _refs.refItemToShapeName)(ref));
33
35
  (0, _set.default)(newSchema, ref.path, shapeName);
34
36
  Object.assign(newSchema.shapes, dependencies);
35
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/schema",
3
- "version": "8.39.3",
3
+ "version": "8.42.1",
4
4
  "description": "TakeShape Schema",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -21,9 +21,9 @@
21
21
  "examples"
22
22
  ],
23
23
  "dependencies": {
24
- "@takeshape/errors": "8.39.3",
25
- "@takeshape/json-schema": "8.39.3",
26
- "@takeshape/util": "8.39.3",
24
+ "@takeshape/errors": "8.42.1",
25
+ "@takeshape/json-schema": "8.42.1",
26
+ "@takeshape/util": "8.42.1",
27
27
  "ajv": "^7.0.4",
28
28
  "ajv-formats": "^1.5.1",
29
29
  "lodash": "^4.17.20",