0.1.4 • Published 10 years ago

piggy-sanitize-uri v0.1.4

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

piggy-sanitize-uri NPM version Build Status

Purpose

Basic lib to sanitize uri with options.

Usage

import sanitizeUri from 'piggy-sanitize-uri'

let uri = '/my/path/?arg=value';
let sanitizedUri = sanitizeUri(uri);

With options:

import sanitizeUri from 'piggy-sanitize-uri'

let uri = '/my/path/?arg=value';
let options = {
  simpleChars: true,
  lowercase: true,
  endingslash: true,
  doubleshash: true
};
let sanitizedUri = sanitizeUri(uri);

Options

All options are simple boolean values to enable/disable the feature

  • simpleChars: keep only alnum, "-" and "/" chars in the path
  • lowercase: lowercase all the chars
  • endingslash: force an ending slash
  • doubleshash: remove double slash

Developer

Installing dev dependencies, you can edit the package source. Then run:

  • npm run dev-compile for babel transpilation
  • npm run dev-check for jshint check
0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago