Miss any of our Open RFC calls?Watch the recordings here! »

@pelevesque/is-offset

0.0.8 • Public • Published

Build Status Coverage Status JavaScript Style Guide

is-offset

Checks if a string is the offset of another.

Node Repository

https://www.npmjs.com/package/@pelevesque/is-offset

Installation

npm install @pelevesque/is-offset

Tests

Command Description
npm test or npm run test All Tests Below
npm run cover Standard Style
npm run standard Coverage
npm run unit Unit Tests

Usage

Parameters

str1 (required)  
str2 (required)   
step (optional) default = 1

Examples

const isOffset = require('@pelevesque/is-offset')
const str1 = 'abcd'
const str2 = 'efgh'
const result = isOffset(str1, str2)
// result === false
const str1 = 'abcd'
const str2 = 'bcda'
const result = isOffset(str1, str2)
// result === true
const str1 = '111222333444'
const str2 = '333444111222'
const step = 3
const result = isOffset(str1, str2, step)
// result === true

Install

npm i @pelevesque/is-offset

DownloadsWeekly Downloads

7

Version

0.0.8

License

MIT

Unpacked Size

7.28 kB

Total Files

6

Last publish

Collaborators

  • avatar