@ng-openapi/zod 0.1.3-pr-127-fix-125-sanitize-generated-identifiers-9082a48.0 → 0.2.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.
Files changed (4) hide show
  1. package/index.cjs +21 -21
  2. package/index.d.ts +5 -1
  3. package/index.js +21 -21
  4. package/package.json +1 -1
package/index.cjs CHANGED
@@ -2972,6 +2972,27 @@ var safeLoad = renamed("safeLoad", "load");
2972
2972
  var safeLoadAll = renamed("safeLoadAll", "loadAll");
2973
2973
  var safeDump = renamed("safeDump", "dump");
2974
2974
 
2975
+ // ../../shared/src/utils/string.utils.ts
2976
+ var IDENTIFIER_SEPARATORS = /(?:_|[^\p{ID_Continue}$])+(.)?/gu;
2977
+ var INVALID_IDENTIFIER_START = /^[^\p{ID_Start}$_]/u;
2978
+ function toIdentifier(converted) {
2979
+ if (converted === "") {
2980
+ return "_";
2981
+ }
2982
+ return converted.replace(INVALID_IDENTIFIER_START, (char) => `_${char}`);
2983
+ }
2984
+ __name(toIdentifier, "toIdentifier");
2985
+ function camelCase(str2) {
2986
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
2987
+ return toIdentifier(converted);
2988
+ }
2989
+ __name(camelCase, "camelCase");
2990
+ function pascalCase(str2) {
2991
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
2992
+ return toIdentifier(converted);
2993
+ }
2994
+ __name(pascalCase, "pascalCase");
2995
+
2975
2996
  // ../../shared/src/utils/content-types.constants.ts
2976
2997
  var CONTENT_TYPES = {
2977
2998
  MULTIPART: "multipart/form-data",
@@ -2998,27 +3019,6 @@ function escapeDoubleQuoted(value) {
2998
3019
  }
2999
3020
  __name(escapeDoubleQuoted, "escapeDoubleQuoted");
3000
3021
 
3001
- // ../../shared/src/utils/string.utils.ts
3002
- var IDENTIFIER_SEPARATORS = /(?:_|[^\p{ID_Continue}$])+(.)?/gu;
3003
- var INVALID_IDENTIFIER_START = /^[^\p{ID_Start}$_]/u;
3004
- function toIdentifier(converted) {
3005
- if (converted === "") {
3006
- return "_";
3007
- }
3008
- return converted.replace(INVALID_IDENTIFIER_START, (char) => `_${char}`);
3009
- }
3010
- __name(toIdentifier, "toIdentifier");
3011
- function camelCase(str2) {
3012
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
3013
- return toIdentifier(converted);
3014
- }
3015
- __name(camelCase, "camelCase");
3016
- function pascalCase(str2) {
3017
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
3018
- return toIdentifier(converted);
3019
- }
3020
- __name(pascalCase, "pascalCase");
3021
-
3022
3022
  // ../../shared/src/utils/functions/argument-names.ts
3023
3023
  var SERVICE_ARGUMENT_PROFILE = Object.freeze({
3024
3024
  reserved: Object.freeze([
package/index.d.ts CHANGED
@@ -267,7 +267,11 @@ interface GeneratorConfig {
267
267
  output: string;
268
268
  /** Distinguishes tokens/providers when several clients coexist in one app. */
269
269
  clientName?: string;
270
- /** Custom acceptance check run on the parsed spec; returning false aborts generation. */
270
+ /**
271
+ * Custom acceptance check run on the parsed spec; returning false aborts
272
+ * generation. Receives the spec as authored — before deep-pointer `$ref`s
273
+ * are inlined (`core/inline-nested-refs.ts`).
274
+ */
271
275
  validateInput?: (spec: SwaggerSpec) => boolean;
272
276
  options: {
273
277
  /** How date/date-time formats are typed in generated models. */
package/index.js CHANGED
@@ -2938,6 +2938,27 @@ var safeLoad = renamed("safeLoad", "load");
2938
2938
  var safeLoadAll = renamed("safeLoadAll", "loadAll");
2939
2939
  var safeDump = renamed("safeDump", "dump");
2940
2940
 
2941
+ // ../../shared/src/utils/string.utils.ts
2942
+ var IDENTIFIER_SEPARATORS = /(?:_|[^\p{ID_Continue}$])+(.)?/gu;
2943
+ var INVALID_IDENTIFIER_START = /^[^\p{ID_Start}$_]/u;
2944
+ function toIdentifier(converted) {
2945
+ if (converted === "") {
2946
+ return "_";
2947
+ }
2948
+ return converted.replace(INVALID_IDENTIFIER_START, (char) => `_${char}`);
2949
+ }
2950
+ __name(toIdentifier, "toIdentifier");
2951
+ function camelCase(str2) {
2952
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
2953
+ return toIdentifier(converted);
2954
+ }
2955
+ __name(camelCase, "camelCase");
2956
+ function pascalCase(str2) {
2957
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
2958
+ return toIdentifier(converted);
2959
+ }
2960
+ __name(pascalCase, "pascalCase");
2961
+
2941
2962
  // ../../shared/src/utils/content-types.constants.ts
2942
2963
  var CONTENT_TYPES = {
2943
2964
  MULTIPART: "multipart/form-data",
@@ -2964,27 +2985,6 @@ function escapeDoubleQuoted(value) {
2964
2985
  }
2965
2986
  __name(escapeDoubleQuoted, "escapeDoubleQuoted");
2966
2987
 
2967
- // ../../shared/src/utils/string.utils.ts
2968
- var IDENTIFIER_SEPARATORS = /(?:_|[^\p{ID_Continue}$])+(.)?/gu;
2969
- var INVALID_IDENTIFIER_START = /^[^\p{ID_Start}$_]/u;
2970
- function toIdentifier(converted) {
2971
- if (converted === "") {
2972
- return "_";
2973
- }
2974
- return converted.replace(INVALID_IDENTIFIER_START, (char) => `_${char}`);
2975
- }
2976
- __name(toIdentifier, "toIdentifier");
2977
- function camelCase(str2) {
2978
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
2979
- return toIdentifier(converted);
2980
- }
2981
- __name(camelCase, "camelCase");
2982
- function pascalCase(str2) {
2983
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
2984
- return toIdentifier(converted);
2985
- }
2986
- __name(pascalCase, "pascalCase");
2987
-
2988
2988
  // ../../shared/src/utils/functions/argument-names.ts
2989
2989
  var SERVICE_ARGUMENT_PROFILE = Object.freeze({
2990
2990
  reserved: Object.freeze([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-openapi/zod",
3
- "version": "0.1.3-pr-127-fix-125-sanitize-generated-identifiers-9082a48.0",
3
+ "version": "0.2.0",
4
4
  "description": "Zod validation plugin for ng-openapi - Generate Zod schemas from OpenAPI specifications",
5
5
  "keywords": [
6
6
  "angular",