@nina-protocol/nina-db 0.0.40 → 0.0.42

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.
@@ -116,7 +116,8 @@ export default class Release extends Model {
116
116
  .replace(/ +/g, ' ') // remove spaces
117
117
  .replace(/ /g, '-') // replace spaces with hyphens
118
118
  .replace(/[^a-zA-Z0-9-]/g, '') // remove non-alphanumeric characters
119
- .replace(/--+/g, ''); // remove spaces
119
+ .replace(/--+/g, '') // remove spaces
120
+ .replace(/-$/, '');
120
121
  const existingRelease = await Release.query().findOne({ slug });
121
122
  if (existingRelease) {
122
123
  return `${slug}-${randomStringGenerator()}`;
@@ -134,6 +135,7 @@ export default class Release extends Model {
134
135
  this.hub.authority = authority.publicKey;
135
136
  delete this.hub.authorityId;
136
137
  }
138
+ await publisher.format();
137
139
  this.publisher = publisher.publicKey;
138
140
  this.publisherAccount = publisher;
139
141
  delete this.publisherId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nina-protocol/nina-db",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -128,6 +128,8 @@ export default class Release extends Model {
128
128
  .replace(/ /g, '-') // replace spaces with hyphens
129
129
  .replace(/[^a-zA-Z0-9-]/g, '') // remove non-alphanumeric characters
130
130
  .replace(/--+/g, '') // remove spaces
131
+ .replace(/-$/, '')
132
+
131
133
  const existingRelease = await Release.query().findOne({ slug });
132
134
  if (existingRelease) {
133
135
  return `${slug}-${randomStringGenerator()}`;
@@ -147,6 +149,7 @@ export default class Release extends Model {
147
149
  this.hub.authority = authority.publicKey;
148
150
  delete this.hub.authorityId;
149
151
  }
152
+ await publisher.format();
150
153
  this.publisher = publisher.publicKey;
151
154
  this.publisherAccount = publisher;
152
155
  delete this.publisherId