drapcode-utility 1.7.5 → 1.7.7

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.
@@ -167,7 +167,7 @@ var queryParser = function (collectionName, query, constants, externalParams, cu
167
167
  }
168
168
  console.log("==> aggregateQuery", aggregateQuery);
169
169
  console.log("==> aggregateQuery", JSON.stringify(aggregateQuery));
170
- queryStr = ".aggregate(".concat(JSON.stringify(aggregateQuery), ", { collation: { locale: \"en\" } })");
170
+ queryStr = ".aggregate(".concat(JSON.stringify(aggregateQuery), ", { collation: { locale: \"en\" }, allowDiskUse: true })");
171
171
  str = "req.db.collection('".concat(collectionName, "')").concat(queryStr);
172
172
  str += ".toArray()";
173
173
  return [2 /*return*/, str];
@@ -256,7 +256,7 @@ var queryParserNew = function (collectionName, query, constants, externalParams,
256
256
  if (finder != "COUNT" && limit) {
257
257
  aggregateQuery.push({ $skip: +offset }, { $limit: +limit });
258
258
  }
259
- queryStr = ".aggregate(".concat(JSON.stringify(aggregateQuery), ", { collation: { locale: \"en\" } })");
259
+ queryStr = ".aggregate(".concat(JSON.stringify(aggregateQuery), ", { collation: { locale: \"en\" }, allowDiskUse: true })");
260
260
  str = "req.db.collection('".concat(collectionName, "')").concat(queryStr);
261
261
  str += ".toArray()";
262
262
  return [2 /*return*/, str];
@@ -35,3 +35,5 @@ export declare const validateData: (fields: any, data: any) => {
35
35
  };
36
36
  export declare const validateUrl: (url: any) => boolean;
37
37
  export declare const toggleConsoleLogs: (enable: boolean) => void;
38
+ export declare const replaceSlashWithUnderscore: (value: string) => string;
39
+ export declare const replaceUnderscoreWithSlash: (value: string) => string;
@@ -34,7 +34,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
34
34
  return (mod && mod.__esModule) ? mod : { "default": mod };
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.toggleConsoleLogs = exports.validateUrl = exports.validateData = exports.fillDefaultValues = exports.replaceValueFromSource = exports.processFieldsInlcude = exports.removeMongoDbId = exports.replaceTransferObjectValueIntoExpression = exports.unflattenObject = exports.parseValueFromData = exports.parseJsonString = exports.replaceDataValueIntoExpression = exports.formatCustomCSSClasses = exports.validateAlphanumericString = exports.convertItemToArray = exports.arraysEqual = exports.checkAndCompareValue = exports.restructureData = exports.formatCollectionAndFieldName = exports.cleanCollectionAndFieldName = exports.stringToExpression = exports.expressionToString = exports.getSpecialCharectorReplacedExpression = exports.validateUuidString = exports.validateEmail = exports.snakeCaseToTitleCase = exports.dynamicSort = exports.checkValidArray = exports.isObject = exports.isEmptyObject = exports.isEmpty = exports.clearSpaceAndReformat = exports.camelize = exports.validateString = void 0;
37
+ exports.replaceUnderscoreWithSlash = exports.replaceSlashWithUnderscore = exports.toggleConsoleLogs = exports.validateUrl = exports.validateData = exports.fillDefaultValues = exports.replaceValueFromSource = exports.processFieldsInlcude = exports.removeMongoDbId = exports.replaceTransferObjectValueIntoExpression = exports.unflattenObject = exports.parseValueFromData = exports.parseJsonString = exports.replaceDataValueIntoExpression = exports.formatCustomCSSClasses = exports.validateAlphanumericString = exports.convertItemToArray = exports.arraysEqual = exports.checkAndCompareValue = exports.restructureData = exports.formatCollectionAndFieldName = exports.cleanCollectionAndFieldName = exports.stringToExpression = exports.expressionToString = exports.getSpecialCharectorReplacedExpression = exports.validateUuidString = exports.validateEmail = exports.snakeCaseToTitleCase = exports.dynamicSort = exports.checkValidArray = exports.isObject = exports.isEmptyObject = exports.isEmpty = exports.clearSpaceAndReformat = exports.camelize = exports.validateString = void 0;
38
38
  var drapcode_constant_1 = require("drapcode-constant");
39
39
  var lodash_1 = __importDefault(require("lodash"));
40
40
  var format_fields_1 = require("../format-fields");
@@ -781,3 +781,13 @@ var toggleConsoleLogs = function (enable) {
781
781
  }
782
782
  };
783
783
  exports.toggleConsoleLogs = toggleConsoleLogs;
784
+ // Utility function to replace '/' with '____'
785
+ var replaceSlashWithUnderscore = function (value) {
786
+ return value && value.replace(/\//g, '____');
787
+ };
788
+ exports.replaceSlashWithUnderscore = replaceSlashWithUnderscore;
789
+ // Utility function to replace '____' with '/'
790
+ var replaceUnderscoreWithSlash = function (value) {
791
+ return value && value.replace(/____/g, '/');
792
+ };
793
+ exports.replaceUnderscoreWithSlash = replaceUnderscoreWithSlash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drapcode-utility",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",