@axium/server 0.4.2 → 0.4.3

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/database.js CHANGED
@@ -107,7 +107,7 @@ export async function init(opt) {
107
107
  opt.output('debug', 'Generated password and wrote to global config');
108
108
  }
109
109
  const _sql = (command, message) => run(opt, message, `sudo -u postgres psql -c "${command}"`);
110
- const relationExists = someWarnings(opt, [/relation "\w+" already exists/, 'already exists.']);
110
+ const relationExists = someWarnings(opt.output, [/relation "\w+" already exists/, 'already exists.']);
111
111
  await _sql('CREATE DATABASE axium', 'Creating database').catch(async (error) => {
112
112
  if (error != 'database "axium" already exists')
113
113
  throw error;
package/dist/io.d.ts CHANGED
@@ -69,4 +69,4 @@ export declare function restrictedPorts(opt: PortOptions): Promise<void>;
69
69
  * The handler will allow the parent scope to continue if a relation already exists,
70
70
  * rather than fatally exiting.
71
71
  */
72
- export declare function someWarnings(opt: WithOutput, ...allowList: [RegExp, string?][]): (error: string | Error) => void;
72
+ export declare function someWarnings(output: Output, ...allowList: [RegExp, string?][]): (error: string | Error) => void;
package/dist/io.js CHANGED
@@ -172,12 +172,12 @@ export async function restrictedPorts(opt) {
172
172
  * The handler will allow the parent scope to continue if a relation already exists,
173
173
  * rather than fatally exiting.
174
174
  */
175
- export function someWarnings(opt, ...allowList) {
175
+ export function someWarnings(output, ...allowList) {
176
176
  return (error) => {
177
177
  error = typeof error == 'object' && 'message' in error ? error.message : error;
178
178
  for (const [pattern, message = error] of allowList) {
179
179
  if (pattern.test(error))
180
- opt.output('warn', message);
180
+ output('warn', message);
181
181
  }
182
182
  throw error;
183
183
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "funding": {
6
6
  "type": "individual",