Comparing version 1.0.1 to 1.1.0
@@ -0,1 +1,7 @@ | ||
type QueryValue = string | number | undefined | null | Record<string, any>; | ||
type QueryObject = Record<string, QueryValue | QueryValue[]>; | ||
declare function parseQuery(parametersString?: string): QueryObject; | ||
declare function encodeQueryItem(key: string, value: QueryValue | QueryValue[]): string; | ||
declare function stringifyQuery(query: QueryObject): string; | ||
/** | ||
@@ -21,6 +27,6 @@ * Encode characters that need to be encoded on the path, search and hash | ||
* | ||
* @param text - string to encode | ||
* @param input - string to encode | ||
* @returns encoded string | ||
*/ | ||
declare function encodeQueryValue(text: string | number): string; | ||
declare function encodeQueryValue(input: QueryValue): string; | ||
/** | ||
@@ -94,8 +100,2 @@ * Like `encodeQueryValue` but also encodes the `=` character. | ||
type QueryValue = string | undefined | null; | ||
type QueryObject = Record<string, QueryValue | QueryValue[]>; | ||
declare function parseQuery(parametersString?: string): QueryObject; | ||
declare function encodeQueryItem(key: string, value: QueryValue | QueryValue[]): string; | ||
declare function stringifyQuery(query: QueryObject): string; | ||
declare class $URL implements URL { | ||
@@ -127,3 +127,12 @@ protocol: string; | ||
declare function isRelative(inputString: string): boolean; | ||
declare function hasProtocol(inputString: string, acceptProtocolRelative?: boolean): boolean; | ||
interface HasProtocolOptions { | ||
acceptRelative?: boolean; | ||
strict?: boolean; | ||
} | ||
declare function hasProtocol(inputString: string, opts?: HasProtocolOptions): boolean; | ||
/** | ||
* @deprecated | ||
* Same as { hasProtocol(inputString, { acceptRelative: true }) | ||
*/ | ||
declare function hasProtocol(inputString: string, acceptRelative: boolean): boolean; | ||
declare function hasTrailingSlash(input?: string, queryParameters?: boolean): boolean; | ||
@@ -158,2 +167,2 @@ declare function withoutTrailingSlash(input?: string, queryParameters?: boolean): string; | ||
export { $URL, ParsedAuth, ParsedHost, ParsedURL, QueryObject, QueryValue, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, joinURL, normalizeURL, parseAuth, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash }; | ||
export { $URL, HasProtocolOptions, ParsedAuth, ParsedHost, ParsedURL, QueryObject, QueryValue, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, joinURL, normalizeURL, parseAuth, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash }; |
{ | ||
"name": "ufo", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "URL utils for humans", | ||
@@ -21,20 +21,23 @@ "repository": "unjs/ufo", | ||
], | ||
"devDependencies": { | ||
"@types/node": "^18.11.9", | ||
"@vitest/coverage-c8": "^0.25.3", | ||
"eslint": "^8.28.0", | ||
"eslint-config-unjs": "^0.0.2", | ||
"standard-version": "^9.5.0", | ||
"typescript": "^4.9.3", | ||
"unbuild": "^1.0.1", | ||
"vitest": "^0.25.3" | ||
}, | ||
"packageManager": "pnpm@7.17.1", | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "vitest", | ||
"lint": "eslint --ext .ts .", | ||
"release": "pnpm test && standard-version && git push --follow-tags && pnpm publish", | ||
"lint": "eslint --ext .ts . && prettier -c src test", | ||
"lint:fix": "eslint --fix --ext .ts . && prettier -w src test", | ||
"prepack": "pnpm build", | ||
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags", | ||
"test": "pnpm lint && vitest run" | ||
} | ||
} | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.13.0", | ||
"@vitest/coverage-c8": "^0.28.5", | ||
"changelogen": "^0.4.1", | ||
"eslint": "^8.34.0", | ||
"eslint-config-unjs": "^0.1.0", | ||
"prettier": "^2.8.4", | ||
"typescript": "^4.9.5", | ||
"unbuild": "^1.1.1", | ||
"vitest": "^0.28.5" | ||
}, | ||
"packageManager": "pnpm@7.27.0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43110
1135
9