@qrvey/utils 1.2.9-36 → 1.2.9-37

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
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-36*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-37*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -2722,50 +2722,47 @@ Gets the format config
2722
2722
 
2723
2723
 
2724
2724
 
2725
- ### dist/services/api/getAllDatasets.api.js
2726
-
2725
+ ### dist/stencil/decorators/Config.js
2727
2726
 
2728
- #### getAllDatasets(config, pickDatasets)
2729
2727
 
2730
- Get a dataset list from a collection of Qrvey IDs
2728
+ #### Config()
2731
2729
 
2730
+ Stencil.js - Prop Decorator
2731
+ Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
2732
+ But for this, is required ask for a property in `snake_case` style
2732
2733
 
2733
2734
 
2734
2735
 
2735
- ##### Parameters
2736
2736
 
2737
- | Name | Type | Description | |
2738
- | ---- | ---- | ----------- | -------- |
2739
- | config | | the widget config. Includes the appid and others configuration properties |   |
2740
- | pickDatasets | | Collection of Qrvey IDs for filtering the request |   |
2741
2737
 
2742
2738
 
2739
+ ##### Examples
2743
2740
 
2741
+ ```javascript
2742
+ \ @Config() @Prop() settings;
2744
2743
 
2745
- ##### Returns
2744
+ someMethod() {
2745
+ this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
2746
+ }
2747
+ ```
2746
2748
 
2747
2749
 
2748
- - a promise
2750
+ ##### Returns
2749
2751
 
2750
2752
 
2753
+ - `Void`
2751
2754
 
2752
2755
 
2753
- ### dist/services/api/getAllQrveys.api.js
2754
2756
 
2755
2757
 
2756
- #### getAllQrveys(config, params)
2758
+ ### dist/stencil/util/createRef.js
2757
2759
 
2758
- POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
2759
2760
 
2761
+ #### createRef()
2760
2762
 
2763
+ lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
2761
2764
 
2762
2765
 
2763
- ##### Parameters
2764
-
2765
- | Name | Type | Description | |
2766
- | ---- | ---- | ----------- | -------- |
2767
- | config | | Configuration |   |
2768
- | params | | Object for getting precise data |   |
2769
2766
 
2770
2767
 
2771
2768
 
@@ -2773,17 +2770,21 @@ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for g
2773
2770
  ##### Returns
2774
2771
 
2775
2772
 
2776
- - `Void`
2773
+ - function - Function to use in ref prop in html elements
2777
2774
 
2778
2775
 
2779
2776
 
2780
2777
 
2781
- ### dist/services/api/getDatasetColumns.api.js
2778
+ ### dist/stencil/util/getConfig.js
2782
2779
 
2783
2780
 
2784
- #### getDatasetColumns(qrveyid)
2781
+ #### getConfig(cfg)
2785
2782
 
2786
- Get a dataset by Qrvey ID
2783
+ verify the Config object type and try to return a parsed Object
2784
+ - In case _cfg_ is a string, first try to make a JSON parse in other case
2785
+ try to find this string as a variable on Windows object
2786
+ - If _cfg_ is a fuction, tis is invoked and parsed
2787
+ - Finally, if is an object, _cfg_ is inmediatly returned
2787
2788
 
2788
2789
 
2789
2790
 
@@ -2792,7 +2793,7 @@ Get a dataset by Qrvey ID
2792
2793
 
2793
2794
  | Name | Type | Description | |
2794
2795
  | ---- | ---- | ----------- | -------- |
2795
- | qrveyid | | The Qrvey ID |   |
2796
+ | cfg | | |   |
2796
2797
 
2797
2798
 
2798
2799
 
@@ -2800,74 +2801,73 @@ Get a dataset by Qrvey ID
2800
2801
  ##### Returns
2801
2802
 
2802
2803
 
2803
- - a promise
2804
-
2804
+ - `Void`
2805
2805
 
2806
2806
 
2807
2807
 
2808
- ### dist/stencil/decorators/Config.js
2809
2808
 
2809
+ ### dist/services/api/getAllDatasets.api.js
2810
2810
 
2811
- #### Config()
2812
2811
 
2813
- Stencil.js - Prop Decorator
2814
- Get and Parse the Widget Configuration Object and also provide the ability to get properties in different case styles such as: lower, upper, camel and pascal
2815
- But for this, is required ask for a property in `snake_case` style
2812
+ #### getAllDatasets(config, pickDatasets)
2816
2813
 
2814
+ Get a dataset list from a collection of Qrvey IDs
2817
2815
 
2818
2816
 
2819
2817
 
2820
2818
 
2819
+ ##### Parameters
2821
2820
 
2822
- ##### Examples
2821
+ | Name | Type | Description | |
2822
+ | ---- | ---- | ----------- | -------- |
2823
+ | config | | the widget config. Includes the appid and others configuration properties |   |
2824
+ | pickDatasets | | Collection of Qrvey IDs for filtering the request |   |
2823
2825
 
2824
- ```javascript
2825
- \ @Config() @Prop() settings;
2826
2826
 
2827
- someMethod() {
2828
- this.settings.snake_case //it search for: obj.snake_case || obj.snakeCase || obj.SnakeCase || obj.snakecase || obj.SNAKECASE
2829
- }
2830
- ```
2831
2827
 
2832
2828
 
2833
2829
  ##### Returns
2834
2830
 
2835
2831
 
2836
- - `Void`
2832
+ - a promise
2837
2833
 
2838
2834
 
2839
2835
 
2840
2836
 
2841
- ### dist/stencil/util/createRef.js
2837
+ ### dist/services/api/getAllQrveys.api.js
2842
2838
 
2843
2839
 
2844
- #### createRef()
2840
+ #### getAllQrveys(config, params)
2845
2841
 
2846
- lit implementation of React createRef (https://reactjs.org/docs/refs-and-the-dom.html)
2842
+ POST Request for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
2847
2843
 
2848
2844
 
2849
2845
 
2850
2846
 
2847
+ ##### Parameters
2848
+
2849
+ | Name | Type | Description | |
2850
+ | ---- | ---- | ----------- | -------- |
2851
+ | config | | Configuration |   |
2852
+ | params | | Object for getting precise data |   |
2853
+
2854
+
2851
2855
 
2852
2856
 
2853
2857
  ##### Returns
2854
2858
 
2855
2859
 
2856
- - function - Function to use in ref prop in html elements
2860
+ - `Void`
2857
2861
 
2858
2862
 
2859
2863
 
2860
2864
 
2861
- ### dist/stencil/util/getConfig.js
2865
+ ### dist/services/api/getDatasetColumns.api.js
2862
2866
 
2863
2867
 
2864
- #### getConfig(cfg)
2868
+ #### getDatasetColumns(qrveyid)
2865
2869
 
2866
- verify the Config object type and try to return a parsed Object
2867
- - In case _cfg_ is a string, first try to make a JSON parse in other case
2868
- try to find this string as a variable on Windows object
2869
- - If _cfg_ is a fuction, tis is invoked and parsed
2870
- - Finally, if is an object, _cfg_ is inmediatly returned
2870
+ Get a dataset by Qrvey ID
2871
2871
 
2872
2872
 
2873
2873
 
@@ -2876,7 +2876,7 @@ try to find this string as a variable on Windows object
2876
2876
 
2877
2877
  | Name | Type | Description | |
2878
2878
  | ---- | ---- | ----------- | -------- |
2879
- | cfg | | |   |
2879
+ | qrveyid | | The Qrvey ID |   |
2880
2880
 
2881
2881
 
2882
2882
 
@@ -2884,7 +2884,7 @@ try to find this string as a variable on Windows object
2884
2884
  ##### Returns
2885
2885
 
2886
2886
 
2887
- - `Void`
2887
+ - a promise
2888
2888
 
2889
2889
 
2890
2890
 
@@ -25,7 +25,7 @@ exports.DATE_REGULAR_EXPRESSION = {
25
25
  SECOND: `^${YEAR_MONTH_NUMBER}/${MONTH_DAY}/${YEAR} ${DAY_TIME}$`,
26
26
  MONTH_DAY: `^${MONTH_DAY}$`,
27
27
  YEAR_MONTH: `^${YEAR_MONTH}$`,
28
- YEAR_MONTH_NUMBER: `${YEAR_MONTH_NUMBER}`,
28
+ YEAR_MONTH_NUMBER: `^${YEAR_MONTH_NUMBER}$`,
29
29
  YEAR_QUARTER: `^${YEAR_QUARTER}$`,
30
30
  YEAR_WEEK: `^${YEAR_WEEK}$`,
31
31
  DAY_HOUR: `^${DAY_HOUR}$`,
@@ -8,7 +8,7 @@ const DATE_FORMAT_1 = require("../constants/DATE_FORMAT");
8
8
  * @returns a separator string
9
9
  */
10
10
  function getSeparatorByDateFormat(format = DATE_FORMAT_1.DATE_FORMAT.DAY) {
11
- return format === DATE_FORMAT_1.DATE_FORMAT.YEAR || format === DATE_FORMAT_1.DATE_FORMAT.DAY_TIME || format === DATE_FORMAT_1.DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT_1.DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT_1.DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT_1.DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT_1.DATE_FORMAT.DAY_HOUR || format === DATE_FORMAT_1.DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT_1.DATE_FORMAT.MINUTE_SECOND ? '' :
11
+ return format === DATE_FORMAT_1.DATE_FORMAT.YEAR || format === DATE_FORMAT_1.DATE_FORMAT.DAY_TIME || format === DATE_FORMAT_1.DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT_1.DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT_1.DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT_1.DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT_1.DATE_FORMAT.DAY_HOUR || format === DATE_FORMAT_1.DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT_1.DATE_FORMAT.MINUTE_SECOND ? ' ' :
12
12
  format === DATE_FORMAT_1.DATE_FORMAT.MONTH || format === DATE_FORMAT_1.DATE_FORMAT.QUARTER || format === DATE_FORMAT_1.DATE_FORMAT.WEEK || format === DATE_FORMAT_1.DATE_FORMAT.HOUR || format === DATE_FORMAT_1.DATE_FORMAT.MINUTE || format === DATE_FORMAT_1.DATE_FORMAT.SECOND ? ' ' :
13
13
  '/';
14
14
  }
@@ -22,7 +22,7 @@ export const DATE_REGULAR_EXPRESSION = {
22
22
  SECOND: `^${YEAR_MONTH_NUMBER}/${MONTH_DAY}/${YEAR} ${DAY_TIME}$`,
23
23
  MONTH_DAY: `^${MONTH_DAY}$`,
24
24
  YEAR_MONTH: `^${YEAR_MONTH}$`,
25
- YEAR_MONTH_NUMBER: `${YEAR_MONTH_NUMBER}`,
25
+ YEAR_MONTH_NUMBER: `^${YEAR_MONTH_NUMBER}$`,
26
26
  YEAR_QUARTER: `^${YEAR_QUARTER}$`,
27
27
  YEAR_WEEK: `^${YEAR_WEEK}$`,
28
28
  DAY_HOUR: `^${DAY_HOUR}$`,
@@ -5,7 +5,7 @@ import { DATE_FORMAT } from "../constants/DATE_FORMAT";
5
5
  * @returns a separator string
6
6
  */
7
7
  export function getSeparatorByDateFormat(format = DATE_FORMAT.DAY) {
8
- return format === DATE_FORMAT.YEAR || format === DATE_FORMAT.DAY_TIME || format === DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT.DAY_HOUR || format === DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT.MINUTE_SECOND ? '' :
8
+ return format === DATE_FORMAT.YEAR || format === DATE_FORMAT.DAY_TIME || format === DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT.DAY_HOUR || format === DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT.MINUTE_SECOND ? ' ' :
9
9
  format === DATE_FORMAT.MONTH || format === DATE_FORMAT.QUARTER || format === DATE_FORMAT.WEEK || format === DATE_FORMAT.HOUR || format === DATE_FORMAT.MINUTE || format === DATE_FORMAT.SECOND ? ' ' :
10
10
  '/';
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.2.9-36",
3
+ "version": "1.2.9-37",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",
@@ -11,9 +11,10 @@
11
11
  "doxs": "doxdox './dist/**/*.js' --ignore './dist/cjs/**/*.js' --output README.md --layout markdown --package ./package.json",
12
12
  "lint": "eslint src --quiet --exit-on-fatal-error --ext .ts,.js",
13
13
  "lint-dev": "eslint src --debug --ext .ts,.tsx",
14
- "publishing": "node ./scripts/prepare-publish && np",
15
- "publishing-prerelease": "node ./scripts/prepare-publish && np --any-branch --tag=$npm_config_tag",
16
- "publishing-v2": "node ./scripts/publishing --np-new-version=$npm_config_np_new_version --np-any-branch=$npm_config_np_any_branch --np-tag=$npm_config_np_tag",
14
+ "publishing-old": "node ./scripts/prepare-publish && np",
15
+ "publishing-prerelease-old": "node ./scripts/prepare-publish && np --any-branch --tag=$npm_config_tag",
16
+ "publishing-beta-1": "node ./scripts/publishing --np-new-version=$npm_config_np_new_version --np-any-branch=$npm_config_np_any_branch --np-tag=$npm_config_np_tag",
17
+ "publishing-beta-2": "node ./scripts/clean-build && node ./scripts/generating-docs && np --any-branch",
17
18
  "test": "jest test",
18
19
  "test:watch": "jest --watch test"
19
20
  },
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Script for cleaning the project from temporary files and building a new bundle
3
+ * 1- Deleting some directories and files
4
+ * 2- Installing dependencies
5
+ * 3- Build a new bundle
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const util = require('util');
10
+ const childProcess = require('child_process');
11
+ const exec = util.promisify(childProcess.exec);
12
+ const proc = require('process');
13
+ const readline = require("readline");
14
+ const rl = readline.createInterface({
15
+ input: proc.stdin,
16
+ output: proc.stdout
17
+ });
18
+ const question = util.promisify(rl.question).bind(rl);
19
+ const { exit } = require('process');
20
+
21
+ async function execute(command) {
22
+ console.log(command);
23
+ const response = await exec(command);
24
+ if (response.error != null) {
25
+ throw new Error(response.error);
26
+ }
27
+ if (response.stderr != null && response.stderr !== '') {
28
+ console.error(response.stderr);
29
+ }
30
+ if (response.stdout != null && response.stdout !== '') {
31
+ console.log(response.stdout);
32
+ }
33
+ return response;
34
+ }
35
+
36
+ async function getPackageJson(settings) {
37
+ console.log('==>>> Opening package.json file...');
38
+ const packageJson = await fs.readFileSync(settings.packagePath, 'utf8');
39
+ const packageObject = JSON.parse(packageJson);
40
+ if (packageObject != null) {
41
+ console.log(`**** The current version is ${packageObject.version}`);
42
+ return packageObject.version;
43
+ }
44
+ return '';
45
+ }
46
+
47
+ async function getNewVersion() {
48
+ console.log('==>>> Checking the new version provided...');
49
+ let newVersion;
50
+ const versionIndex = proc.argv.findIndex(function (argv) { return argv.includes('--np-new-version='); });
51
+ if (versionIndex > -1) {
52
+ const versionArg = proc.argv[versionIndex].split('--np-new-version=');
53
+ newVersion = versionArg[1] == null || versionArg[1] === '' ? undefined : versionArg[1];
54
+ }
55
+ if (newVersion == null) {
56
+ newVersion = await question('No version provided. Type the new version: ');
57
+ }
58
+ console.log('**** Version to publish: ' + newVersion);
59
+ return newVersion;
60
+ }
61
+
62
+ async function startGeneratingDocs(settings) {
63
+ console.log('==>>> Starting the Docs generation');
64
+
65
+ await generatingDocument(settings);
66
+ await changingVersion(settings);
67
+ await pushingChanges(settings);
68
+ }
69
+
70
+ async function generatingDocument(settings) {
71
+ console.log('==>>> Generating Document...');
72
+ await execute(`doxdox './dist/**/*.js' --output ${settings.docsFileName} --ignore './dist/cjs/**/*.js' --package ${settings.packagePath} --layout markdown`);
73
+ }
74
+
75
+ async function changingVersion(settings) {
76
+ console.log('==>>> Replacing the old version in the document');
77
+ const doc = await fs.readFileSync(settings.docsPath, 'utf8');
78
+ const replacedDoc = doc.replace(settings.currentVersion, settings.newVersion);
79
+ await fs.writeFileSync(settings.docsPath, replacedDoc, 'utf8');
80
+ }
81
+
82
+ async function pushingChanges(settings) {
83
+ console.log('==>>> Commiting and Pushing Docs changes...');
84
+
85
+ const gitStatus = await execute('git status -s');
86
+ console.log('gitStatus', gitStatus);
87
+ if (gitStatus.stdout !== '') {
88
+ const gitStdout = await execute('git rev-parse --abbrev-ref HEAD');
89
+ console.log('gitStdout', gitStdout);
90
+ await execute(`git add ${settings.docsPath}`);
91
+ await execute(`git commit -m "📝 docs: Updated docs${settings.newVersion != null || settings.newVersion !== '' ? ' for ' + settings.newVersion : ''}"`);
92
+ await execute(`git push -u origin ${gitStdout.stdout}`);
93
+ } else {
94
+ console.log('Nothing to Push');
95
+ }
96
+ }
97
+
98
+ async function revertChanges(settings) {
99
+ console.log('>>> Checking for modifications...');
100
+ console.warn(`>>> Unstaging posible changes from ${settings.docsFileName} and ${settings.packageFileName} file`);
101
+ await execute(`git restore --staged ${settings.docsPath} ${settings.packagePath}`);
102
+ console.warn(`>>> Discarting posible changes of ${settings.docsFileName} and ${settings.packageFileName} file`);
103
+ await execute(`git checkout -- ${settings.docsPath} ${settings.packagePath}`);
104
+ }
105
+
106
+ async function init() {
107
+ console.log('Generating Docs execution.');
108
+ let settings = {
109
+ currentVersion: '',
110
+ docsPath: './README.md',
111
+ docsFileName: 'README.md',
112
+ newVersion: undefined,
113
+ packageFileName: 'package.json',
114
+ packagePath: './package.json',
115
+ };
116
+
117
+ try {
118
+ settings["currentVersion"] = await getPackageJson(settings);
119
+ settings["newVersion"] = await getNewVersion();
120
+
121
+ await startGeneratingDocs(settings);
122
+ console.info('Docs were generated.');
123
+ } catch (err) {
124
+ console.error('Error: ', err);
125
+ await revertChanges(settings);
126
+ } finally {
127
+ console.log('Execution finished');
128
+ exit();
129
+ }
130
+ }
131
+
132
+ init();
133
+
@@ -153,11 +153,17 @@ async function changingVersion(settings) {
153
153
  async function pushingChanges(settings) {
154
154
  console.log('==>>> Commiting and Pushing Docs changes...');
155
155
 
156
- const gitStdout = await execute('git rev-parse --abbrev-ref HEAD');
157
- console.log('gitStdout', gitStdout);
158
- await execute(`git add ${settings.docsPath}`);
159
- await execute(`git commit -m "📝 docs: Updated docs${settings.newVersion != null || settings.newVersion !== '' ? ' for ' + settings.newVersion : ''}"`);
160
- await execute(`git push -u origin ${gitStdout.stdout}`);
156
+ const gitStatus = await execute('git status -s');
157
+ console.log('gitStatus', gitStatus);
158
+ if (gitStatus.stdout !== '') {
159
+ const gitStdout = await execute('git rev-parse --abbrev-ref HEAD');
160
+ console.log('gitStdout', gitStdout);
161
+ await execute(`git add ${settings.docsPath}`);
162
+ await execute(`git commit -m "📝 docs: Updated docs${settings.newVersion != null || settings.newVersion !== '' ? ' for ' + settings.newVersion : ''}"`);
163
+ await execute(`git push -u origin ${gitStdout.stdout}`);
164
+ } else {
165
+ console.log('Nothing to Push');
166
+ }
161
167
  }
162
168
 
163
169
  async function revertChanges(settings) {
@@ -179,7 +185,6 @@ async function init() {
179
185
  packageFileName: 'package.json',
180
186
  packageLockPath: './package-lock.json',
181
187
  packagePath: './package.json',
182
-
183
188
  };
184
189
 
185
190
  console.log('Welcome. The publishing operationg will begin.');
@@ -25,7 +25,7 @@ export const DATE_REGULAR_EXPRESSION = {
25
25
  SECOND: `^${YEAR_MONTH_NUMBER}/${MONTH_DAY}/${YEAR} ${DAY_TIME}$`,
26
26
  MONTH_DAY: `^${MONTH_DAY}$`,
27
27
  YEAR_MONTH: `^${YEAR_MONTH}$`,
28
- YEAR_MONTH_NUMBER: `${YEAR_MONTH_NUMBER}`,
28
+ YEAR_MONTH_NUMBER: `^${YEAR_MONTH_NUMBER}$`,
29
29
  YEAR_QUARTER: `^${YEAR_QUARTER}$`,
30
30
  YEAR_WEEK: `^${YEAR_WEEK}$`,
31
31
  DAY_HOUR: `^${DAY_HOUR}$`,
@@ -7,7 +7,7 @@ import { IDateFormat } from "../interfaces/IDateFormat";
7
7
  * @returns a separator string
8
8
  */
9
9
  export function getSeparatorByDateFormat(format: IDateFormat = DATE_FORMAT.DAY): string {
10
- return format === DATE_FORMAT.YEAR || format === DATE_FORMAT.DAY_TIME || format === DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT.DAY_HOUR|| format === DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT.MINUTE_SECOND ? '' :
10
+ return format === DATE_FORMAT.YEAR || format === DATE_FORMAT.DAY_TIME || format === DATE_FORMAT.MONTH_DAY || format === DATE_FORMAT.YEAR_MONTH || format === DATE_FORMAT.YEAR_QUARTER || format === DATE_FORMAT.YEAR_WEEK || format === DATE_FORMAT.DAY_HOUR|| format === DATE_FORMAT.HOUR_MINUTE || format === DATE_FORMAT.MINUTE_SECOND ? ' ' :
11
11
  format === DATE_FORMAT.MONTH || format === DATE_FORMAT.QUARTER || format === DATE_FORMAT.WEEK || format === DATE_FORMAT.HOUR || format === DATE_FORMAT.MINUTE || format === DATE_FORMAT.SECOND ? ' ' :
12
12
  '/';
13
13
  }
@@ -14,7 +14,7 @@ import { validateDateByDateFormat } from "./validateDateByDateFormat";
14
14
  * @param format String of the format to validate
15
15
  * @returns True if it is valid or not. Undefined if date is undefined
16
16
  */
17
- export function validateDate(date: string, format: IDateFormat = DATE_FORMAT.DAY): boolean {
17
+ export function validateDate(date: string, format: IDateFormat = DATE_FORMAT.DAY): boolean {
18
18
  if (isEmpty(date)) return false;
19
19
  if (isTokenLabel(date)) return true;
20
20
 
@@ -15,7 +15,7 @@ export function validateDateByDateFormat(date: string, dateFormat: IDateFormat =
15
15
  const separator = getSeparatorByDateFormat(dateFormat);
16
16
  const separatedDate = date.split(separator);
17
17
  const regularExpression = getDateFormatRegularExpressionInArray(dateFormat);
18
-
18
+
19
19
  if (regularExpression.length !== separatedDate.length) return false;
20
20
 
21
21
  for (let i = 0; i < separatedDate.length; i++) {