@jsenv/util
Advanced tools
Comparing version 3.11.0 to 4.0.0
@@ -5,5 +5,4 @@ // we won't internalize @jsenv/url-meta | ||
export { | ||
applySpecifierPatternMatching, | ||
metaMapToSpecifierMetaMap, | ||
normalizeSpecifierMetaMap, | ||
applyPatternMatching, | ||
normalizeStructuredMetaMap, | ||
urlCanContainsMetaMatching, | ||
@@ -10,0 +9,0 @@ urlToMeta, |
{ | ||
"name": "@jsenv/util", | ||
"version": "3.11.0", | ||
"version": "4.0.0", | ||
"description": "Set of functions often needed when using Node.js.", | ||
@@ -47,18 +47,17 @@ "license": "MIT", | ||
"@jsenv/cancellation": "2.0.1", | ||
"@jsenv/url-meta": "5.2.3" | ||
"@jsenv/url-meta": "6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@jsenv/assert": "2.2.1", | ||
"@jsenv/codecov-upload": "3.4.2", | ||
"@jsenv/core": "16.2.4", | ||
"@jsenv/eslint-config": "12.6.0", | ||
"@jsenv/codecov-upload": "3.4.3", | ||
"@jsenv/core": "17.1.7", | ||
"@jsenv/eslint-config": "12.8.0", | ||
"@jsenv/github-release-package": "1.2.2", | ||
"@jsenv/node-module-import-map": "12.1.0", | ||
"@jsenv/node-module-import-map": "12.2.1", | ||
"@jsenv/package-publish": "1.5.1", | ||
"@jsenv/prettier-check-project": "5.6.1", | ||
"@jsenv/prettier-config": "1.2.0", | ||
"babel-eslint": "11.0.0-beta.0", | ||
"eslint": "7.12.1", | ||
"prettier": "2.1.2" | ||
"eslint": "7.15.0", | ||
"prettier": "2.2.1" | ||
} | ||
} |
@@ -203,5 +203,5 @@ # util | ||
directoryUrl: "file:///Users/you/directory", | ||
specifierMetaMap: { | ||
"./**/*.js": { | ||
whatever: 42, | ||
structuredMetaMap: { | ||
whatever: { | ||
"./**/*.js": 42, | ||
}, | ||
@@ -208,0 +208,0 @@ }, |
import { createCancellationToken, createOperation } from "@jsenv/cancellation" | ||
import { normalizeSpecifierMetaMap, urlCanContainsMetaMatching, urlToMeta } from "@jsenv/url-meta" | ||
import { normalizeStructuredMetaMap, urlCanContainsMetaMatching, urlToMeta } from "@jsenv/url-meta" | ||
import { ensureUrlTrailingSlash } from "./internal/ensureUrlTrailingSlash.js" | ||
@@ -13,3 +13,3 @@ import { assertAndNormalizeDirectoryUrl } from "./assertAndNormalizeDirectoryUrl.js" | ||
directoryUrl, | ||
specifierMetaMap, | ||
structuredMetaMap, | ||
predicate, | ||
@@ -24,3 +24,6 @@ }) => { | ||
} | ||
const specifierMetaMapNormalized = normalizeSpecifierMetaMap(specifierMetaMap, rootDirectoryUrl) | ||
const structuredMetaMapNormalized = normalizeStructuredMetaMap( | ||
structuredMetaMap, | ||
rootDirectoryUrl, | ||
) | ||
@@ -58,3 +61,3 @@ const visitDirectory = async (directoryUrl) => { | ||
url: subDirectoryUrl, | ||
specifierMetaMap: specifierMetaMapNormalized, | ||
structuredMetaMap: structuredMetaMapNormalized, | ||
predicate, | ||
@@ -78,3 +81,3 @@ }) | ||
url: directoryChildNodeUrl, | ||
specifierMetaMap: specifierMetaMapNormalized, | ||
structuredMetaMap: structuredMetaMapNormalized, | ||
}) | ||
@@ -81,0 +84,0 @@ if (!predicate(meta)) { |
import { createCancellationToken, createOperation } from "@jsenv/cancellation" | ||
import { normalizeSpecifierMetaMap, urlCanContainsMetaMatching, urlToMeta } from "@jsenv/url-meta" | ||
import { normalizeStructuredMetaMap, urlCanContainsMetaMatching, urlToMeta } from "@jsenv/url-meta" | ||
import { assertAndNormalizeDirectoryUrl } from "./assertAndNormalizeDirectoryUrl.js" | ||
@@ -12,3 +12,3 @@ import { readDirectory } from "./readDirectory.js" | ||
directoryUrl, | ||
specifierMetaMap, | ||
structuredMetaMap, | ||
predicate, | ||
@@ -24,3 +24,6 @@ matchingFileOperation = () => null, | ||
} | ||
const specifierMetaMapNormalized = normalizeSpecifierMetaMap(specifierMetaMap, rootDirectoryUrl) | ||
const structuredMetaMapNormalized = normalizeStructuredMetaMap( | ||
structuredMetaMap, | ||
rootDirectoryUrl, | ||
) | ||
@@ -58,3 +61,3 @@ const matchingFileResultArray = [] | ||
url: subDirectoryUrl, | ||
specifierMetaMap: specifierMetaMapNormalized, | ||
structuredMetaMap: structuredMetaMapNormalized, | ||
predicate, | ||
@@ -73,3 +76,3 @@ }) | ||
url: directoryChildNodeUrl, | ||
specifierMetaMap: specifierMetaMapNormalized, | ||
structuredMetaMap: structuredMetaMapNormalized, | ||
}) | ||
@@ -76,0 +79,0 @@ if (!predicate(meta)) return |
/* eslint-disable import/max-dependencies */ | ||
import { readdirSync } from "fs" | ||
import { | ||
metaMapToSpecifierMetaMap, | ||
normalizeSpecifierMetaMap, | ||
urlCanContainsMetaMatching, | ||
urlToMeta, | ||
} from "@jsenv/url-meta" | ||
import { normalizeStructuredMetaMap, urlCanContainsMetaMatching, urlToMeta } from "@jsenv/url-meta" | ||
import { replaceBackSlashesWithSlashes } from "./internal/replaceBackSlashesWithSlashes.js" | ||
@@ -48,8 +43,3 @@ import { fileSystemNodeToTypeOrNull } from "./internal/fileSystemNodeToTypeOrNull.js" | ||
const specifierMetaMap = normalizeSpecifierMetaMap( | ||
metaMapToSpecifierMetaMap({ | ||
watch: watchDescription, | ||
}), | ||
sourceUrl, | ||
) | ||
const structuredMetaMap = normalizeStructuredMetaMap({ watch: watchDescription }, sourceUrl) | ||
const entryShouldBeWatched = ({ relativeUrl, type }) => { | ||
@@ -61,3 +51,3 @@ const entryUrl = resolveUrl(relativeUrl, sourceUrl) | ||
url: `${entryUrl}/`, | ||
specifierMetaMap, | ||
structuredMetaMap, | ||
predicate: ({ watch }) => watch, | ||
@@ -70,3 +60,3 @@ }) | ||
url: entryUrl, | ||
specifierMetaMap, | ||
structuredMetaMap, | ||
}) | ||
@@ -73,0 +63,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
328023
11
4195
+ Added@jsenv/url-meta@6.0.0(transitive)
- Removed@jsenv/url-meta@5.2.3(transitive)
Updated@jsenv/url-meta@6.0.0