@contentstack/cli-cm-import 1.14.2 → 1.14.3

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/README.md CHANGED
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
47
47
  $ csdx COMMAND
48
48
  running command...
49
49
  $ csdx (--version)
50
- @contentstack/cli-cm-import/1.14.2 linux-x64 node-v18.19.1
50
+ @contentstack/cli-cm-import/1.14.3 linux-x64 node-v18.19.1
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -11,6 +11,7 @@ let _ = require('lodash');
11
11
  let { marked } = require('marked');
12
12
  let helper = require('./file-helper');
13
13
  const MAX_RETRY_LIMIT = 5;
14
+ const escapeRegExp = (str) => str.replace(/[*+?^${}()|[\]\\]/g, '\\$&');
14
15
  function validate(req) {
15
16
  if (typeof req !== 'object') {
16
17
  throw new Error(`Invalid params passed for request\n${JSON.stringify(arguments)}`);
@@ -234,8 +235,8 @@ const lookupAssets = function (data, mappedAssetUids, mappedAssetUrls, assetUidM
234
235
  assetUrls.forEach(function (assetUrl) {
235
236
  let mappedAssetUrl = mappedAssetUrls[assetUrl];
236
237
  if (typeof mappedAssetUrl !== 'undefined') {
237
- const sanitizedUrl = (0, cli_utilities_1.escapeRegExp)(assetUrl);
238
- const escapedMappedUrl = (0, cli_utilities_1.escapeRegExp)(mappedAssetUrl);
238
+ const sanitizedUrl = escapeRegExp(assetUrl).replace(/\.\./g, '\\$&');
239
+ const escapedMappedUrl = escapeRegExp(mappedAssetUrl).replace(/\.\./g, '\\$&');
239
240
  entry = entry.replace(new RegExp(sanitizedUrl, 'img'), escapedMappedUrl);
240
241
  matchedUrls.push(mappedAssetUrl);
241
242
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.14.2",
2
+ "version": "1.14.3",
3
3
  "commands": {
4
4
  "cm:stacks:import": {
5
5
  "id": "cm:stacks:import",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "1.14.2",
4
+ "version": "1.14.3",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {