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

jq-trim

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

jq-trim

A trim method that behaves like jquery.trim

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.1K
decreased by-0.91%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version Build Status

jq-trim

A trim method that behaves like jquery.trim

Install

npm i --save jq-trim

Usage

var trim = require('jq-trim');

describe( 'jq-trim', function () {
  it( 'should trim a string', function () {
    var trim = require( '../' );
    var val = trim( ' a simple string    ' );
    expect( val ).to.equal( 'a simple string' );
  } );
  it( 'should return an empty string if null is passed', function () {
    var trim = require( '../' );
    var val = trim( null );
    expect( val ).to.equal( '' );
  } );
  it( 'should return an empty string if undefined is passed', function () {
    var trim = require( '../' );
    var val = trim( undefined );
    expect( val ).to.equal( '' );
  } );
  it( 'should return the toString() of the passed object if non a string', function () {
    var trim = require( '../' );
    var val = trim( { } );
    expect( val ).to.equal( '[object Object]' );
  } );
} );

License

MIT

Changelog

Changelog

Keywords

FAQs

Package last updated on 25 Aug 2015

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