Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinypudding/puddy-lib

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinypudding/puddy-lib - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

get/queryUrlByName.js

32

get/pagination.js

@@ -1,35 +0,5 @@

// Get JSON From URL
const getJsonFromUrl = function (url) {
if (!url) url = location.href;
var question = url.indexOf("?");
var hash = url.indexOf("#");
if (hash === -1 && question === -1) return {};
if (hash === -1) hash = url.length;
var query = question === -1 || hash === question + 1 ? url.substring(hash) :
url.substring(question + 1, hash);
var result = {};
query.split("&").forEach((part) => {
if (!part) return;
part = part.split("+").join(" "); // replace every + with space, regexp-free version
var eq = part.indexOf("=");
var key = eq > -1 ? part.substr(0, eq) : part;
var val = eq > -1 ? decodeURIComponent(part.substr(eq + 1)) : "";
var from = key.indexOf("[");
if (from === -1) result[decodeURIComponent(key)] = val;
else {
var to = key.indexOf("]", from);
var index = decodeURIComponent(key.substring(from + 1, to));
key = decodeURIComponent(key.substring(0, from));
if (!result[key]) result[key] = [];
if (!index) result[key].push(val);
else result[key][index] = val;
}
});
return result;
};
module.exports = function (query, page, total, url = '', extraClass = '', extraClass2 = '') {
if (url) {
const params = getJsonFromUrl(url);
const params = require('../get/queryUrlJSON')(url);
if (Object.keys(params).length > 0) {

@@ -36,0 +6,0 @@ if (params.page) {

@@ -49,7 +49,8 @@ // Modules

// Get URL Parameter by Name
'getURLParameterByName': require('./http/getParameterByName'),
// Get URL Parameter
'getQueryUrlByName': require('./get/queryUrlByName'),
'getQueryUrlJSON': require('./get/queryUrlJSON'),
// Percentage
'percentage': require('./get/percentage'),
'percentage': require('./libs/percentage'),

@@ -56,0 +57,0 @@ // Fetch

{
"name": "@tinypudding/puddy-lib",
"version": "1.1.3",
"version": "1.1.4",
"description": "Essential codes to run the other repositories from the Tiny Pudding Account.",

@@ -5,0 +5,0 @@ "main": "index.js",

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