mcard-js
Version:
A JavaScript implementation of MCard - A data model for persistently storing content with cryptographic hashing and timestamping
21 lines (16 loc) • 849 B
JavaScript
;
var _bufferContentHelper = require("./bufferContentHelper.js");
// Test script for content type detection
// Example CSV data in Buffer JSON format
const csvBufferJson = {
"type": "Buffer",
"data": [105, 100, 44, 110, 97, 109, 101, 44, 118, 97, 108, 117, 101, 10, 49, 44, 73, 116, 101, 109, 32, 49, 44, 49, 48, 48, 10, 50, 44, 73, 116, 101, 109, 32, 50, 44, 50, 48, 48, 10, 51, 44, 73, 116, 101, 109, 32, 51, 44, 51, 48, 48, 10]
};
// Test detection
console.log("Testing CSV Buffer detection:");
console.log("Detected content type:", (0, _bufferContentHelper.detectContentType)(csvBufferJson));
// Show the decoded content
console.log("\nDecoded content:");
console.log((0, _bufferContentHelper.convertBufferToString)(csvBufferJson));
// Run this with: node src/utils/testDetection.js
//# sourceMappingURL=testDetection.js.map