Skip to content

Instantly share code, notes, and snippets.

@juampi92
juampi92 / Str.js
Created July 6, 2021 08:48 — forked from drozdzynski/Str.js
Laravel 5 slug function port to JavaScript
export default class Str {
static slug(value, sep) {
var separator = sep || '-';
value = Str.ascii(value);
var flip = separator == '-' ? '_' : '-';
value = value.replace(new RegExp(Str.pregQuote(flip), 'g'), separator);
@juampi92
juampi92 / .jshintrc
Last active August 29, 2015 14:06 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true