Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xlsx-write-stream

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xlsx-write-stream - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

17

dist/utils.js

@@ -7,3 +7,3 @@ 'use strict';

exports.getCellId = getCellId;
exports.escape = escape;
exports.sanitize = sanitize;
exports.timeoutPromised = timeoutPromised;

@@ -23,4 +23,15 @@ const baseString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

function escape(text) {
return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
function sanitize(text) {
const escaped = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
const sourceBuffer = Buffer.from(escaped);
const buffer = Buffer.alloc(sourceBuffer.byteLength); // allocate enough space
let letter;
let writtenLength = 0;
for (let i = 0; i < escaped.length; i++) {
letter = escaped[i];
if (letter === '\x09' || letter === '\x0A' || letter === '\x0D' || letter >= '\x20' && letter <= '\uD7FF' || letter >= '\uE000' && letter <= '\uFFFD') {
writtenLength += buffer.write(letter, writtenLength);
}
}
return buffer.toString('utf8', 0, writtenLength);
}

@@ -27,0 +38,0 @@

2

package.json
{
"name": "xlsx-write-stream",
"version": "0.0.13",
"version": "0.0.14",
"description": "Apify xlsx write stream helper",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc