Socket
Socket
Sign inDemoInstall

@ui5/fs

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ui5/fs - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

9

CHANGELOG.md

@@ -5,4 +5,10 @@ # Changelog

A list of unreleased changes can be found [here](https://github.com/SAP/ui5-fs/compare/v2.0.0...HEAD).
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-fs/compare/v2.0.1...HEAD).
<a name="v2.0.1"></a>
## [v2.0.1] - 2020-04-29
### Bug Fixes
- Namespaces in API Reference (JSDoc) [`b9d7b3c`](https://github.com/SAP/ui5-fs/commit/b9d7b3c70679436e6cbea07a789ac5e83bab337a)
<a name="v2.0.0"></a>

@@ -89,2 +95,3 @@ ## [v2.0.0] - 2020-03-31

[v2.0.1]: https://github.com/SAP/ui5-fs/compare/v2.0.0...v2.0.1
[v2.0.0]: https://github.com/SAP/ui5-fs/compare/v1.1.2...v2.0.0

@@ -91,0 +98,0 @@ [v1.1.2]: https://github.com/SAP/ui5-fs/compare/v1.1.1...v1.1.2

8

index.js

@@ -8,5 +8,4 @@ /**

* @public
* @see module:@ui5/fs.adapters.AbstractAdapter
* @see module:@ui5/fs.adapters.FileSystem
* @see module:@ui5/fs.adapters.Memory
* @alias module:@ui5/fs.adapters
* @namespace
*/

@@ -28,5 +27,6 @@ adapters: {

const hasOwnProperty = Object.prototype.hasOwnProperty;
function exportModules(exportRoot, modulePaths) {
for (const moduleName in modulePaths) {
if (modulePaths.hasOwnProperty(moduleName)) {
if (hasOwnProperty.call(modulePaths, moduleName)) {
if (typeof modulePaths[moduleName] === "object") {

@@ -33,0 +33,0 @@ exportRoot[moduleName] = {};

@@ -34,3 +34,3 @@ const randomInt = require("random-int");

* virtual directory structure
* @param {Object} [options] glob options
* @param {object} [options] glob options
* @param {boolean} [options.nodir=true] Do not match directories

@@ -62,3 +62,3 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving to list of resources

* @param {string} virPath Virtual path
* @param {Object} [options] Options
* @param {object} [options] Options
* @param {boolean} [options.nodir=true] Do not match directories

@@ -82,3 +82,3 @@ * @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource

* glob patterns for virtual directory structure
* @param {Object} options glob options
* @param {object} options glob options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -97,3 +97,3 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving to list of resources

* @param {string} pattern glob pattern
* @param {Object} options glob options
* @param {object} options glob options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -112,6 +112,7 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving to list of resources

* @param {string} virPath Virtual path
* @param {object} options Options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance
* @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource
*/
_byPath(virPath, trace) {
_byPath(virPath, options, trace) {
throw new Error("Not implemented");

@@ -118,0 +119,0 @@ }

@@ -29,3 +29,3 @@ const AbstractReader = require("./AbstractReader");

* @param {module:@ui5/fs.Resource} resource Resource to write
* @param {Object} [options]
* @param {object} [options]
* @param {boolean} [options.readOnly=false] Whether the resource content shall be written read-only

@@ -53,3 +53,3 @@ * Do not use in conjunction with the <code>drain</code> option.

* @param {module:@ui5/fs.Resource} resource Resource to write
* @param {Object} [options] Write options, see above
* @param {object} [options] Write options, see above
* @returns {Promise<undefined>} Promise resolving once data has been written

@@ -56,0 +56,0 @@ */

@@ -20,3 +20,3 @@ const log = require("@ui5/logger").getLogger("resources:adapters:AbstractAdapter");

* @public
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {string} parameters.virBasePath Virtual base path

@@ -43,3 +43,3 @@ * @param {string[]} [parameters.excludes] List of glob patterns to exclude

* glob patterns for virtual directory structure
* @param {Object} [options={}] glob options
* @param {object} [options={}] glob options
* @param {boolean} [options.nodir=true] Do not match directories

@@ -46,0 +46,0 @@ * @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -21,3 +21,3 @@ const log = require("@ui5/logger").getLogger("resources:adapters:FileSystem");

*
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {string} parameters.virBasePath Virtual base path

@@ -37,3 +37,3 @@ * @param {string} parameters.fsBasePath (Physical) File system path

* @param {Array} patterns Array of glob patterns
* @param {Object} [options={}] glob options
* @param {object} [options={}] glob options
* @param {boolean} [options.nodir=true] Do not match directories

@@ -115,3 +115,3 @@ * @param {module:@ui5/fs.tracing.Trace} trace Trace instance

* @param {string} virPath Virtual path
* @param {Object} options Options
* @param {object} options Options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -183,3 +183,3 @@ * @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource or null if not found

* @param {module:@ui5/fs.Resource} resource Resource to write
* @param {Object} [options]
* @param {object} [options]
* @param {boolean} [options.readOnly] Whether the resource content shall be written read-only

@@ -186,0 +186,0 @@ * Do not use in conjunction with the <code>drain</code> option.

@@ -18,3 +18,3 @@ const log = require("@ui5/logger").getLogger("resources:adapters:Memory");

* @public
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {string} parameters.virBasePath Virtual base path

@@ -34,3 +34,3 @@ * @param {string[]} [parameters.excludes] List of glob patterns to exclude

* @param {Array} patterns array of glob patterns
* @param {Object} [options={}] glob options
* @param {object} [options={}] glob options
* @param {boolean} [options.nodir=true] Do not match directories

@@ -81,3 +81,3 @@ * @param {module:@ui5/fs.tracing.Trace} trace Trace instance

* @param {string} virPath Virtual path
* @param {Object} options Options
* @param {object} options Options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -84,0 +84,0 @@ * @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource

@@ -15,3 +15,3 @@ const AbstractReaderWriter = require("./AbstractReaderWriter");

*
* @param {Object} parameters
* @param {object} parameters
* @param {module:@ui5/fs.AbstractReader} parameters.reader Single reader or collection of readers

@@ -41,3 +41,3 @@ * @param {module:@ui5/fs.AbstractReaderWriter} parameters.writer A ReaderWriter instance which is only used for writing files

* glob patterns for virtual directory structure
* @param {Object} options glob options
* @param {object} options glob options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -55,3 +55,3 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving with a list of resources

* @param {string} virPattern glob pattern for virtual directory structure
* @param {Object} [options] glob options
* @param {object} [options] glob options
* @param {boolean} [options.nodir=true] Do not match directories

@@ -75,3 +75,3 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving to list of resources

* @param {string} virPath Virtual path
* @param {Object} options Options
* @param {object} options Options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -78,0 +78,0 @@ * @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource

@@ -8,3 +8,3 @@ /**

*
* @returns {Object} Object with [Node.js fs]{@link https://nodejs.org/api/fs.html} styled functions
* @returns {object} Object with [Node.js fs]{@link https://nodejs.org/api/fs.html} styled functions
* [<code>readFile</code>]{@link https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback},

@@ -11,0 +11,0 @@ * [<code>stat</code>]{@link https://nodejs.org/api/fs.html#fs_fs_stat_path_options_callback},

@@ -14,3 +14,3 @@ const AbstractReader = require("./AbstractReader");

*
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {module:@ui5/fs.AbstractReader[]} parameters.readers List of resource readers (all tried in parallel)

@@ -31,3 +31,3 @@ * @param {string} parameters.name The collection name

* glob patterns for virtual directory structure
* @param {Object} options glob options
* @param {object} options glob options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -50,3 +50,3 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving to list of resources

* @param {string} virPath Virtual path
* @param {Object} options Options
* @param {object} options Options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -53,0 +53,0 @@ * @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource

@@ -14,3 +14,3 @@ const AbstractReader = require("./AbstractReader");

*
* @param {Object} parameters
* @param {object} parameters
* @param {string} parameters.name The collection name

@@ -32,3 +32,3 @@ * @param {module:@ui5/fs.AbstractReader[]} parameters.readers Prioritized list of resource readers

* glob patterns for virtual directory structure
* @param {Object} options glob options
* @param {object} options glob options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -65,3 +65,3 @@ * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving to list of resources

* @param {string} virPath Virtual path
* @param {Object} options Options
* @param {object} options Options
* @param {module:@ui5/fs.tracing.Trace} trace Trace instance

@@ -68,0 +68,0 @@ * @returns {Promise<module:@ui5/fs.Resource>} Promise resolving to a single resource

@@ -27,5 +27,5 @@ const stream = require("stream");

* @public
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {string} parameters.path Virtual path
* @param {fs.Stats|Object} [parameters.statInfo] File information. Instance of
* @param {fs.Stats|object} [parameters.statInfo] File information. Instance of
* [fs.Stats]{@link https://nodejs.org/api/fs.html#fs_class_fs_stats} or similar object

@@ -236,3 +236,3 @@ * @param {Buffer} [parameters.buffer] Content of this resources as a Buffer instance

* @public
* @returns {fs.Stats|Object} Instance of [fs.Stats]{@link https://nodejs.org/api/fs.html#fs_class_fs_stats}
* @returns {fs.Stats|object} Instance of [fs.Stats]{@link https://nodejs.org/api/fs.html#fs_class_fs_stats}
* or similar object

@@ -292,3 +292,3 @@ */

*
* @returns {Object} Trace tree
* @returns {object} Trace tree
*/

@@ -295,0 +295,0 @@ getPathTree() {

@@ -9,2 +9,3 @@ const log = require("@ui5/logger").getLogger("resources:resourceFactory");

const Resource = require("./Resource");
const hasOwnProperty = Object.prototype.hasOwnProperty;

@@ -24,3 +25,3 @@ /**

* @callback module:@ui5/fs.resourceFactory~getProjectExcludes
* @param {Object} Project
* @param {object} Project
* @returns {string[]} List of glob patterns to exclude

@@ -34,5 +35,5 @@ */

* @callback module:@ui5/fs.resourceFactory~getVirtualBasePathPrefix
* @param {Object} parameters Parameters
* @param {Object} parameters.project Project
* @param {Object} parameters.virBasePath virtual base path to prefix
* @param {object} parameters Parameters
* @param {object} parameters.project Project
* @param {object} parameters.virBasePath virtual base path to prefix
* @returns {string} Prefix for the virtual base path

@@ -51,4 +52,4 @@ */

* @public
* @param {Object} tree A (sub-)tree
* @param {Object} [parameters] Parameters
* @param {object} tree A (sub-)tree
* @param {object} [parameters] Parameters
* @param {module:@ui5/fs.resourceFactory~getProjectExcludes} [parameters.getProjectExcludes]

@@ -58,3 +59,3 @@ * Callback to retrieve the exclude globs of a project

* Callback to retrieve a prefix for a given virtual base path of a project if required
* @returns {Object} Object containing <code>source</code> and <code>dependencies</code> resource readers
* @returns {object} Object containing <code>source</code> and <code>dependencies</code> resource readers
*/

@@ -77,3 +78,3 @@ createCollectionsForTree(tree, {

for (const virBasePath in project.resources.pathMappings) {
if (project.resources.pathMappings.hasOwnProperty(virBasePath)) {
if (hasOwnProperty.call(project.resources.pathMappings, virBasePath)) {
// Prevent duplicate dependency resource locators

@@ -120,3 +121,3 @@ const fsPath = project.resources.pathMappings[virBasePath];

for (const virBasePath in tree.resources.pathMappings) {
if (tree.resources.pathMappings.hasOwnProperty(virBasePath)) {
if (hasOwnProperty.call(tree.resources.pathMappings, virBasePath)) {
// Create an fs adapter for every path mapping

@@ -156,3 +157,3 @@ const fsAdapter = resourceFactory._createFsAdapterForVirtualBasePath({

*
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {Project} parameters.project A project

@@ -233,3 +234,3 @@ * @param {string} parameters.virBasePath Virtual base path to create the adapter for

* @public
* @param {Object} parameters Parameters
* @param {object} parameters Parameters
* @param {string} parameters.virBasePath Virtual base path

@@ -253,3 +254,3 @@ * @param {string} [parameters.fsBasePath] File system base path

* @public
* @param {Object} parameters Parameters to be passed to the resource constructor
* @param {object} parameters Parameters to be passed to the resource constructor
* @returns {module:@ui5/fs.Resource} Resource

@@ -269,3 +270,3 @@ */

* @public
* @param {Object} parameters
* @param {object} parameters
* @param {module:@ui5/fs.AbstractReader} parameters.reader The reader

@@ -272,0 +273,0 @@ * @param {string} [parameters.name="vir & fs source"] Name of the collection

@@ -6,2 +6,3 @@ const log = require("@ui5/logger").getLogger("resources:tracing:Trace");

const summaryTrace = require("./traceSummary");
const hasOwnProperty = Object.prototype.hasOwnProperty;

@@ -63,3 +64,3 @@ /**

for (const coll in this._collections) {
if (this._collections.hasOwnProperty(coll)) {
if (hasOwnProperty.call(this._collections, coll)) {
report += ` ${this._collections[coll].calls}x ${coll}\n`;

@@ -66,0 +67,0 @@ }

const log = require("@ui5/logger").getLogger("resources:tracing:total");
const prettyHrtime = require("pretty-hrtime");
const hasOwnProperty = Object.prototype.hasOwnProperty;
let timeoutId;

@@ -41,3 +42,3 @@ let active = false;

for (const coll in traceData.collections) {
if (traceData.collections.hasOwnProperty(coll)) {
if (hasOwnProperty.call(traceData.collections, coll)) {
report += ` ${traceData.collections[coll].calls}x ${coll}\n`;

@@ -44,0 +45,0 @@ }

{
"name": "@ui5/fs",
"version": "2.0.0",
"version": "2.0.1",
"description": "UI5 Tooling - File System Abstraction",

@@ -29,3 +29,3 @@ "author": "SAP SE (https://www.sap.com)",

"unit-xunit": "rimraf test/tmp && ava --tap | tap-xunit --dontUseCommentsAsTestNames=true > test-results.xml",
"unit-inspect": "cross-env UI5_LOG_LVL=verbose node --inspect-brk node_modules/ava/profile.js",
"unit-inspect": "cross-env UI5_LOG_LVL=verbose ava debug --break",
"coverage": "nyc npm run unit",

@@ -52,5 +52,4 @@ "coverage-xunit": "nyc --reporter=text --reporter=text-summary --reporter=cobertura npm run unit-xunit",

],
"sources": [
"lib/**/*.js",
"test/lib/**/*.js"
"ignoredByWatcher": [
"test/tmp/**"
]

@@ -106,3 +105,3 @@ },

"graceful-fs": "^4.2.3",
"make-dir": "^3.0.2",
"make-dir": "^3.1.0",
"micromatch": "^4.0.2",

@@ -116,17 +115,17 @@ "minimatch": "^3.0.3",

"devDependencies": {
"ava": "^2.4.0",
"ava": "^3.8.1",
"chai": "^4.1.2",
"chai-fs": "^2.0.0",
"chokidar-cli": "^2.1.0",
"coveralls": "^3.0.11",
"coveralls": "^3.1.0",
"cross-env": "^7.0.2",
"docdash": "^1.2.0",
"eslint": "^5.16.0",
"eslint": "^6.8.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-jsdoc": "^4.8.4",
"jsdoc": "^3.6.3",
"nyc": "^15.0.0",
"eslint-plugin-jsdoc": "^24.0.0",
"jsdoc": "^3.6.4",
"nyc": "^15.0.1",
"open-cli": "^6.0.1",
"rimraf": "^3.0.2",
"sinon": "^9.0.1",
"sinon": "^9.0.2",
"tap-nyan": "^1.1.0",

@@ -133,0 +132,0 @@ "tap-xunit": "^2.4.1"

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