···117117118118 await resolveExternal(this, this.options);
119119 const errors = JSONParserErrorGroup.getParserErrors(this);
120120- if (errors.length > 0) {
120120+ if (errors.length) {
121121 throw new JSONParserErrorGroup(this);
122122 }
123123 _bundle(this, this.options);
124124 const errors2 = JSONParserErrorGroup.getParserErrors(this);
125125- if (errors2.length > 0) {
125125+ if (errors2.length) {
126126 throw new JSONParserErrorGroup(this);
127127 }
128128 return this.schema!;
···148148149149 await resolveExternal(this, this.options);
150150 const errors = JSONParserErrorGroup.getParserErrors(this);
151151- if (errors.length > 0) {
151151+ if (errors.length) {
152152 throw new JSONParserErrorGroup(this);
153153 }
154154 _bundle(this, this.options);
155155 // Merged root is ready for bundling
156156157157 const errors2 = JSONParserErrorGroup.getParserErrors(this);
158158- if (errors2.length > 0) {
158158+ if (errors2.length) {
159159 throw new JSONParserErrorGroup(this);
160160 }
161161 return this.schema!;
···297297298298 public mergeMany(): JSONSchema {
299299 const schemas = this.schemaMany || [];
300300- if (schemas.length === 0) {
300300+ if (!schemas.length) {
301301 throw ono('mergeMany called with no schemas. Did you run parseMany?');
302302 }
303303···335335 }
336336 }
337337 }
338338- if (Object.keys(infoAccumulator).length > 0) {
338338+ if (Object.keys(infoAccumulator).length) {
339339 merged.info = infoAccumulator;
340340 }
341341···356356 }
357357 }
358358 }
359359- if (servers.length > 0) {
359359+ if (servers.length) {
360360 merged.servers = servers;
361361 }
362362···568568 }
569569 }
570570571571- if (tags.length > 0) {
571571+ if (tags.length) {
572572 merged.tags = tags;
573573 }
574574
+2-2
packages/json-schema-ref-parser/src/pointer.ts
···140140 }
141141 }
142142143143- if (errors.length > 0) {
143143+ if (errors.length) {
144144 throw errors.length === 1
145145 ? errors[0]
146146 : new AggregateError(errors, 'Multiple missing pointer errors');
···171171 const tokens = Pointer.parse(this.path);
172172 let token;
173173174174- if (tokens.length === 0) {
174174+ if (!tokens.length) {
175175 // There are no tokens, replace the entire object with the new value
176176 this.value = value;
177177 return value;
+1-1
packages/json-schema-ref-parser/src/ref.ts
···152152 value !== null &&
153153 '$ref' in value &&
154154 typeof value.$ref === 'string' &&
155155- value.$ref.length > 0
155155+ Boolean(value.$ref.length)
156156 );
157157 }
158158
+1-1
packages/json-schema-ref-parser/src/refs.ts
···224224225225 // Filter the paths by type
226226 types = Array.isArray(types[0]) ? types[0] : Array.prototype.slice.call(types);
227227- if (types.length > 0 && types[0]) {
227227+ if (types.length && types[0]) {
228228 paths = paths.filter((key) => types.includes($refs[key]!.pathType as string));
229229 }
230230
···249249 case PyNodeKind.ImportStatement: {
250250 const fromPrefix = node.isFrom ? `from ${node.module} ` : '';
251251 if (fromPrefix) {
252252- if (node.names && node.names.length > 0) {
252252+ if (node.names && node.names.length) {
253253 const imports = node.names
254254 .map(({ alias, name }) => (alias ? `${name} as ${alias}` : name))
255255 .join(', ');
···258258 parts.push(printLine(`${fromPrefix}import *`));
259259 }
260260 } else {
261261- if (node.names && node.names.length > 0) {
261261+ if (node.names && node.names.length) {
262262 const imports = node.names
263263 .map(({ alias, name }) => (alias ? `${name} as ${alias}` : name))
264264 .join(', ');
+3-3
packages/openapi-python/src/py-dsl/decl/class.ts
···47474848 /** Returns true when all required builder calls are present. */
4949 get isValid(): boolean {
5050- return this.missingRequiredCalls().length === 0;
5050+ return !this.missingRequiredCalls().length;
5151 }
52525353 /** Returns true if the class has any members. */
5454 get hasBody(): boolean {
5555- return this.body.length > 0;
5555+ return Boolean(this.body.length);
5656 }
57575858 /** Adds one or more class members (fields, methods, etc.). */
···107107108108 $validate(): asserts this {
109109 const missing = this.missingRequiredCalls();
110110- if (missing.length === 0) return;
110110+ if (!missing.length) return;
111111 throw new Error(`Class declaration missing ${missing.join(' and ')}`);
112112 }
113113
+2-2
packages/openapi-python/src/py-dsl/decl/func.ts
···50505151 /** Returns true when all required builder calls are present. */
5252 get isValid(): boolean {
5353- return this.missingRequiredCalls().length === 0;
5353+ return !this.missingRequiredCalls().length;
5454 }
55555656 override toAst() {
···68686969 $validate(): asserts this {
7070 const missing = this.missingRequiredCalls();
7171- if (missing.length === 0) return;
7171+ if (!missing.length) return;
7272 throw new Error(`Function declaration missing ${missing.join(' and ')}`);
7373 }
7474
+2-2
packages/openapi-python/src/py-dsl/decl/param.ts
···4141 }
42424343 get isValid(): boolean {
4444- return this.missingRequiredCalls().length === 0;
4444+ return !this.missingRequiredCalls().length;
4545 }
46464747 /** Sets the parameter type. */
···61616262 $validate(): asserts this {
6363 const missing = this.missingRequiredCalls();
6464- if (missing.length === 0) return;
6464+ if (!missing.length) return;
6565 throw new Error(`Parameter missing ${missing.join(' and ')}`);
6666 }
6767
+2-2
packages/openapi-python/src/py-dsl/expr/attr.ts
···31313232 /** Returns true when all required builder calls are present. */
3333 get isValid(): boolean {
3434- return this.missingRequiredCalls().length === 0;
3434+ return !this.missingRequiredCalls().length;
3535 }
36363737 override toAst() {
···5050 left: MaybePyDsl<py.Expression>;
5151 } {
5252 const missing = this.missingRequiredCalls();
5353- if (missing.length === 0) return;
5353+ if (!missing.length) return;
5454 throw new Error(`Attribute access missing ${missing.join(' and ')}`);
5555 }
5656
+2-2
packages/openapi-python/src/py-dsl/expr/binary.ts
···54545555 /** Returns true when all required builder calls are present. */
5656 get isValid(): boolean {
5757- return this.missingRequiredCalls().length === 0;
5757+ return !this.missingRequiredCalls().length;
5858 }
59596060 and(right: MaybePyDsl<py.Expression>): this {
···149149 _right: MaybePyDsl<py.Expression>;
150150 } {
151151 const missing = this.missingRequiredCalls();
152152- if (missing.length === 0) return;
152152+ if (!missing.length) return;
153153 throw new Error(`Binary expression missing ${missing.join(' and ')}`);
154154 }
155155
+2-2
packages/openapi-python/src/py-dsl/expr/call.ts
···32323333 /** Returns true when all required builder calls are present. */
3434 get isValid(): boolean {
3535- return this.missingRequiredCalls().length === 0;
3535+ return !this.missingRequiredCalls().length;
3636 }
37373838 override toAst() {
···4545 _callee: MaybePyDsl<py.Expression>;
4646 } {
4747 const missing = this.missingRequiredCalls();
4848- if (missing.length === 0) return;
4848+ if (!missing.length) return;
4949 throw new Error(`Call expression missing ${missing.join(' and ')}`);
5050 }
5151
···6060// function getAccessChainForNode(node: PyDsl): NodeChain {
6161// const structuralChain = [...getStructuralChainForNode(node, new Set())];
6262// const accessChain = structuralToAccessChain(structuralChain);
6363-// if (accessChain.length === 0) {
6363+// if (!accessChain.length) {
6464// // I _think_ this should not happen, but it does and this fix works for now.
6565// // I assume this will cause issues with imports in some cases, investigate
6666// // when it actually happens.
···8484// if (getScope(parent) !== getScope(node)) continue;
85858686// const chain = getStructuralChainForNode(parent, visited);
8787-// if (chain.length > 0) return [...chain, node];
8787+// if (chain.length) return [...chain, node];
8888// }
8989// }
9090
···1515 const { childResults, schemas, symbols } = ctx;
1616 const { z } = symbols;
17171818- if (childResults.length === 0) {
1818+ if (!childResults.length) {
1919 return $(z).attr(identifiers.null).call();
2020 }
2121···2828 });
29293030 let expression: Chain;
3131- if (nonNullItems.length === 0) {
3131+ if (!nonNullItems.length) {
3232 expression = $(z).attr(identifiers.null).call();
3333 } else if (nonNullItems.length === 1) {
3434 expression = nonNullItems[0]!.expression;
+1-1
packages/openapi-ts/src/plugins/zod/v4/walker.ts
···338338 });
339339340340 let expression: Chain;
341341- if (nonNullItems.length === 0) {
341341+ if (!nonNullItems.length) {
342342 expression = $(z).attr(identifiers.null).call();
343343 } else if (nonNullItems.length === 1) {
344344 expression = nonNullItems[0]!.expression;
+1-1
packages/openapi-ts/src/ts-dsl/decl/class.ts
···51515252 /** Returns true if the class has any members. */
5353 get hasBody(): boolean {
5454- return this.body.length > 0;
5454+ return Boolean(this.body.length);
5555 }
56565757 /** Adds one or more class members (fields, methods, etc.). */
+2-2
packages/openapi-ts/src/ts-dsl/decl/func.ts
···85858686 /** Returns true when all required builder calls are present. */
8787 get isValid(): boolean {
8888- return this.missingRequiredCalls().length === 0;
8888+ return !this.missingRequiredCalls().length;
8989 }
90909191 /** Switches the function to an arrow function form. */
···158158159159 $validate(): asserts this {
160160 const missing = this.missingRequiredCalls();
161161- if (missing.length === 0) return;
161161+ if (!missing.length) return;
162162 throw new Error(`Function ${this.mode} missing ${missing.join(' and ')}`);
163163 }
164164
+2-2
packages/openapi-ts/src/ts-dsl/decl/param.ts
···41414242 /** Returns true when all required builder calls are present. */
4343 get isValid(): boolean {
4444- return this.missingRequiredCalls().length === 0;
4444+ return !this.missingRequiredCalls().length;
4545 }
46464747 /** Sets the parameter type. */
···64646565 $validate(): asserts this {
6666 const missing = this.missingRequiredCalls();
6767- if (missing.length === 0) return;
6767+ if (!missing.length) return;
6868 throw new Error(`Parameter missing ${missing.join(' and ')}`);
6969 }
7070
+2-2
packages/openapi-ts/src/ts-dsl/decl/pattern.ts
···25252626 /** Returns true when all required builder calls are present. */
2727 get isValid(): boolean {
2828- return this.missingRequiredCalls().length === 0;
2828+ return !this.missingRequiredCalls().length;
2929 }
30303131 /** Defines an array pattern (e.g., `[a, b, c]`). */
···8585 | { kind: 'object'; values: Record<string, string> };
8686 } {
8787 const missing = this.missingRequiredCalls();
8888- if (missing.length === 0) return;
8888+ if (!missing.length) return;
8989 throw new Error(`Binding pattern missing ${missing.join(' and ')}`);
9090 }
9191
+2-2
packages/openapi-ts/src/ts-dsl/expr/binary.ts
···52525353 /** Returns true when all required builder calls are present. */
5454 get isValid(): boolean {
5555- return this.missingRequiredCalls().length === 0;
5555+ return !this.missingRequiredCalls().length;
5656 }
57575858 /** Logical AND — `this && expr` */
···152152 _op: Op;
153153 } {
154154 const missing = this.missingRequiredCalls();
155155- if (missing.length === 0) return;
155155+ if (!missing.length) return;
156156 throw new Error(`Binary expression missing ${missing.join(' and ')}`);
157157 }
158158
+2-2
packages/openapi-ts/src/ts-dsl/expr/postfix.ts
···28282929 /** Returns true when all required builder calls are present. */
3030 get isValid(): boolean {
3131- return this.missingRequiredCalls().length === 0;
3131+ return !this.missingRequiredCalls().length;
3232 }
33333434 /** Sets the operator to MinusMinusToken for decrement (`--`). */
···6565 _op: PostfixOp;
6666 } {
6767 const missing = this.missingRequiredCalls();
6868- if (missing.length === 0) return;
6868+ if (!missing.length) return;
6969 throw new Error(`Postfix unary expression missing ${missing.join(' and ')}`);
7070 }
7171
+2-2
packages/openapi-ts/src/ts-dsl/expr/prefix.ts
···28282929 /** Returns true when all required builder calls are present. */
3030 get isValid(): boolean {
3131- return this.missingRequiredCalls().length === 0;
3131+ return !this.missingRequiredCalls().length;
3232 }
33333434 /** Sets the operand (the expression being prefixed). */
···6565 _op: PrefixOp;
6666 } {
6767 const missing = this.missingRequiredCalls();
6868- if (missing.length === 0) return;
6868+ if (!missing.length) return;
6969 throw new Error(`Prefix unary expression missing ${missing.join(' and ')}`);
7070 }
7171
···5959function getAccessChainForNode(node: TsDsl): NodeChain {
6060 const structuralChain = [...getStructuralChainForNode(node, new Set())];
6161 const accessChain = structuralToAccessChain(structuralChain);
6262- if (accessChain.length === 0) {
6262+ if (!accessChain.length) {
6363 // I _think_ this should not happen, but it does and this fix works for now.
6464 // I assume this will cause issues with imports in some cases, investigate
6565 // when it actually happens.
···8383 if (getScope(parent) !== getScope(node)) continue;
84848585 const chain = getStructuralChainForNode(parent, visited);
8686- if (chain.length > 0) return [...chain, node];
8686+ if (chain.length) return [...chain, node];
8787 }
8888 }
8989