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

@funboxteam/diamonds

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@funboxteam/diamonds - npm Package Compare versions

Comparing version 8.0.0 to 8.1.0

5

CHANGELOG.md
# Changelog
## 8.1.0 (19.02.2021)
Support arrays of primitive types in [objectToQueryString](./lib/object-to-query-string.ts).
## 8.0.0 (17.02.2021)

@@ -4,0 +9,0 @@

8

dist/cjs/object-to-query-string.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var join = function (obj) { return Object.keys(obj)
.map(function (key) { return key + "=" + encodeURIComponent(obj[key]); })
.reduce(function (acc, key) {
var value = obj[key];
if (Array.isArray(value)) {
return acc.concat(value.map(function (item) { return key + "=" + encodeURIComponent(item); }));
}
return acc.concat(key + "=" + encodeURIComponent(value));
}, [])
.join('&'); };
exports.default = (function (params) { return "?" + join(params); });
var join = function (obj) { return Object.keys(obj)
.map(function (key) { return key + "=" + encodeURIComponent(obj[key]); })
.reduce(function (acc, key) {
var value = obj[key];
if (Array.isArray(value)) {
return acc.concat(value.map(function (item) { return key + "=" + encodeURIComponent(item); }));
}
return acc.concat(key + "=" + encodeURIComponent(value));
}, [])
.join('&'); };
export default (function (params) { return "?" + join(params); });

2

dist/types/object-to-query-string.d.ts

@@ -1,3 +0,3 @@

declare type QueryStringValue = string | number | boolean;
declare type QueryStringValue = string | number | boolean | (string | number | boolean)[];
declare const _default: (params: Record<string, QueryStringValue>) => string;
export default _default;
{
"name": "@funboxteam/diamonds",
"version": "8.0.0",
"version": "8.1.0",
"description": "A shiny pile of typed JS helpers for everyday use",

@@ -5,0 +5,0 @@ "scripts": {

@@ -242,3 +242,3 @@ # @funboxteam/diamonds

Converts the passed object which contains primitive values into the query string.
Converts the passed object which contains primitive values or arrays of primitive values into the query string.

@@ -245,0 +245,0 @@ ### [omit](./lib/omit.ts)

@@ -249,4 +249,4 @@ # @funboxteam/diamonds

Превращает объект, в котором значения ключей представлены примитивными типами,
в query-строку.
Превращает объект, в котором значения ключей представлены примитивными типами или массивами
примитивных типов, в query-строку.

@@ -253,0 +253,0 @@ ### [omit](./lib/omit.ts)

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