prisma-laravel-migrate 3.1.18 → 3.1.19

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/dist/cli/cli.js CHANGED
@@ -1102,8 +1102,8 @@ async function writeWithMerge(filePath, theirs, type, overwrite = true, currentP
1102
1102
  const readPath = currentPath ?? filePath;
1103
1103
  if (!overwrite && existsSync(filePath)) return;
1104
1104
  const doFormat = (code) => {
1105
- const globalCfg = global?._config ?? {};
1106
- const typeCfg = globalCfg[type] ?? {};
1105
+ const globalCfg = getConfig(type);
1106
+ const typeCfg = globalCfg ?? {};
1107
1107
  const usePrettier = !!typeCfg.prettier;
1108
1108
  if (!usePrettier || !code) return code;
1109
1109
  const parser = typeCfg.parser ?? (type === "ts" ? "typescript" : "php");
@@ -1013,8 +1013,8 @@ async function writeWithMerge(filePath, theirs, type, overwrite = true, currentP
1013
1013
  const readPath = currentPath ?? filePath;
1014
1014
  if (!overwrite && existsSync(filePath)) return;
1015
1015
  const doFormat = (code) => {
1016
- const globalCfg = global?._config ?? {};
1017
- const typeCfg = globalCfg[type] ?? {};
1016
+ const globalCfg = getConfig(type);
1017
+ const typeCfg = globalCfg ?? {};
1018
1018
  const usePrettier = !!typeCfg.prettier;
1019
1019
  if (!usePrettier || !code) return code;
1020
1020
  const parser = typeCfg.parser ?? ("php");
@@ -1047,8 +1047,8 @@ async function writeWithMerge(filePath, theirs, type, overwrite = true, currentP
1047
1047
  const readPath = filePath;
1048
1048
  if (!overwrite && existsSync(filePath)) return;
1049
1049
  const doFormat = (code) => {
1050
- const globalCfg = global?._config ?? {};
1051
- const typeCfg = globalCfg[type] ?? {};
1050
+ const globalCfg = getConfig(type);
1051
+ const typeCfg = globalCfg ?? {};
1052
1052
  const usePrettier = !!typeCfg.prettier;
1053
1053
  if (!usePrettier || !code) return code;
1054
1054
  const parser = typeCfg.parser ?? ("php");
@@ -174,7 +174,7 @@ function addToConfig(key, value) {
174
174
  function getConfig(key, property) {
175
175
  const cfg = config;
176
176
  const section = cfg[key];
177
- return property ? section?.[property] : section;
177
+ return section;
178
178
  }
179
179
  var isForModel = (t) => (t & 1 /* Model */) !== 0;
180
180
  function parseTargetDirective(tag, doc, defaultFlags = 1 /* Model */) {
@@ -1541,8 +1541,8 @@ async function writeWithMerge(filePath, theirs, type, overwrite = true, currentP
1541
1541
  const readPath = filePath;
1542
1542
  if (!overwrite && existsSync(filePath)) return;
1543
1543
  const doFormat = (code) => {
1544
- const globalCfg = global?._config ?? {};
1545
- const typeCfg = globalCfg[type] ?? {};
1544
+ const globalCfg = getConfig(type);
1545
+ const typeCfg = globalCfg ?? {};
1546
1546
  const usePrettier = !!typeCfg.prettier;
1547
1547
  if (!usePrettier || !code) return code;
1548
1548
  const parser = typeCfg.parser ?? ("typescript" );
package/dist/index.js CHANGED
@@ -1166,8 +1166,8 @@ async function writeWithMerge(filePath, theirs, type, overwrite = true, currentP
1166
1166
  const readPath = currentPath ?? filePath;
1167
1167
  if (!overwrite && existsSync(filePath)) return;
1168
1168
  const doFormat = (code) => {
1169
- const globalCfg = global?._config ?? {};
1170
- const typeCfg = globalCfg[type] ?? {};
1169
+ const globalCfg = getConfig(type);
1170
+ const typeCfg = globalCfg ?? {};
1171
1171
  const usePrettier = !!typeCfg.prettier;
1172
1172
  if (!usePrettier || !code) return code;
1173
1173
  const parser = typeCfg.parser ?? (type === "ts" ? "typescript" : "php");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prisma-laravel-migrate",
3
- "version": "3.1.18",
3
+ "version": "3.1.19",
4
4
  "description": "Generate laravel migrations and/or models using prisma files",
5
5
  "bin": {
6
6
  "prisma-laravel-migrations": "./dist/cli/migrator.index.js",