@jsarc/jon 0.0.1 → 0.0.2-beta.0.2

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/index.ts CHANGED
@@ -3,23 +3,6 @@ import { Timez } from '@jsarc/timez';
3
3
 
4
4
  // @ts-nocheck
5
5
 
6
- interface Window {
7
- default: typeof defaultElementGF;
8
- String: any;
9
- Number: any;
10
- Boolean: any;
11
- Date: any;
12
- File: any;
13
- Enum: any;
14
- NotEnum: any;
15
- Array: any;
16
- Object: any;
17
- ChosenType: any;
18
- AnyType: any;
19
- JON: any;
20
- __bundledModules: any;
21
- }
22
-
23
6
  export interface ValidationResult {
24
7
  valid: boolean;
25
8
  data: any;
@@ -32,7 +15,7 @@ export interface RuleFunction {
32
15
  }
33
16
 
34
17
 
35
- const globalFunct = (function(global: any) {
18
+ const globalFunct = (function() {
36
19
  'use strict';
37
20
 
38
21
 
@@ -67,6 +50,7 @@ const globalFunct = (function(global: any) {
67
50
  const tabAlphanumerique = [...tabNumerique, ...tabAlphabetique];
68
51
  const tabAlphanumeriqueInsensitive = [...tabNumerique, ...tabAlphabetiqueInsensitive];
69
52
 
53
+
70
54
  function getLang(lang: string): string {
71
55
  let result = lang;
72
56
  result = langs.includes(result) ? result : 'fr';
@@ -7084,6 +7068,7 @@ const globalFunct = (function(global: any) {
7084
7068
 
7085
7069
 
7086
7070
 
7071
+
7087
7072
  const JONSchemas: any = {
7088
7073
  'String': StringSchema,
7089
7074
  'Number': NumberSchema,
@@ -7099,11 +7084,6 @@ const globalFunct = (function(global: any) {
7099
7084
  };
7100
7085
 
7101
7086
 
7102
- if (typeof window !== 'undefined') {
7103
- (window as any).JON = JONSchemas;
7104
- }
7105
-
7106
-
7107
7087
 
7108
7088
 
7109
7089
 
@@ -7125,59 +7105,9 @@ const globalFunct = (function(global: any) {
7125
7105
 
7126
7106
  const __bundledModules = globalFunctModule;
7127
7107
 
7128
- if (typeof global !== 'undefined') {
7129
- (global as any).default = JONSchemas;
7130
- (global as any).String = StringSchema;
7131
- (global as any).Number = NumberSchema;
7132
- (global as any).Boolean = BooleanSchema;
7133
- (global as any).Date = DateSchema;
7134
- (global as any).File = FileSchema;
7135
- (global as any).Enum = EnumSchema;
7136
- (global as any).NotEnum = NotEnumSchema;
7137
- (global as any).Array = ArraySchema;
7138
- (global as any).Object = ObjectSchema;
7139
- (global as any).ChosenType = ChosenTypeSchema;
7140
- (global as any).AnyType = AnyTypeSchema;
7141
- (global as any).__bundledModules = __bundledModules;
7142
- }
7143
-
7144
- if (typeof window !== "undefined") {
7145
- (window as any).default = JONSchemas;
7146
- (window as any).String = StringSchema;
7147
- (window as any).Number = NumberSchema;
7148
- (window as any).Boolean = BooleanSchema;
7149
- (window as any).Date = DateSchema;
7150
- (window as any).File = FileSchema;
7151
- (window as any).Enum = EnumSchema;
7152
- (window as any).NotEnum = NotEnumSchema;
7153
- (window as any).Array = ArraySchema;
7154
- (window as any).Object = ObjectSchema;
7155
- (window as any).ChosenType = ChosenTypeSchema;
7156
- (window as any).AnyType = AnyTypeSchema;
7157
- (window as any).__bundledModules = __bundledModules;
7158
- }
7159
-
7160
- if (typeof exports !== 'undefined') {
7161
- exports.default = JONSchemas;
7162
- exports.String = StringSchema;
7163
- exports.Number = NumberSchema;
7164
- exports.Boolean = BooleanSchema;
7165
- exports.Date = DateSchema;
7166
- exports.File = FileSchema;
7167
- exports.Enum = EnumSchema;
7168
- exports.NotEnum = NotEnumSchema;
7169
- exports.Array = ArraySchema;
7170
- exports.Object = ObjectSchema;
7171
- exports.ChosenType = ChosenTypeSchema;
7172
- exports.AnyType = AnyTypeSchema;
7173
- }
7174
7108
  return globalFunctModule;
7175
7109
 
7176
- })(typeof global !== 'undefined' ? global :
7177
- typeof window !== 'undefined' ? window :
7178
- typeof self !== 'undefined' ? self :
7179
- typeof globalThis !== 'undefined' ? globalThis :
7180
- {});
7110
+ })();
7181
7111
 
7182
7112
  type StringElementTypeGF = typeof globalFunct.String;
7183
7113
 
package/js/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Fodat } from '@jsarc/fodat';
2
2
  import { Timez } from '@jsarc/timez';
3
- const globalFunct = (function (global) {
3
+ const globalFunct = (function () {
4
4
  'use strict';
5
5
  const NODEENV = 'development';
6
6
  const langs = ['en', 'fr'];
@@ -5565,9 +5565,6 @@ const globalFunct = (function (global) {
5565
5565
  'ChosenType': ChosenTypeSchema,
5566
5566
  'AnyType': AnyTypeSchema,
5567
5567
  };
5568
- if (typeof window !== 'undefined') {
5569
- window.JON = JONSchemas;
5570
- }
5571
5568
  const globalFunctModule = {
5572
5569
  default: JONSchemas,
5573
5570
  String: StringSchema,
@@ -5583,56 +5580,8 @@ const globalFunct = (function (global) {
5583
5580
  AnyType: AnyTypeSchema,
5584
5581
  };
5585
5582
  const __bundledModules = globalFunctModule;
5586
- if (typeof global !== 'undefined') {
5587
- global.default = JONSchemas;
5588
- global.String = StringSchema;
5589
- global.Number = NumberSchema;
5590
- global.Boolean = BooleanSchema;
5591
- global.Date = DateSchema;
5592
- global.File = FileSchema;
5593
- global.Enum = EnumSchema;
5594
- global.NotEnum = NotEnumSchema;
5595
- global.Array = ArraySchema;
5596
- global.Object = ObjectSchema;
5597
- global.ChosenType = ChosenTypeSchema;
5598
- global.AnyType = AnyTypeSchema;
5599
- global.__bundledModules = __bundledModules;
5600
- }
5601
- if (typeof window !== "undefined") {
5602
- window.default = JONSchemas;
5603
- window.String = StringSchema;
5604
- window.Number = NumberSchema;
5605
- window.Boolean = BooleanSchema;
5606
- window.Date = DateSchema;
5607
- window.File = FileSchema;
5608
- window.Enum = EnumSchema;
5609
- window.NotEnum = NotEnumSchema;
5610
- window.Array = ArraySchema;
5611
- window.Object = ObjectSchema;
5612
- window.ChosenType = ChosenTypeSchema;
5613
- window.AnyType = AnyTypeSchema;
5614
- window.__bundledModules = __bundledModules;
5615
- }
5616
- if (typeof exports !== 'undefined') {
5617
- exports.default = JONSchemas;
5618
- exports.String = StringSchema;
5619
- exports.Number = NumberSchema;
5620
- exports.Boolean = BooleanSchema;
5621
- exports.Date = DateSchema;
5622
- exports.File = FileSchema;
5623
- exports.Enum = EnumSchema;
5624
- exports.NotEnum = NotEnumSchema;
5625
- exports.Array = ArraySchema;
5626
- exports.Object = ObjectSchema;
5627
- exports.ChosenType = ChosenTypeSchema;
5628
- exports.AnyType = AnyTypeSchema;
5629
- }
5630
5583
  return globalFunctModule;
5631
- })(typeof global !== 'undefined' ? global :
5632
- typeof window !== 'undefined' ? window :
5633
- typeof self !== 'undefined' ? self :
5634
- typeof globalThis !== 'undefined' ? globalThis :
5635
- {});
5584
+ })();
5636
5585
  const StringElementGF = globalFunct.String;
5637
5586
  const NumberElementGF = globalFunct.Number;
5638
5587
  const BooleanElementGF = globalFunct.Boolean;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.1",
6
+ "version": "0.0.2-beta.0.2",
7
7
  "description": "JON est une bibliothèque TypeScript conçue pour la validation et la gestion des schémas de données. Elle offre une solution robuste pour valider les types de données, gérer les erreurs, et supporter une variété de types de données complexes.",
8
8
  "main": "index.ts",
9
9
  "keywords": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "devDependencies": {},
17
17
  "dependencies": {
18
- "@jsarc/timez": "^0.0.1-beta.0.1",
19
- "@jsarc/fodat": "^0.0.1-beta.0.1"
18
+ "@jsarc/timez": "^0.0.1-beta.0.3",
19
+ "@jsarc/fodat": "^0.0.1-beta.0.3"
20
20
  }
21
21
  }
package/web/jon.js CHANGED
@@ -1,4 +1,4 @@
1
- const globalFunct = (function (global) {
1
+ const globalFunct = (function () {
2
2
  'use strict';
3
3
  const NODEENV = 'development';
4
4
  const langs = ['en', 'fr'];
@@ -1385,14 +1385,6 @@ const globalFunct = (function (global) {
1385
1385
  static get FORMATS() {
1386
1386
  return { ...Timez.PREDEFINED_FORMATS };
1387
1387
  }
1388
- static exposeToGlobal() {
1389
- if (typeof window !== 'undefined') {
1390
- window.Timez = Timez;
1391
- }
1392
- }
1393
- }
1394
- if (typeof window !== 'undefined') {
1395
- window.Timez = Timez;
1396
1388
  }
1397
1389
  class Fodat {
1398
1390
  static transform(formData) {
@@ -1478,14 +1470,6 @@ const globalFunct = (function (global) {
1478
1470
  }
1479
1471
  return path;
1480
1472
  }
1481
- static exposeToGlobal() {
1482
- if (typeof window !== "undefined") {
1483
- window.Fodat = Fodat;
1484
- }
1485
- }
1486
- }
1487
- if (typeof window !== "undefined") {
1488
- window.Fodat = Fodat;
1489
1473
  }
1490
1474
  function checkIfCorrectTypeSchema(value) {
1491
1475
  return (value instanceof StringSchema ||
@@ -6407,56 +6391,8 @@ const globalFunct = (function (global) {
6407
6391
  AnyType: AnyTypeSchema,
6408
6392
  };
6409
6393
  const __bundledModules = globalFunctModule;
6410
- if (typeof global !== 'undefined') {
6411
- global.default = JONSchemas;
6412
- global.String = StringSchema;
6413
- global.Number = NumberSchema;
6414
- global.Boolean = BooleanSchema;
6415
- global.Date = DateSchema;
6416
- global.File = FileSchema;
6417
- global.Enum = EnumSchema;
6418
- global.NotEnum = NotEnumSchema;
6419
- global.Array = ArraySchema;
6420
- global.Object = ObjectSchema;
6421
- global.ChosenType = ChosenTypeSchema;
6422
- global.AnyType = AnyTypeSchema;
6423
- global.__bundledModules = __bundledModules;
6424
- }
6425
- if (typeof window !== "undefined") {
6426
- window.default = JONSchemas;
6427
- window.String = StringSchema;
6428
- window.Number = NumberSchema;
6429
- window.Boolean = BooleanSchema;
6430
- window.Date = DateSchema;
6431
- window.File = FileSchema;
6432
- window.Enum = EnumSchema;
6433
- window.NotEnum = NotEnumSchema;
6434
- window.Array = ArraySchema;
6435
- window.Object = ObjectSchema;
6436
- window.ChosenType = ChosenTypeSchema;
6437
- window.AnyType = AnyTypeSchema;
6438
- window.__bundledModules = __bundledModules;
6439
- }
6440
- if (typeof exports !== 'undefined') {
6441
- exports.default = JONSchemas;
6442
- exports.String = StringSchema;
6443
- exports.Number = NumberSchema;
6444
- exports.Boolean = BooleanSchema;
6445
- exports.Date = DateSchema;
6446
- exports.File = FileSchema;
6447
- exports.Enum = EnumSchema;
6448
- exports.NotEnum = NotEnumSchema;
6449
- exports.Array = ArraySchema;
6450
- exports.Object = ObjectSchema;
6451
- exports.ChosenType = ChosenTypeSchema;
6452
- exports.AnyType = AnyTypeSchema;
6453
- }
6454
6394
  return globalFunctModule;
6455
- })(typeof global !== 'undefined' ? global :
6456
- typeof window !== 'undefined' ? window :
6457
- typeof self !== 'undefined' ? self :
6458
- typeof globalThis !== 'undefined' ? globalThis :
6459
- {});
6395
+ })();
6460
6396
  const StringElementGF = globalFunct.String;
6461
6397
  const NumberElementGF = globalFunct.Number;
6462
6398
  const BooleanElementGF = globalFunct.Boolean;