pre-suf
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "pre-suf", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Manipulate strings with prefixes and suffixes.", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -28,3 +28,3 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-pre-suf.svg?branch=master)](https://travis-ci.org/kaelzhang/node-pre-suf) | ||
```js | ||
let presuf = require('pre-suf') | ||
const presuf = require('pre-suf') | ||
@@ -39,2 +39,4 @@ presuf.ensureLeading('path/to', '/') // '/path/to' | ||
If `str` does not begin with `prefix`, `prefix` will be added to the beggining of `str`. | ||
### presuf.removeLeading(str, prefix) | ||
@@ -44,2 +46,7 @@ | ||
```js | ||
presuf.removeLeading('/abc', '/a') // 'bc' | ||
presuf.removeLeading('/a/abc', '/a') // 'bc'. removes 2 groups of '/a' | ||
``` | ||
### presuf.ensureEnding(str, suffix) | ||
@@ -46,0 +53,0 @@ |
8155
56