Update packages, change to node16

This commit is contained in:
Lucas Costi
2022-04-05 10:05:12 +10:00
parent ab59b778e5
commit a8dd2c1169
542 changed files with 66325 additions and 65198 deletions

View File

@ -7,13 +7,9 @@ export function addQueryParameters(url, parameters) {
return (url +
separator +
names
.map(name => {
.map((name) => {
if (name === "q") {
return ("q=" +
parameters
.q.split("+")
.map(encodeURIComponent)
.join("+"));
return ("q=" + parameters.q.split("+").map(encodeURIComponent).join("+"));
}
return `${name}=${encodeURIComponent(parameters[name])}`;
})

View File

@ -1,7 +1,7 @@
import isPlainObject from "is-plain-object";
import { isPlainObject } from "is-plain-object";
export function mergeDeep(defaults, options) {
const result = Object.assign({}, defaults);
Object.keys(options).forEach(key => {
Object.keys(options).forEach((key) => {
if (isPlainObject(options[key])) {
if (!(key in defaults))
Object.assign(result, { [key]: options[key] });

View File

@ -1,6 +1,6 @@
export function omit(object, keysToOmit) {
return Object.keys(object)
.filter(option => !keysToOmit.includes(option))
.filter((option) => !keysToOmit.includes(option))
.reduce((obj, key) => {
obj[key] = object[key];
return obj;

View File

@ -0,0 +1,8 @@
export function removeUndefinedProperties(obj) {
for (const key in obj) {
if (obj[key] === undefined) {
delete obj[key];
}
}
return obj;
}

View File

@ -29,9 +29,7 @@ function encodeReserved(str) {
.split(/(%[0-9A-Fa-f]{2})/g)
.map(function (part) {
if (!/%[0-9A-Fa-f]/.test(part)) {
part = encodeURI(part)
.replace(/%5B/g, "[")
.replace(/%5D/g, "]");
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
}
return part;
})
@ -39,11 +37,7 @@ function encodeReserved(str) {
}
function encodeUnreserved(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return ("%" +
c
.charCodeAt(0)
.toString(16)
.toUpperCase());
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
});
}
function encodeValue(operator, value, key) {
@ -132,7 +126,7 @@ function getValues(context, operator, key, modifier) {
}
export function parseUrl(template) {
return {
expand: expand.bind(null, template)
expand: expand.bind(null, template),
};
}
function expand(template, context) {