Giter Club home page Giter Club logo

goturl's People

Contributors

gamote avatar

Watchers

 avatar

goturl's Issues

Feature Request: Expose `ExtractUrlOptions` Type for Import in Projects

Hello,

I am currently utilizing the function extractUrl in my project, which leverages the goturl package for URL extraction from strings. This function is incredibly useful for parsing and manipulating URLs within our data processing workflows. However, I've encountered a limitation regarding the ExtractUrlOptions type, which is utilized for configuring the extractUrl function's behavior.

As of now, the ExtractUrlOptions type is not explicitly exported or made available for import in consumer projects. This restriction poses a challenge for type safety and code readability, especially in TypeScript projects where leveraging explicit types is a best practice. The ability to import ExtractUrlOptions would greatly enhance the developer experience by providing direct access to the type definitions, enabling better integration and utilization of the extractUrl function within TypeScript environments.

Therefore, I kindly request the addition of an export statement for the ExtractUrlOptions type. This change would allow developers to import the type directly into their projects, thus promoting better type checking and facilitating more robust and maintainable code.

Here is a brief overview of the current implementation that highlights the absence of an export for ExtractUrlOptions:

type ExtractUrlOptions = {
    getLongestUrl?: boolean;
    tryFixProtocol?: boolean;
    fallbackProtocol?: string;
};
/**
 * This method is going to extract the first url found in the input string
 * using the {@link urlRegexSafe} from the `url-regex-safe` package.
 *
 * @param input
 * @param options
 */
declare const extractUrl: (input: unknown, options?: ExtractUrlOptions) => null | string;

export { extractUrl };


Exposing ExtractUrlOptions would not only facilitate type safety but also encourage the adoption of best practices by enabling developers to leverage the full capabilities of TypeScript's type system.

Thank you for considering this feature request. I believe that making ExtractUrlOptions publicly available would be a valuable enhancement for all users of the goturl package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.