Socket
Socket
Sign inDemoInstall

pre-suf

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc