You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 637B

12345678910111213141516171819202122232425262728293031
  1. declare namespace findVersions {
  2. interface Options {
  3. /**
  4. Also match non-semver versions like `1.88`. They're coerced into semver compliant versions.
  5. @default false
  6. */
  7. readonly loose?: boolean;
  8. }
  9. }
  10. /**
  11. Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`.
  12. @example
  13. ```
  14. import findVersions = require('find-versions');
  15. findVersions('unicorn v1.2.3 rainbow 2.3.4+build.1');
  16. //=> ['1.2.3', '2.3.4+build.1']
  17. findVersions('cp (GNU coreutils) 8.22', {loose: true});
  18. //=> ['8.22.0']
  19. ```
  20. */
  21. declare function findVersions(
  22. stringWithVersions: string,
  23. options?: findVersions.Options
  24. ): string[];
  25. export = findVersions;