@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.
@@ -2999,6 +2999,7 @@ var TypeResolver = class {
2999
2999
  checkPropertyOnType(tsType, propertyName) {
3000
3000
  const property = tsType.getProperty(propertyName);
3001
3001
  if (property !== void 0) return true;
3002
+ if (this.checker.getIndexTypeOfType(tsType, import_typescript2.default.IndexKind.String) !== void 0) return true;
3002
3003
  if (tsType.isUnion()) {
3003
3004
  for (const constituent of tsType.types) {
3004
3005
  const flags = constituent.flags;
@@ -9275,7 +9276,22 @@ function isObjectLiteralTarget(graph, pa) {
9275
9276
  const variable = getVariableByNameInScope(graph, obj.text, pa.scope);
9276
9277
  if (!variable) return false;
9277
9278
  const init = variable.initializer;
9278
- return init !== null && import_typescript34.default.isObjectLiteralExpression(init);
9279
+ if (init === null || !import_typescript34.default.isObjectLiteralExpression(init)) return false;
9280
+ if (propertyExistsInLiteral(init, pa)) return false;
9281
+ return true;
9282
+ }
9283
+ function propertyExistsInLiteral(literal, pa) {
9284
+ let propName = null;
9285
+ if (!pa.computed && import_typescript34.default.isIdentifier(pa.property)) propName = pa.property.text;
9286
+ else if (import_typescript34.default.isStringLiteral(pa.property)) propName = pa.property.text;
9287
+ if (propName === null) return false;
9288
+ for (let i = 0; i < literal.properties.length; i++) {
9289
+ const prop = literal.properties[i];
9290
+ if (!prop) continue;
9291
+ if (import_typescript34.default.isPropertyAssignment(prop) && import_typescript34.default.isIdentifier(prop.name) && prop.name.text === propName) return true;
9292
+ if (import_typescript34.default.isShorthandPropertyAssignment(prop) && prop.name.text === propName) return true;
9293
+ }
9294
+ return false;
9279
9295
  }
9280
9296
  function getMemberAccessesOnIdentifier(fn, identifierName) {
9281
9297
  const cache = fn._memberAccessesByIdentifier;