@ng-openapi/http-resource 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 +30 -30
  2. package/index.d.ts +5 -1
  3. package/index.js +30 -30
  4. package/package.json +1 -1
package/index.cjs CHANGED
@@ -2972,6 +2972,36 @@ 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 isValidIdentifier(name) {
2986
+ return /^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(name);
2987
+ }
2988
+ __name(isValidIdentifier, "isValidIdentifier");
2989
+ function camelCase(str2) {
2990
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
2991
+ return toIdentifier(converted);
2992
+ }
2993
+ __name(camelCase, "camelCase");
2994
+ function pascalCase(str2) {
2995
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
2996
+ return toIdentifier(converted);
2997
+ }
2998
+ __name(pascalCase, "pascalCase");
2999
+ function pascalCaseForEnums(str2) {
3000
+ const converted = str2.replace(/[^a-zA-Z0-9]/g, "_").replace(/(?:^|_)([a-z])/g, (_, char) => char.toUpperCase()).replace(/^([0-9])/, "_$1");
3001
+ return converted === "" ? "_" : converted;
3002
+ }
3003
+ __name(pascalCaseForEnums, "pascalCaseForEnums");
3004
+
2975
3005
  // ../../shared/src/utils/content-types.constants.ts
2976
3006
  var CONTENT_TYPES = {
2977
3007
  MULTIPART: "multipart/form-data",
@@ -3012,36 +3042,6 @@ function emitDocs(description) {
3012
3042
  }
3013
3043
  __name(emitDocs, "emitDocs");
3014
3044
 
3015
- // ../../shared/src/utils/string.utils.ts
3016
- var IDENTIFIER_SEPARATORS = /(?:_|[^\p{ID_Continue}$])+(.)?/gu;
3017
- var INVALID_IDENTIFIER_START = /^[^\p{ID_Start}$_]/u;
3018
- function toIdentifier(converted) {
3019
- if (converted === "") {
3020
- return "_";
3021
- }
3022
- return converted.replace(INVALID_IDENTIFIER_START, (char) => `_${char}`);
3023
- }
3024
- __name(toIdentifier, "toIdentifier");
3025
- function isValidIdentifier(name) {
3026
- return /^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(name);
3027
- }
3028
- __name(isValidIdentifier, "isValidIdentifier");
3029
- function camelCase(str2) {
3030
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
3031
- return toIdentifier(converted);
3032
- }
3033
- __name(camelCase, "camelCase");
3034
- function pascalCase(str2) {
3035
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
3036
- return toIdentifier(converted);
3037
- }
3038
- __name(pascalCase, "pascalCase");
3039
- function pascalCaseForEnums(str2) {
3040
- const converted = str2.replace(/[^a-zA-Z0-9]/g, "_").replace(/(?:^|_)([a-z])/g, (_, char) => char.toUpperCase()).replace(/^([0-9])/, "_$1");
3041
- return converted === "" ? "_" : converted;
3042
- }
3043
- __name(pascalCaseForEnums, "pascalCaseForEnums");
3044
-
3045
3045
  // ../../shared/src/utils/functions/class-names.ts
3046
3046
  function decorate(base, defaultSuffix, naming) {
3047
3047
  return `${naming?.prefix ?? ""}${base}${naming?.suffix ?? defaultSuffix}`;
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,36 @@ 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 isValidIdentifier(name) {
2952
+ return /^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(name);
2953
+ }
2954
+ __name(isValidIdentifier, "isValidIdentifier");
2955
+ function camelCase(str2) {
2956
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
2957
+ return toIdentifier(converted);
2958
+ }
2959
+ __name(camelCase, "camelCase");
2960
+ function pascalCase(str2) {
2961
+ const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
2962
+ return toIdentifier(converted);
2963
+ }
2964
+ __name(pascalCase, "pascalCase");
2965
+ function pascalCaseForEnums(str2) {
2966
+ const converted = str2.replace(/[^a-zA-Z0-9]/g, "_").replace(/(?:^|_)([a-z])/g, (_, char) => char.toUpperCase()).replace(/^([0-9])/, "_$1");
2967
+ return converted === "" ? "_" : converted;
2968
+ }
2969
+ __name(pascalCaseForEnums, "pascalCaseForEnums");
2970
+
2941
2971
  // ../../shared/src/utils/content-types.constants.ts
2942
2972
  var CONTENT_TYPES = {
2943
2973
  MULTIPART: "multipart/form-data",
@@ -2978,36 +3008,6 @@ function emitDocs(description) {
2978
3008
  }
2979
3009
  __name(emitDocs, "emitDocs");
2980
3010
 
2981
- // ../../shared/src/utils/string.utils.ts
2982
- var IDENTIFIER_SEPARATORS = /(?:_|[^\p{ID_Continue}$])+(.)?/gu;
2983
- var INVALID_IDENTIFIER_START = /^[^\p{ID_Start}$_]/u;
2984
- function toIdentifier(converted) {
2985
- if (converted === "") {
2986
- return "_";
2987
- }
2988
- return converted.replace(INVALID_IDENTIFIER_START, (char) => `_${char}`);
2989
- }
2990
- __name(toIdentifier, "toIdentifier");
2991
- function isValidIdentifier(name) {
2992
- return /^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(name);
2993
- }
2994
- __name(isValidIdentifier, "isValidIdentifier");
2995
- function camelCase(str2) {
2996
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toLowerCase());
2997
- return toIdentifier(converted);
2998
- }
2999
- __name(camelCase, "camelCase");
3000
- function pascalCase(str2) {
3001
- const converted = str2.replace(IDENTIFIER_SEPARATORS, (_, char) => char ? char.toUpperCase() : "").replace(/^./u, (char) => char.toUpperCase());
3002
- return toIdentifier(converted);
3003
- }
3004
- __name(pascalCase, "pascalCase");
3005
- function pascalCaseForEnums(str2) {
3006
- const converted = str2.replace(/[^a-zA-Z0-9]/g, "_").replace(/(?:^|_)([a-z])/g, (_, char) => char.toUpperCase()).replace(/^([0-9])/, "_$1");
3007
- return converted === "" ? "_" : converted;
3008
- }
3009
- __name(pascalCaseForEnums, "pascalCaseForEnums");
3010
-
3011
3011
  // ../../shared/src/utils/functions/class-names.ts
3012
3012
  function decorate(base, defaultSuffix, naming) {
3013
3013
  return `${naming?.prefix ?? ""}${base}${naming?.suffix ?? defaultSuffix}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-openapi/http-resource",
3
- "version": "0.1.3-pr-127-fix-125-sanitize-generated-identifiers-9082a48.0",
3
+ "version": "0.2.0",
4
4
  "description": "HTTP Resource plugin for ng-openapi - Angular HTTP utilities with caching and state management",
5
5
  "keywords": [
6
6
  "angular",