yaml-admin-api 0.0.43 → 0.0.52

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml-admin-api",
3
- "version": "0.0.43",
3
+ "version": "0.0.52",
4
4
  "license": "MIT",
5
5
  "description": "YAML Admin API package",
6
6
  "type": "commonjs",
@@ -18,9 +18,12 @@ const changeEnv = (yamlString, env = {}) => {
18
18
  }
19
19
 
20
20
  async function registerRoutes(app, options = {}) {
21
- const { yamlPath, yamlString, env } = options;
21
+ const { yamlPath, yamlString, env, yamlJson } = options;
22
22
  let yml;
23
- if(yamlPath) {
23
+
24
+ if(yamlJson) {
25
+ yml = yamlJson;
26
+ } else if(yamlPath) {
24
27
  yml = await readYml(yamlPath, env);
25
28
  } else if(yamlString) {
26
29
  const replaced = changeEnv(yamlString, env);