@voxgig/apidef 8.22.0 → 8.23.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.
- package/dist/apidef.d.ts +1 -1
- package/dist/apidef.js +2 -0
- package/dist/apidef.js.map +1 -1
- package/dist/guide/heuristic01.d.ts +10 -1
- package/dist/guide/heuristic01.js +249 -39
- package/dist/guide/heuristic01.js.map +1 -1
- package/dist/model.d.ts +18 -1
- package/dist/transform/args.js +27 -9
- package/dist/transform/args.js.map +1 -1
- package/dist/transform/body.d.ts +6 -0
- package/dist/transform/body.js +300 -0
- package/dist/transform/body.js.map +1 -0
- package/dist/transform/entity.d.ts +1 -1
- package/dist/transform/entity.js +13 -4
- package/dist/transform/entity.js.map +1 -1
- package/dist/transform/select.js +34 -7
- package/dist/transform/select.js.map +1 -1
- package/dist/transform/top.d.ts +1 -1
- package/dist/transform/top.js +77 -8
- package/dist/transform/top.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js.map +1 -1
- package/dist/utility.d.ts +3 -1
- package/dist/utility.js +17 -0
- package/dist/utility.js.map +1 -1
- package/model/apidef.aontu +29 -6
- package/model/guide.aontu +8 -0
- package/package.json +2 -2
- package/src/apidef.ts +5 -0
- package/src/guide/heuristic01.ts +320 -36
- package/src/model.ts +27 -0
- package/src/transform/args.ts +35 -10
- package/src/transform/body.ts +422 -0
- package/src/transform/entity.ts +20 -4
- package/src/transform/select.ts +36 -7
- package/src/transform/top.ts +95 -12
- package/src/types.ts +6 -0
- package/src/utility.ts +21 -0
package/src/utility.ts
CHANGED
|
@@ -1129,6 +1129,25 @@ function normalizeFieldName(s: string): string {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
|
|
1131
1131
|
|
|
1132
|
+
function canonizeParam(name: string): string {
|
|
1133
|
+
return depluralize(snakify(normalizeFieldName(name)))
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
// A guide may key a rename by the definition's spelling, its normalized form
|
|
1138
|
+
// or its canonical form.
|
|
1139
|
+
function paramName(wire: string, renames?: Record<string, any> | null): string {
|
|
1140
|
+
for (const key of [wire, normalizeFieldName(wire), canonizeParam(wire)]) {
|
|
1141
|
+
const target = null != renames && Object.prototype.hasOwnProperty.call(renames, key) ?
|
|
1142
|
+
renames[key] : undefined
|
|
1143
|
+
if ('string' === typeof target && '' !== target) {
|
|
1144
|
+
return target
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return canonizeParam(wire)
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
|
|
1132
1151
|
const MIN_ENTITY_NAME_LEN = 3
|
|
1133
1152
|
const MAX_ENTITY_NAME_LEN = 67
|
|
1134
1153
|
|
|
@@ -1996,6 +2015,8 @@ export {
|
|
|
1996
2015
|
ensureMinEntityName,
|
|
1997
2016
|
inferFieldType,
|
|
1998
2017
|
normalizeFieldName,
|
|
2018
|
+
canonizeParam,
|
|
2019
|
+
paramName,
|
|
1999
2020
|
humanTitle,
|
|
2000
2021
|
prefixLeadingDigit,
|
|
2001
2022
|
debugpath,
|