Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* 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.mode = 'rfc3986-non-unicode'
/**
* Slugify 文本
* @param textToSlugify 待 slugify 的文本
regionCode?: string;
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);
var cli = require("./3scale-cli");
var config = require("./config");
var parrser = require("swagger-parser");
var SwaggerParser = require('swagger-parser');
var Q = require("q");
Q.longStackSupport = true;
const delayed = require('delay-promise');
var inquirer = require("inquirer");
var slug = require("slug");
slug.charmap['{'] = '_'
slug.charmap['}'] = '_'
slug.charmap['\/'] = '_SLASH_'
var services = require("./services");
var appplan = require("./application_plans");
var metrics = require("./metrics");
var methods = require("./methods");
var maprules = require("./mappingrules");
var HIT_METRIC_ID ="";
var METHODS = []
var ALLOWED_METHODS = [
"GET","POST","PUT","OPTIONS","PATCH","HEAD","DELETE"
]
var parser = require("raml-1-parser");
var cli = require("./3scale-cli");
var config = require("./config");
var Q = require("q");
var slug = require("slug");
var _ = require("underscore");
var slug = require("slug");
slug.charmap['{'] = '_'
slug.charmap['}'] = '_'
slug.charmap['\/'] = '_SLASH_'
var services = require("./services");
var appplan = require("./application_plans");
var metrics = require("./metrics");
var methods = require("./methods");
var METHOD_ARR=[]
var RESOURCESTYPES={}
var api
exports.import = function(path, service_id, appplan_name,method_pattern){
api = parser.loadApiSync(path);
var title = api.title()+Math.floor((Math.random() * 50) + 10);
cli.print({message: "Loading "+title+ " raml definition."});
var parser = require("raml-1-parser");
var cli = require("./3scale-cli");
var config = require("./config");
var Q = require("q");
var slug = require("slug");
var _ = require("underscore");
var slug = require("slug");
slug.charmap['{'] = '_'
slug.charmap['}'] = '_'
slug.charmap['\/'] = '_SLASH_'
var services = require("./services");
var appplan = require("./application_plans");
var metrics = require("./metrics");
var methods = require("./methods");
var METHOD_ARR=[]
var RESOURCESTYPES={}
var api
exports.import = function(path, service_id, appplan_name,method_pattern){
api = parser.loadApiSync(path);
var title = api.title()+Math.floor((Math.random() * 50) + 10);
var parser = require("raml-1-parser");
var cli = require("./3scale-cli");
var config = require("./config");
var Q = require("q");
var slug = require("slug");
var _ = require("underscore");
var slug = require("slug");
slug.charmap['{'] = '_'
slug.charmap['}'] = '_'
slug.charmap['\/'] = '_SLASH_'
var services = require("./services");
var appplan = require("./application_plans");
var metrics = require("./metrics");
var methods = require("./methods");
var METHOD_ARR=[]
var RESOURCESTYPES={}
var api
exports.import = function(path, service_id, appplan_name,method_pattern){
api = parser.loadApiSync(path);
var title = api.title()+Math.floor((Math.random() * 50) + 10);
cli.print({message: "Loading "+title+ " raml definition."});
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) {
var parser = require("raml-1-parser");
var cli = require("./3scale-cli");
var config = require("./config");
var Q = require("q");
var slug = require("slug");
var _ = require("underscore");
var slug = require("slug");
slug.charmap['{'] = '_'
slug.charmap['}'] = '_'
slug.charmap['\/'] = '_SLASH_'
var services = require("./services");
var appplan = require("./application_plans");
var metrics = require("./metrics");
var methods = require("./methods");
var METHOD_ARR=[]
var RESOURCESTYPES={}
var api
exports.import = function(path, service_id, appplan_name,method_pattern){
api = parser.loadApiSync(path);
var title = api.title()+Math.floor((Math.random() * 50) + 10);
cli.print({message: "Loading "+title+ " raml definition."});
require('jquery');
global.$ = global.jQuery = $;
require('bootstrap');
require('select2');
import { saveAs } from 'file-saver';
var slug = require('slug');
slug.charmap['/'] = '-';
slug.charmap['?'] = '-';
slug.charmap['='] = '-';
global.slug = slug;
global.sleep = function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
global.createToast = function createToast(body) {
var toast = `<div aria-atomic="true" aria-live="assertive" role="alert" class="toast bg-dark text-light border border-secondary">
<div class="toast-body">
${body}
</div>
</div>`;
$('#toast-container').prepend(toast);
var toastObject = $('#toast-container .toast').first();
require('jquery');
global.$ = global.jQuery = $;
require('bootstrap');
require('select2');
import { saveAs } from 'file-saver';
var slug = require('slug');
slug.charmap['/'] = '-';
slug.charmap['?'] = '-';
slug.charmap['='] = '-';
global.slug = slug;
global.sleep = function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
global.createToast = function createToast(body) {
var toast = `<div aria-atomic="true" aria-live="assertive" role="alert" class="toast bg-dark text-light border border-secondary">
<div class="toast-body">
${body}
</div>
</div>`;
$('#toast-container').prepend(toast);
var toastObject = $('#toast-container .toast').first();
toastObject.toast({'autohide': true, 'delay': 5000});