stringx

0.0.1 • Public • Published

stringx

Yet another string utility dealing with startsWith, endsWith and etc.

Installation

npm install stringx

Usage

var stringx = require('./stringx');
 
describe('stringx Suite', function () {
    beforeEach(function () {
    });
    afterEach(function () {
    });
 
    it('should work: startsWith', function () {
        expect(stringx.startsWith('abcdefg', 'a')).toBeTruthy();
        expect(stringx.startsWith('abcdefg', 'ab')).toBeTruthy();
        expect(stringx.startsWith('abcdefg', '')).toBeTruthy();
        expect(stringx.startsWith('abcdefg', 'x')).toBeFalsy();
        expect(stringx.startsWith('abcdefg', 'g')).toBeFalsy();
    });
    it('should work: endsWith', function () {
        expect(stringx.endsWith('abcdefg', 'g')).toBeTruthy();
        expect(stringx.endsWith('abcdefg', 'fg')).toBeTruthy();
        expect(stringx.endsWith('abcdefg', '')).toBeTruthy();
        expect(stringx.endsWith('abcdefg', 'x')).toBeFalsy();
        expect(stringx.endsWith('abcdefg', 'a')).toBeFalsy();
    });
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i stringx

      Weekly Downloads

      2

      Version

      0.0.1

      License

      ISC

      Last publish

      Collaborators

      • elgs