gg-express 1.0.74 → 1.0.75

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.
package/dist/GGExpress.js CHANGED
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const chalk_1 = __importDefault(require("chalk"));
16
16
  const fs_1 = __importDefault(require("fs"));
17
17
  const path_1 = __importDefault(require("path"));
18
+ const helperFunction_1 = require("./helperFunction");
18
19
  const myExpressRouteList = [];
19
20
  class GGExpress {
20
21
  constructor(app, appName, outputPath) {
@@ -157,6 +158,7 @@ class GGExpress {
157
158
  else {
158
159
  tempURL = [row.url];
159
160
  }
161
+ tempURL = (0, helperFunction_1.removeDuplicates)(tempURL);
160
162
  return tempURL
161
163
  .map((url) => {
162
164
  return ` "${url}" : {
@@ -0,0 +1 @@
1
+ export declare function removeDuplicates(arr: string[]): string[];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeDuplicates = removeDuplicates;
4
+ function removeDuplicates(arr) {
5
+ return [...new Set(arr)];
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-express",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "",
5
5
  "main": "dist/GGExpress.js",
6
6
  "scripts": {
package/src/GGExpress.ts CHANGED
@@ -3,6 +3,7 @@ import { NextFunction, Request, Response } from "express"
3
3
  import Express from "express-serve-static-core"
4
4
  import fs from "fs"
5
5
  import path from "path"
6
+ import { removeDuplicates } from "./helperFunction"
6
7
 
7
8
  type Unarray<T> = T extends (infer U)[] ? U : T
8
9
  type AsConstArray<T extends readonly any[]> = [...T]
@@ -395,6 +396,7 @@ export default class GGExpress<appName extends string> {
395
396
  } else {
396
397
  tempURL = [row.url]
397
398
  }
399
+ tempURL = removeDuplicates(tempURL)
398
400
  return tempURL
399
401
  .map((url) => {
400
402
  return ` "${url}" : {
@@ -0,0 +1,3 @@
1
+ export function removeDuplicates(arr: string[]): string[] {
2
+ return [...new Set(arr)];
3
+ }