New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

commonform-regexp-annotator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonform-regexp-annotator - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

LICENSE.md

32

index.js

@@ -37,19 +37,19 @@ var predicate = require('commonform-predicate')

return annotations
.concat(rule(expressions, annotator, form, path))
.concat(
form.content.reduce(function (annotations, element, index) {
if (predicate.child(element)) {
var childForm = element.form
var childPath = path.concat(['content', index, 'form'])
return annotations.concat(
recurse(
expressions, annotator,
childForm, childPath, []
.concat(rule(expressions, annotator, form, path))
.concat(
form.content.reduce(function (annotations, element, index) {
if (predicate.child(element)) {
var childForm = element.form
var childPath = path.concat(['content', index, 'form'])
return annotations.concat(
recurse(
expressions, annotator,
childForm, childPath, []
)
)
)
} else {
return annotations
}
}, [])
)
} else {
return annotations
}
}, [])
)
}
{
"name": "commonform-regexp-annotator",
"description": "create Common Form annotators from lists of regular expressions",
"version": "1.1.1",
"version": "2.0.0",
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (http://kemitchell.com)",
"devDependencies": {
"defence-cli": "1.x",
"defence-cli": "^3.0.1",
"replace-require-self": "1.x",
"standard": "^8.0.0"
"standard": "^12.0.1",
"standard-markdown": "^5.0.1"
},

@@ -21,11 +22,11 @@ "keywords": [

],
"license": "Apache-2.0",
"license": "BlueOak-1.0.0",
"repository": "commonform/commonform-regexp-annotator",
"scripts": {
"test": "defence README.md | replace-require-self | node",
"lint": "standard"
"lint": "standard && standard-markdown"
},
"dependencies": {
"commonform-predicate": "^0.4.0"
"commonform-predicate": "^3.0.1"
}
}

@@ -0,1 +1,3 @@

# commonform-regexp-annotator
The module exports a single function that takes an array of `RegExp`

@@ -23,3 +25,3 @@ and a function for generating annotations and returns an annotator

```javascript
function message(form, path, expression, match) {
function message (form, path, expression, match) {
var word = match[1]

@@ -29,4 +31,4 @@ return {

match[1].indexOf('apple') > -1
? ('"' + word + '" is fruity')
: ('"' + word + '" is archaic')
? ('"' + word + '" is fruity')
: ('"' + word + '" is archaic')
),

@@ -49,3 +51,3 @@ path: path,

assert.deepEqual(
assert.deepStrictEqual(
annotator({

@@ -52,0 +54,0 @@ content: ['Drop them apples and the apple stem thereof!']

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