gamote / goturl Goto Github PK
View Code? Open in Web Editor NEWThe library that tries to do its best to extract urls from strings.
The library that tries to do its best to extract urls from strings.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.