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

retext

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

component.json

1

.jscs.json

@@ -69,3 +69,2 @@ {

"+",
"-",
"/",

@@ -72,0 +71,0 @@ "*",

@@ -48,18 +48,34 @@ /* jshint -W084, -W093 */

function Retext(parser) {
var self = this;
var self = this,
cache = require.cache,
attribute;
if (!parser) {
parser = 'parse-english';
/* istanbul ignore if: Not all `require` providers support dynamic
* loading, needed for the next step, thus we skip the next
* branch early. */
if (require.client || require.component) {
parser = require('parse-english');
} else {
parser = 'parse-english';
}
}
if (typeof parser === 'string') {
var cache = require.cache, attribute;
/* istanbul ignore if: Node always has a `cache`. Other `require`
* vendors however don't support this feature. */
if (!cache) {
throw new TypeError(
'Illegal invocation: \'Retext\' in this environment ' +
'can\'t require from scratch'
);
} else {
for (attribute in cache) {
if (attribute.indexOf('/' + parser + '/') !== -1) {
delete cache[attribute];
}
}
for (attribute in cache) {
if (attribute.indexOf('/' + parser + '/') !== -1) {
delete cache[attribute];
}
parser = require(parser);
}
parser = require(parser);
}

@@ -66,0 +82,0 @@

{
"name": "retext",
"version": "0.0.4",
"version": "0.0.5",
"description": "Extensible system for analysing and manipulating natural language",

@@ -17,3 +17,3 @@ "keywords": [

"dependencies": {
"parse-english": "~0.0.9"
"parse-english": "~0.0.12"
},

@@ -20,0 +20,0 @@ "devDependencies": {

@@ -37,13 +37,16 @@

it('should create a new context/parser/textom when required, thus ' +
'not requiring from memory', function () {
var rootNode1 = new Retext().parse(),
rootNode2 = new Retext().parse();
/* istanbul ignore else: Node always has a `cache` property */
if (require.cache) {
it('should create a new context/parser/textom when required, thus ' +
'not requiring from memory', function () {
var rootNode1 = new Retext().parse(),
rootNode2 = new Retext().parse();
assert(rootNode1 instanceof rootNode1.constructor);
assert(!(rootNode1 instanceof rootNode2.constructor));
assert(rootNode2 instanceof rootNode2.constructor);
assert(!(rootNode2 instanceof rootNode1.constructor));
}
);
assert(rootNode1 instanceof rootNode1.constructor);
assert(!(rootNode1 instanceof rootNode2.constructor));
assert(rootNode2 instanceof rootNode2.constructor);
assert(!(rootNode2 instanceof rootNode1.constructor));
}
);
}

@@ -50,0 +53,0 @@ it('should set the `plugins` attribute to an empty array', function () {

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