Detalhes do pacote

jq-trim

royriojas22.7kMIT0.1.2

A trim method that behaves like jquery.trim

trim, jquery-trim, string trim

readme (leia-me)

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

changelog (log de mudanças)

jq-trim - Changelog

v0.1.2

v0.1.1

  • Build Scripts Changes
    • Update dependencies and build scripts - c6afc4d, royriojas, 30/07/2015 15:00:50

v0.1.0