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

intertext

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intertext - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

32

lib/html.js

@@ -295,2 +295,34 @@ (function() {

//===========================================================================================================
// PARSING
//-----------------------------------------------------------------------------------------------------------
this.$html_as_datoms = function() {
var $;
({$} = (require('steampipes')).export());
return $((buffer_or_text, send) => {
var d, i, len, ref;
ref = this.html_as_datoms(buffer_or_text);
for (i = 0, len = ref.length; i < len; i++) {
d = ref[i];
send(d);
}
return null;
});
};
//-----------------------------------------------------------------------------------------------------------
this.$mkts_html_as_datoms = function() {
var $;
({$} = (require('steampipes')).export());
return $((buffer_or_text, send) => {
var d, i, len, ref;
ref = this.mkts_html_as_datoms(buffer_or_text);
for (i = 0, len = ref.length; i < len; i++) {
d = ref[i];
send(d);
}
return null;
});
};
//###########################################################################################################

@@ -297,0 +329,0 @@ if (module === require.main) {

110

lib/tests/html.test.js

@@ -1370,2 +1370,102 @@ (function() {

//-----------------------------------------------------------------------------------------------------------
this["HTML.$html_as_datoms"] = function(T, done) {
var $, $async, $drain, $show, $watch, SP, matcher, pipeline, probe;
SP = require('steampipes');
// SP = require '../../apps/steampipes'
({$, $async, $drain, $watch, $show} = SP.export());
//.........................................................................................................
probe = `<p>A <em>concise</em> introduction to the things discussed below.</p>`;
matcher = [
{
"$key": "<p"
},
{
"text": "A ",
"$key": "^text"
},
{
"$key": "<em"
},
{
"text": "concise",
"$key": "^text"
},
{
"$key": ">em"
},
{
"text": " introduction to the things discussed below.",
"$key": "^text"
},
{
"$key": ">p"
}
];
//.........................................................................................................
pipeline = [];
pipeline.push([Buffer.from(probe)]);
pipeline.push(SP.$split());
pipeline.push(HTML.$html_as_datoms());
pipeline.push($show());
pipeline.push($drain((result) => {
help(jr(result));
T.eq(result, matcher);
return done();
}));
SP.pull(...pipeline);
//.........................................................................................................
return null;
};
//-----------------------------------------------------------------------------------------------------------
this["HTML.$mkts_html_as_datoms"] = function(T, done) {
var $, $async, $drain, $show, $watch, SP, matcher, pipeline, probe;
SP = require('steampipes');
// SP = require '../../apps/steampipes'
({$, $async, $drain, $watch, $show} = SP.export());
//.........................................................................................................
probe = `<p>A <em>concise</em> introduction to the things discussed below.</p>`;
matcher = [
{
"$key": "<p"
},
{
"text": "A ",
"$key": "^text"
},
{
"$key": "<em"
},
{
"text": "concise",
"$key": "^text"
},
{
"$key": ">em"
},
{
"text": " introduction to the things discussed below.",
"$key": "^text"
},
{
"$key": ">p"
}
];
//.........................................................................................................
pipeline = [];
pipeline.push([Buffer.from(probe)]);
pipeline.push(SP.$split());
pipeline.push(HTML.$mkts_html_as_datoms());
pipeline.push($show());
pipeline.push($drain((result) => {
help(jr(result));
T.eq(result, matcher);
return done();
}));
SP.pull(...pipeline);
//.........................................................................................................
return null;
};
//-----------------------------------------------------------------------------------------------------------
this["demo"] = function(T, done) {

@@ -1435,9 +1535,11 @@ var d, datoms, i, len, ref, text;

// await @_demo()
// test @
help('ok');
// test @[ "demo" ]
return test(this["demo (buffer)"]);
test(this);
return help('ok');
})();
}
// test @[ "demo" ]
// test @[ "demo (buffer)" ]
// test @[ "HTML.$html_as_datoms" ]
// test @[ "must quote attribute value" ]

@@ -1444,0 +1546,0 @@ // test @[ "DATOM.HTML._as_attribute_literal" ]

2

package.json
{
"name": "intertext",
"version": "0.4.0",
"version": "0.5.0",
"description": "Services for Recurrent Text-related Tasks",

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

@@ -270,2 +270,9 @@

For [SteamPipe](https://github.com/loveencounterflow/steampipes) streams, use
* `$html_as_datoms()`
* `$mkts_html_as_datoms()`
for the same functionality; both transforms accept texts or buffers.
### HTML Generation

@@ -272,0 +279,0 @@

Sorry, the diff of this file is not supported yet

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