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

commonform-alex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonform-alex

Critique Common Forms for insensitive language

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

commonform-alex

Critique contracts in Common Form for insensitive language using Alex.

var annotator = require('./index')
var assert = require('assert');

// Single tests

assert.deepEqual(
  annotator({ content: [ 'Hey bro!' ] }),
  [ { message: '\"bro\" may be insensitive',
        level: "info",
        path: [ 'content', 0 ],
        source: 'commonform-alex',
        url: null } ] )

assert.deepEqual(
  annotator({ content: [ 'What does she think?' ] }),
  [ { message: '\"she\" may be insensitive',
        level: "info",
        path: [ 'content', 0 ],
        source: 'commonform-alex',
        url: null } ] )

// Double test

assert.deepEqual(
  annotator({ content: [ 'What does she think about the bro?' ] }),
  [ { message: '\"she\" may be insensitive',
        level: "info",
        path: [ 'content', 0 ],
        source: 'commonform-alex',
        url: null },
    { message: '\"bro\" may be insensitive',
          level: "info",
          path: [ 'content', 0 ],
          source: 'commonform-alex',
          url: null } ] )

// Exclusion test

assert.deepEqual(
  annotator({ content: [ 'Talking about paternity is acceptable in family law cases, so we allow it.' ] }),
  [ ] )

// Many test

assert.deepEqual(
  annotator({ content: [ 'The boogeyman wrote all changes to the master server. Thus, the slaves were read-only copies of master. But not to worry, he was a cripple.' ] }),
  [ { message: '\"he\" may be insensitive',
        level: "info",
        path: [ 'content', 0 ],
        source: 'commonform-alex',
        url: null },
    { message: '\"boogeyman\" may be insensitive',
      level: "info",
      path: [ 'content', 0 ],
      source: 'commonform-alex',
      url: null },
    { message: '\"cripple\" may be insensitive',
      level: "info",
      path: [ 'content', 0 ],
      source: 'commonform-alex',
      url: null },
    { message: '\"master\" may be insensitive',
      level: "info",
      path: [ 'content', 0 ],
      source: 'commonform-alex',
      url: null },
    { message: '\"slaves\" may be insensitive',
      level: "info",
      path: [ 'content', 0 ],
      source: 'commonform-alex',
      url: null } ]);

Keywords

FAQs

Package last updated on 09 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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