true-pg 0.4.4 → 0.4.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.
Files changed (2) hide show
  1. package/lib/index.js +7 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -17,7 +17,9 @@ const filter_overloaded_functions = (functions) => {
17
17
  }, {});
18
18
  return [
19
19
  functions.filter(func => counts[func.name] === 1),
20
- functions.filter(func => counts[func.name] > 1),
20
+ Object.entries(counts)
21
+ .filter(([_, count]) => count > 1)
22
+ .map(([name]) => name),
21
23
  ];
22
24
  };
23
25
  const filter_function = (func) => {
@@ -93,9 +95,9 @@ const multifile = async (generators, schemas, opts) => {
93
95
  for (const schema of Object.values(schemas)) {
94
96
  console.log("Selected schema '%s':\n", schema.name);
95
97
  const schemaDir = joinpath(out, schema.name);
96
- const [supported_functions, unsupported_functions] = filter_unsupported_functions(schema.functions);
97
- const [unique_functions, overloaded_functions] = filter_overloaded_functions(supported_functions);
98
- schema.functions = unique_functions;
98
+ const [unique_functions, overloaded_functions] = filter_overloaded_functions(schema.functions);
99
+ const [supported_functions, unsupported_functions] = filter_unsupported_functions(unique_functions);
100
+ schema.functions = supported_functions;
99
101
  {
100
102
  const skipped = unsupported_functions.map(f => ` - ${f.name}`);
101
103
  if (skipped.length) {
@@ -104,7 +106,7 @@ const multifile = async (generators, schemas, opts) => {
104
106
  }
105
107
  }
106
108
  {
107
- const skipped = overloaded_functions.map(f => ` - ${f.name}`);
109
+ const skipped = overloaded_functions.map(f => ` - ${f}`);
108
110
  if (skipped.length) {
109
111
  warnings.push(`Skipping ${skipped.length} overloaded functions (not supported):\n` + skipped.join("\n"));
110
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "true-pg",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "type": "module",
5
5
  "module": "lib/index.js",
6
6
  "main": "lib/index.js",