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

a2s

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a2s - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

43

lib/a2s.js

@@ -18,2 +18,45 @@ var request = require('request')

//
// ## parse `parse(options, callback)`
//
// Parses **options.text**, replacing all blocks delimited by **options.boundary** with their SVG counterparts.
//
// Returns the replaced version of **options.text**.
//
A2SRenderer.prototype.parse = parse
function parse(options, callback) {
var self = this
, text = options.text
, boundary = options.boundary
, regex = new RegExp(boundary, 'g')
, original = null
, start
, end
function parseChunk(err, content) {
if (err) {
callback(err)
return
}
if (original) {
text = text.replace(original, content)
}
start = regex.exec(text)
end = regex.exec(text)
if (start && end) {
original = text.slice(start.index, end.index + boundary.length)
self.render({
text: text.slice(start.index + boundary.length, end.index)
}, parseChunk)
} else {
callback(null, text)
}
}
parseChunk()
}
//
// ## render `render(options, callback)`

@@ -20,0 +63,0 @@ //

2

package.json
{
"name": "a2s",
"version": "1.0.0",
"version": "1.0.1",
"description": "Provides a nice interface to a2saas.com, the asciitosvg web service.",

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

Sorry, the diff of this file is not supported yet

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