Skip to content

getObject() for Yup reports types of DefinitelyTyped #1089

@karlhorky

Description

@karlhorky

Hi @Haroenv and other maintainers 👋 Hope you are well! Thanks again for your continued effort on the projects in the Algolia ecosystem!

I'm not sure if I'm reporting this in the right place, but I wanted to reach out about what appears to be a data problem with npm-search index (we've only seen a single library so far):

Running index.getObject() with the package name yup returns the following:

{
  types: {
    ts: 'definitely-typed',
    definitelyTyped: '@types/yup',
  },
}

However, on the npm website, the yup package is reported as having built-in types and the @types/yup package has been deprecated:

Screenshot 2022-12-05 at 19 58 19

Screenshot 2022-12-05 at 19 59 46

Both the current version and the beta version of yup have no "types" or "typings" keys in the package.json:

For the current [email protected], there is however no index.d.ts in the root:

But there is one in [email protected]:

Is the npm website or Algolia's index wrong? (seems like npm website is wrong 🤔)


Our usage:

const client = algoliasearch(
  'XXX',
  'xxxxxxxxxxx',
);

const index = client.initIndex('npm-search');

const results = await index.getObject<AlgoliaObj>(dependency, {
  attributesToRetrieve: ['types'],
});

const definitelyTypedPackageName = results.types?.definitelyTyped;

https://github.com/upleveled/preflight/blob/5af8a398ec370c79e22ab770307ec81d574c8e29/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts#L63-L67

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions