@drskillissue/ganko 0.3.0 → 0.3.1

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.
@@ -3101,6 +3101,7 @@ var TypeResolver = class {
3101
3101
  checkPropertyOnType(tsType, propertyName) {
3102
3102
  const property = tsType.getProperty(propertyName);
3103
3103
  if (property !== void 0) return true;
3104
+ if (this.checker.getIndexTypeOfType(tsType, ts2.IndexKind.String) !== void 0) return true;
3104
3105
  if (tsType.isUnion()) {
3105
3106
  for (const constituent of tsType.types) {
3106
3107
  const flags = constituent.flags;
@@ -9493,7 +9494,22 @@ function isObjectLiteralTarget(graph, pa) {
9493
9494
  const variable = getVariableByNameInScope(graph, obj.text, pa.scope);
9494
9495
  if (!variable) return false;
9495
9496
  const init = variable.initializer;
9496
- return init !== null && ts32.isObjectLiteralExpression(init);
9497
+ if (init === null || !ts32.isObjectLiteralExpression(init)) return false;
9498
+ if (propertyExistsInLiteral(init, pa)) return false;
9499
+ return true;
9500
+ }
9501
+ function propertyExistsInLiteral(literal, pa) {
9502
+ let propName = null;
9503
+ if (!pa.computed && ts32.isIdentifier(pa.property)) propName = pa.property.text;
9504
+ else if (ts32.isStringLiteral(pa.property)) propName = pa.property.text;
9505
+ if (propName === null) return false;
9506
+ for (let i = 0; i < literal.properties.length; i++) {
9507
+ const prop = literal.properties[i];
9508
+ if (!prop) continue;
9509
+ if (ts32.isPropertyAssignment(prop) && ts32.isIdentifier(prop.name) && prop.name.text === propName) return true;
9510
+ if (ts32.isShorthandPropertyAssignment(prop) && prop.name.text === propName) return true;
9511
+ }
9512
+ return false;
9497
9513
  }
9498
9514
  function getMemberAccessesOnIdentifier(fn, identifierName) {
9499
9515
  const cache = fn._memberAccessesByIdentifier;
@@ -27723,4 +27739,4 @@ export {
27723
27739
  buildCSSResult,
27724
27740
  rules2
27725
27741
  };
27726
- //# sourceMappingURL=chunk-2VRVUMIE.js.map
27742
+ //# sourceMappingURL=chunk-AXFVBCJD.js.map