@churchapps/apihelper 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SlugHelper = void 0;
|
|
7
|
-
const
|
|
4
|
+
const slug = require("slug");
|
|
8
5
|
class SlugHelper {
|
|
9
6
|
static slugifyString(string, type, removeCharacters) {
|
|
10
7
|
const charactersToRemove = removeCharacters ? removeCharacters : ["for", "and", "nor", "but", "or", "yet", "so", "the", "a", "an"];
|
|
11
8
|
const characStr = charactersToRemove.join("|");
|
|
12
9
|
if (type === "urlPath") {
|
|
13
|
-
|
|
10
|
+
slug.extend({ '/': '/' }); //To keep '/' in the url since it's a special character.
|
|
14
11
|
}
|
|
15
|
-
const initialSlug = (
|
|
12
|
+
const initialSlug = slug(string, { remove: new RegExp('\\b(' + characStr + ')\\b', 'gi') });
|
|
16
13
|
const verfiedSlug = this.numerifySlug(initialSlug);
|
|
17
14
|
return verfiedSlug;
|
|
18
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlugHelper.js","sourceRoot":"","sources":["../../src/helpers/SlugHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlugHelper.js","sourceRoot":"","sources":["../../src/helpers/SlugHelper.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,MAAa,UAAU;IAErB,MAAM,CAAC,aAAa,CAAC,MAAc,EAAE,IAA2B,EAAE,gBAA2B;QAC3F,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC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