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

@jsenv/url-meta

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/url-meta - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

17

dist/commonjs/main.js

@@ -436,10 +436,23 @@ 'use strict';

var assertSpecifierMetaMap = function assertSpecifierMetaMap(value) {
var checkComposition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (!isPlainObject(value)) {
throw new TypeError("specifierMetaMap must be a plain object, got ".concat(value));
} // we could ensure it's key/value pair of url like key/object or null values
}
if (checkComposition) {
var plainObject = value;
Object.keys(plainObject).forEach(function (key) {
assertUrlLike(key, "specifierMetaMap key");
var value = plainObject[key];
if (value !== null && !isPlainObject(value)) {
throw new TypeError("specifierMetaMap value must be a plain object or null, got ".concat(value, " under key ").concat(key));
}
});
}
};
var normalizeSpecifierMetaMap = function normalizeSpecifierMetaMap(specifierMetaMap, url) {
assertSpecifierMetaMap(specifierMetaMap);
assertSpecifierMetaMap(specifierMetaMap, false);
assertUrlLike(url, "url");

@@ -446,0 +459,0 @@

2

package.json
{
"name": "@jsenv/url-meta",
"version": "5.1.0",
"version": "5.1.1",
"description": "Associate data to urls using patterns.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -58,3 +58,3 @@ # url-meta

```console
npm install @jsenv/url-meta@5.1.0
npm install @jsenv/url-meta@5.1.1
```

@@ -61,0 +61,0 @@

import { isPlainObject } from "./isPlainObject.js"
import { assertUrlLike } from "./assertUrlLike.js"
export const assertSpecifierMetaMap = (value) => {
export const assertSpecifierMetaMap = (value, checkComposition = true) => {
if (!isPlainObject(value)) {
throw new TypeError(`specifierMetaMap must be a plain object, got ${value}`)
}
// we could ensure it's key/value pair of url like key/object or null values
if (checkComposition) {
const plainObject = value
Object.keys(plainObject).forEach((key) => {
assertUrlLike(key, "specifierMetaMap key")
const value = plainObject[key]
if (value !== null && !isPlainObject(value)) {
throw new TypeError(
`specifierMetaMap value must be a plain object or null, got ${value} under key ${key}`,
)
}
})
}
}

@@ -5,3 +5,3 @@ import { assertSpecifierMetaMap } from "./internal/assertSpecifierMetaMap.js"

export const normalizeSpecifierMetaMap = (specifierMetaMap, url, ...rest) => {
assertSpecifierMetaMap(specifierMetaMap)
assertSpecifierMetaMap(specifierMetaMap, false)
assertUrlLike(url, "url")

@@ -8,0 +8,0 @@ if (rest.length) {

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