pixl-server-storage 3.2.6 → 3.2.8

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/engines/SQLite.js CHANGED
@@ -393,12 +393,11 @@ module.exports = Class.create({
393
393
  this.db.run( this.commands.delete, { $key: key }, function(err) {
394
394
  // In sqlite3 callbacks `this` is special, and contains `changes`
395
395
  if (!err && !this.changes) {
396
- err = new Error("Not found");
396
+ err = new Error("Failed to delete object: " + key + ": Not found");
397
397
  err.code = "NoSuchKey";
398
398
  }
399
399
  if (err) {
400
400
  self.logError('sqlite', "Failed to delete object: " + key + ": " + err);
401
- err = new Error("Failed to delete object: " + key + ": " + err);
402
401
  return callback(err);
403
402
  }
404
403
  self.logDebug(9, "Delete complete: " + key);
package/indexer.js CHANGED
@@ -961,13 +961,13 @@ module.exports = Class.create({
961
961
 
962
962
  filterWords_markdown: function(value) {
963
963
  // filter out markdown syntax and html tags, entities
964
- value = value.replace(/\n\`\`\`(.+?)\`\`\`/g, ''); // fenced code
964
+ value = value.replace(/```[\s\S]*?```/g, ''); // fenced code
965
965
  return this.filterWords_html(value);
966
966
  },
967
967
 
968
968
  filterWords_html: function(value) {
969
969
  // filter out html tags, entities
970
- return he.decode( value.replace(/<.+?>/g, '') );
970
+ return he.decode( value.replace(/<[^>]*>/g, '') );
971
971
  },
972
972
 
973
973
  filterWords_alphanum: function(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixl-server-storage",
3
- "version": "3.2.6",
3
+ "version": "3.2.8",
4
4
  "description": "A key/value/list storage component for the pixl-server framework.",
5
5
  "author": "Joseph Huckaby <jhuckaby@gmail.com>",
6
6
  "homepage": "https://github.com/jhuckaby/pixl-server-storage",
package/storage.js CHANGED
@@ -521,6 +521,15 @@ module.exports = Class.create({
521
521
  var self = this;
522
522
  this.logDebug(9, "Copying record: " + old_key + " to " + new_key);
523
523
 
524
+ // branch here if binary keys
525
+ if (this.isBinaryKey(old_key) && this.isBinaryKey(new_key)) {
526
+ this.getStream(old_key, function(err, stream) {
527
+ if (err) return callback(err, null);
528
+ self.putStream(new_key, stream, callback);
529
+ } );
530
+ return;
531
+ }
532
+
524
533
  // load old key
525
534
  this.get(old_key, function(err, data) {
526
535
  if (err) return callback(err, null);