@cloud-ru/ft-gulp-icon-builder 1.0.1-preview-75baae3.0 → 1.0.1-preview-9dae167.0

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.
@@ -22,9 +22,10 @@ const capitalizeFirstLetter = (str) => {
22
22
  return str;
23
23
  return str.charAt(0).toUpperCase() + str.slice(1);
24
24
  };
25
+ const removeLeadingSlash = (str) => str.replace(/^\/+/, '');
25
26
  function gulpSvgIndexFile({ src, dest }) {
26
27
  const folders = {};
27
- const getTail = (fullPath) => fullPath.replace(`${node_path_1.default.resolve(process.cwd(), src)}/`, '');
28
+ const getTail = (fullPath) => removeLeadingSlash(fullPath.replace(node_path_1.default.resolve(process.cwd(), src), ''));
28
29
  return (0, createPipeTransformer_1.createPipeTransformer)({
29
30
  transformer: (file, _encoding, callback) => {
30
31
  const folder = file.dirname;
@@ -16,9 +16,10 @@ const capitalizeFirstLetter = (str) => {
16
16
  return str;
17
17
  return str.charAt(0).toUpperCase() + str.slice(1);
18
18
  };
19
+ const removeLeadingSlash = (str) => str.replace(/^\/+/, '');
19
20
  export function gulpSvgIndexFile({ src, dest }) {
20
21
  const folders = {};
21
- const getTail = (fullPath) => fullPath.replace(`${path.resolve(process.cwd(), src)}/`, '');
22
+ const getTail = (fullPath) => removeLeadingSlash(fullPath.replace(path.resolve(process.cwd(), src), ''));
22
23
  return createPipeTransformer({
23
24
  transformer: (file, _encoding, callback) => {
24
25
  const folder = file.dirname;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-ru/ft-gulp-icon-builder",
3
- "version": "1.0.1-preview-75baae3.0",
3
+ "version": "1.0.1-preview-9dae167.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  ""
@@ -46,5 +46,5 @@
46
46
  "@types/vinyl": "2.0.12",
47
47
  "gulp-cli": "3.1.0"
48
48
  },
49
- "gitHead": "764090cf8a5275c0b7821ad936635f698b3d60a0"
49
+ "gitHead": "d9a5d712461f1d0375f1cda6fcfbaaf2c06a44c0"
50
50
  }
@@ -14,10 +14,12 @@ const capitalizeFirstLetter = (str: string): string => {
14
14
  return str.charAt(0).toUpperCase() + str.slice(1);
15
15
  };
16
16
 
17
+ const removeLeadingSlash = (str: string): string => str.replace(/^\/+/, '');
18
+
17
19
  export function gulpSvgIndexFile({ src, dest }: Params) {
18
20
  const folders: Record<string, string[]> = {};
19
21
 
20
- const getTail = (fullPath: string) => fullPath.replace(`${path.resolve(process.cwd(), src)}/`, '');
22
+ const getTail = (fullPath: string) => removeLeadingSlash(fullPath.replace(path.resolve(process.cwd(), src), ''));
21
23
 
22
24
  return createPipeTransformer({
23
25
  transformer: (file, _encoding, callback) => {