@platform/util.string
Advanced tools
Comparing version 0.3.27 to 0.4.0
export declare type UrlQuery = Record<string, string | string[] | number | boolean | undefined>; | ||
export declare function toObject<T>(queryString?: string): T; | ||
export declare function toObject<T>(href?: string): T; | ||
export declare function valueAsFlag<T>(value?: string | string[] | number | boolean): T; | ||
export declare function isFlag(keys: string | string[] | undefined, query?: UrlQuery): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var common_1 = require("../common"); | ||
function toObject(queryString) { | ||
function toObject(href) { | ||
var EMPTY = {}; | ||
if (!queryString) { | ||
if (!href) { | ||
return EMPTY; | ||
} | ||
if (!queryString.trim()) { | ||
if (!href.trim()) { | ||
return EMPTY; | ||
} | ||
var text = queryString.trim(); | ||
href = href.trim(); | ||
href = href.includes('?') ? href.substring(href.indexOf('?')) : href; | ||
var text = href; | ||
text = !text.startsWith('?') ? text : text.substring(1); | ||
@@ -14,0 +16,0 @@ text = !text.startsWith('#') ? text : text.substring(1); |
{ | ||
"name": "@platform/util.string", | ||
"version": "0.3.27", | ||
"version": "0.4.0", | ||
"description": "String helpers.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
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
32486
901