Socket
Socket
Sign inDemoInstall

@platform/util.string

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/util.string - npm Package Compare versions

Comparing version 0.3.27 to 0.4.0

2

lib/queryString/queryString.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc