Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
slug: string;
}
/**
* Helper class for retrieving locations by id or name
*/
export namespace LocationHelper {
const locationById: Map = new Map();
const locationBySlug: Map = new Map();
const slugOptions: {} = {
replacement: '-', // replace spaces with replacement
symbols: true, // replace unicode symbols or not
remove: /[.]/g, // (optional) regex to remove characters
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
// Add icon urls for all locations
const cdnUrl: string = 'https://raw.githubusercontent.com/weeco/clash-royale-assets/master/images';
// Load location object array into Map
countriesJson.forEach((location: IApiLocation) => {
const locationDetailed: ILocationDetails = {
...location,
iconUrls: {
large: `${cdnUrl}/clash-royale/locations/${location.countryCode}.png`
},
slug: slug(location.name, slugOptions)
};
locationById.set(location.id, locationDetailed);
locationBySlug.set(locationDetailed.slug, locationDetailed);
*/
slug.defaults.modes['rfc3986-non-unicode'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
remove: /[.]/g, // (optional) regex to remove characters
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap, // replace multi-characters
}
slug.defaults.modes['rfc3986-non-unicode-with-dots'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap, // replace multi-characters
}
slug.defaults.modes['rfc3986-non-unicode-with-dots-no-lower'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: false, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap, // replace multi-characters
}
slug.defaults.mode = 'rfc3986-non-unicode'
/**
* Slugify 文本
* @param textToSlugify 待 slugify 的文本
* @param filenameMode
const transliterate = require('transliteration').transliterate;
const slug = require('slug');
/*
* Custom mode of rfc3986 without unicode symbols
*/
slug.defaults.modes['rfc3986-non-unicode'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
remove: /[.]/g, // (optional) regex to remove characters
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
slug.defaults.modes['rfc3986-non-unicode-with-dots'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
slug.defaults.modes['rfc3986-non-unicode-with-dots-no-lower'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: false, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
/* tslint:disable */
const { transliterate } = require('transliteration')
const slug = require('slug')
/*
* Custom mode of rfc3986 without unicode symbols
*/
slug.defaults.modes['rfc3986-non-unicode'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
remove: /[.]/g, // (optional) regex to remove characters
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap, // replace multi-characters
}
slug.defaults.modes['rfc3986-non-unicode-with-dots'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap, // replace multi-characters
}
slug.defaults.modes['rfc3986-non-unicode-with-dots-no-lower'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: false, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap, // replace multi-characters
*/
slug.defaults.modes['rfc3986-non-unicode'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
remove: /[.]/g, // (optional) regex to remove characters
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
slug.defaults.modes['rfc3986-non-unicode-with-dots'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: true, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
slug.defaults.modes['rfc3986-non-unicode-with-dots-no-lower'] = {
replacement: '-', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: false, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
slug.defaults.mode = 'rfc3986-non-unicode';
function createSlug(textToSlugify, filenameMode = false, saveLowerChars = false) {
textToSlugify = transliterate(textToSlugify);
if(!filenameMode) {
import jDataView from 'jdataview';
import { sprintf } from 'sprintf';
import { CMC7Parser } from './cmc7-parser';
import async from 'async';
import { CPF } from 'cpf_cnpj';
import { CNPJ } from 'cpf_cnpj';
import slug from 'slug';
slug.defaults.modes.pretty = {
replacement: ' ', // replace spaces with replacement
symbols: false, // replace unicode symbols or not
lower: false, // result in lower case
charmap: slug.charmap, // replace special characters
multicharmap: slug.multicharmap // replace multi-characters
};
slug.defaults.mode ='pretty';
const NON_NUMERIC = /[\D]/g;
const NON_WORD = /[\W]/g;
const ROW_SIZE = 502;
const BAN_VERSION = '02.7';
const MAX_THREADS = 2;
const CRLF = '\r\n';
export class BANFactory {
constructor(call, {values}, company) {
this.call = call;
this.checks = values;
this.company = company;
*/
'use strict';
const siteData = require('../site.js');
const util = require('util');
const debug = require('debug');
const defaultsDeep = require('lodash.defaultsdeep');
const slug = require('slug');
slug.defaults.modes['dkoslug'] = {
replacement: '-',
symbols: true,
remove: /[.]/g,
lower: true,
charmap: slug.charmap,
multicharmap: slug.multicharmap,
};
slug.defaults.mode = 'dkoslug';
/**
* Default widgets for each file type
* @constant
* @type {Object}
*/
const DEFAULT_WIDGETS = {
page: {
aboutMe: true,
allPosts: true,
},
post: {
sharePost: true,
function slugify(string) {
return slug(string, {
replacement: '-',
symbols: true,
lower: true,
charmap: slug.charmap,
multicharmap: slug.multicharmap
});
}
var config = require('../config')
var mongoose = require('mongoose')
var slug = require('slug')
var util = require('../util')
var validate = require('mongoose-validator')
slug.defaults.mode = 'studynotes'
slug.defaults.modes.studynotes = {
replacement: '-',
symbols: true,
remove: /[.]/g,
lower: true,
charmap: slug.charmap,
multicharmap: slug.multicharmap
}
/**
* Mongoose plugins
*/
exports.modifyDate = function (schema, opts) {
schema.add({ modifyDate: Date })
schema.pre('save', function (next) {
this.modifyDate = new Date()
next()
})
if (opts && opts.index) {
schema.path('modifyDate').index(opts.index)