From 69280babdcc58cd18545a471c4c21bf4c01207ee Mon Sep 17 00:00:00 2001 From: Samuel Kubai Date: Mon, 6 Sep 2021 09:48:30 +0300 Subject: [PATCH 1/5] debug: add debug statement --- bindings.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bindings.js b/bindings.js index 226b37f..481fd10 100644 --- a/bindings.js +++ b/bindings.js @@ -167,6 +167,9 @@ exports.getFileName = function getFileName(calling_file) { } }; + // TODO: Remove this debug statement + console.log(`Bindings: getFileName() => fileName:${fileName}`); + // run the 'prepareStackTrace' function above Error.captureStackTrace(dummy); dummy.stack; From 690b13a608e15aa894a138aa6664b0d877018061 Mon Sep 17 00:00:00 2001 From: Samuel Kubai Date: Mon, 6 Sep 2021 12:17:56 +0300 Subject: [PATCH 2/5] feat: avoid undefined file names --- bindings.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bindings.js b/bindings.js index 481fd10..0b94d0c 100644 --- a/bindings.js +++ b/bindings.js @@ -155,7 +155,7 @@ exports.getFileName = function getFileName(calling_file) { Error.prepareStackTrace = function(e, st) { for (var i = 0, l = st.length; i < l; i++) { fileName = st[i].getFileName(); - if (fileName !== __filename) { + if (fileName !== undefined && fileName !== __filename) { if (calling_file) { if (fileName !== calling_file) { return; @@ -167,9 +167,6 @@ exports.getFileName = function getFileName(calling_file) { } }; - // TODO: Remove this debug statement - console.log(`Bindings: getFileName() => fileName:${fileName}`); - // run the 'prepareStackTrace' function above Error.captureStackTrace(dummy); dummy.stack; From 211ea0cd693b8203f642d95ae27381589798ee53 Mon Sep 17 00:00:00 2001 From: Samuel Kubai Date: Wed, 8 Sep 2021 15:19:08 +0300 Subject: [PATCH 3/5] feat: add user defined tries --- bindings.js | 5 ++ node_modules/file-uri-to-path/.npmignore | 1 + node_modules/file-uri-to-path/.travis.yml | 30 ++++++++ node_modules/file-uri-to-path/History.md | 21 ++++++ node_modules/file-uri-to-path/LICENSE | 20 +++++ node_modules/file-uri-to-path/README.md | 74 +++++++++++++++++++ node_modules/file-uri-to-path/index.d.ts | 2 + node_modules/file-uri-to-path/index.js | 66 +++++++++++++++++ node_modules/file-uri-to-path/package.json | 64 ++++++++++++++++ node_modules/file-uri-to-path/test/test.js | 24 ++++++ node_modules/file-uri-to-path/test/tests.json | 13 ++++ 11 files changed, 320 insertions(+) create mode 100644 node_modules/file-uri-to-path/.npmignore create mode 100644 node_modules/file-uri-to-path/.travis.yml create mode 100644 node_modules/file-uri-to-path/History.md create mode 100644 node_modules/file-uri-to-path/LICENSE create mode 100644 node_modules/file-uri-to-path/README.md create mode 100644 node_modules/file-uri-to-path/index.d.ts create mode 100644 node_modules/file-uri-to-path/index.js create mode 100644 node_modules/file-uri-to-path/package.json create mode 100644 node_modules/file-uri-to-path/test/test.js create mode 100644 node_modules/file-uri-to-path/test/tests.json diff --git a/bindings.js b/bindings.js index 0b94d0c..3ad138d 100644 --- a/bindings.js +++ b/bindings.js @@ -81,6 +81,11 @@ function bindings(opts) { if (!opts.module_root) { opts.module_root = exports.getRoot(exports.getFileName()); } + + // Add the user defined tries + if (opts.userDefinedTries) { + opts.try = opts.try.concat(opts.userDefinedTries); + } // Ensure the given bindings name ends with .node if (path.extname(opts.bindings) != '.node') { diff --git a/node_modules/file-uri-to-path/.npmignore b/node_modules/file-uri-to-path/.npmignore new file mode 100644 index 0000000..07e6e47 --- /dev/null +++ b/node_modules/file-uri-to-path/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/node_modules/file-uri-to-path/.travis.yml b/node_modules/file-uri-to-path/.travis.yml new file mode 100644 index 0000000..016bb6e --- /dev/null +++ b/node_modules/file-uri-to-path/.travis.yml @@ -0,0 +1,30 @@ +sudo: false + +language: node_js + +node_js: + - "0.8" + - "0.10" + - "0.12" + - "1" + - "2" + - "3" + - "4" + - "5" + - "6" + - "7" + - "8" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/node_modules/file-uri-to-path/History.md b/node_modules/file-uri-to-path/History.md new file mode 100644 index 0000000..c8682be --- /dev/null +++ b/node_modules/file-uri-to-path/History.md @@ -0,0 +1,21 @@ + +1.0.0 / 2017-07-06 +================== + + * update "mocha" to v3 + * fixed unicode URI decoding (#6) + * add typings for Typescript + * README: use SVG Travis-CI badge + * add LICENSE file (MIT) + * add .travis.yml file (testing Node.js 0.8 through 8 currently) + * add README.md file + +0.0.2 / 2014-01-27 +================== + + * index: invert the path separators on Windows + +0.0.1 / 2014-01-27 +================== + + * initial commit diff --git a/node_modules/file-uri-to-path/LICENSE b/node_modules/file-uri-to-path/LICENSE new file mode 100644 index 0000000..e1af783 --- /dev/null +++ b/node_modules/file-uri-to-path/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/file-uri-to-path/README.md b/node_modules/file-uri-to-path/README.md new file mode 100644 index 0000000..ab30be8 --- /dev/null +++ b/node_modules/file-uri-to-path/README.md @@ -0,0 +1,74 @@ +file-uri-to-path +================ +### Convert a `file:` URI to a file path +[![Build Status](https://travis-ci.org/TooTallNate/file-uri-to-path.svg?branch=master)](https://travis-ci.org/TooTallNate/file-uri-to-path) + +Accepts a `file:` URI and returns a regular file path suitable for use with the +`fs` module functions. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install file-uri-to-path +``` + + +Example +------- + +``` js +var uri2path = require('file-uri-to-path'); + +uri2path('file://localhost/c|/WINDOWS/clock.avi'); +// "c:\\WINDOWS\\clock.avi" + +uri2path('file:///c|/WINDOWS/clock.avi'); +// "c:\\WINDOWS\\clock.avi" + +uri2path('file://localhost/c:/WINDOWS/clock.avi'); +// "c:\\WINDOWS\\clock.avi" + +uri2path('file://hostname/path/to/the%20file.txt'); +// "\\\\hostname\\path\\to\\the file.txt" + +uri2path('file:///c:/path/to/the%20file.txt'); +// "c:\\path\\to\\the file.txt" +``` + + +API +--- + +### fileUriToPath(String uri) → String + + + +License +------- + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/file-uri-to-path/index.d.ts b/node_modules/file-uri-to-path/index.d.ts new file mode 100644 index 0000000..99dc3f9 --- /dev/null +++ b/node_modules/file-uri-to-path/index.d.ts @@ -0,0 +1,2 @@ +declare function fileUriToPath(uri: string): string; +export = fileUriToPath; diff --git a/node_modules/file-uri-to-path/index.js b/node_modules/file-uri-to-path/index.js new file mode 100644 index 0000000..48cb280 --- /dev/null +++ b/node_modules/file-uri-to-path/index.js @@ -0,0 +1,66 @@ + +/** + * Module dependencies. + */ + +var sep = require('path').sep || '/'; + +/** + * Module exports. + */ + +module.exports = fileUriToPath; + +/** + * File URI to Path function. + * + * @param {String} uri + * @return {String} path + * @api public + */ + +function fileUriToPath (uri) { + if ('string' != typeof uri || + uri.length <= 7 || + 'file://' != uri.substring(0, 7)) { + throw new TypeError('must pass in a file:// URI to convert to a file path'); + } + + var rest = decodeURI(uri.substring(7)); + var firstSlash = rest.indexOf('/'); + var host = rest.substring(0, firstSlash); + var path = rest.substring(firstSlash + 1); + + // 2. Scheme Definition + // As a special case, can be the string "localhost" or the empty + // string; this is interpreted as "the machine from which the URL is + // being interpreted". + if ('localhost' == host) host = ''; + + if (host) { + host = sep + sep + host; + } + + // 3.2 Drives, drive letters, mount points, file system root + // Drive letters are mapped into the top of a file URI in various ways, + // depending on the implementation; some applications substitute + // vertical bar ("|") for the colon after the drive letter, yielding + // "file:///c|/tmp/test.txt". In some cases, the colon is left + // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the + // colon is simply omitted, as in "file:///c/tmp/test.txt". + path = path.replace(/^(.+)\|/, '$1:'); + + // for Windows, we need to invert the path separators from what a URI uses + if (sep == '\\') { + path = path.replace(/\//g, '\\'); + } + + if (/^.+\:/.test(path)) { + // has Windows drive at beginning of path + } else { + // unix path… + path = sep + path; + } + + return host + path; +} diff --git a/node_modules/file-uri-to-path/package.json b/node_modules/file-uri-to-path/package.json new file mode 100644 index 0000000..07ca93d --- /dev/null +++ b/node_modules/file-uri-to-path/package.json @@ -0,0 +1,64 @@ +{ + "_args": [ + [ + "file-uri-to-path@1.0.0", + "/Users/samuelkamau/code/microsoft/msal.js/extensions/msal-node-extensions" + ] + ], + "_from": "file-uri-to-path@1.0.0", + "_id": "file-uri-to-path@1.0.0", + "_inBundle": false, + "_integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "_location": "/bindings/file-uri-to-path", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "file-uri-to-path@1.0.0", + "name": "file-uri-to-path", + "escapedName": "file-uri-to-path", + "rawSpec": "1.0.0", + "saveSpec": null, + "fetchSpec": "1.0.0" + }, + "_requiredBy": [ + "/bindings" + ], + "_resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "_spec": "1.0.0", + "_where": "/Users/samuelkamau/code/microsoft/msal.js/extensions/msal-node-extensions", + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "bugs": { + "url": "https://github.com/TooTallNate/file-uri-to-path/issues" + }, + "description": "Convert a file: URI to a file path", + "devDependencies": { + "mocha": "3" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/TooTallNate/file-uri-to-path", + "keywords": [ + "file", + "uri", + "convert", + "path" + ], + "license": "MIT", + "main": "index.js", + "name": "file-uri-to-path", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/file-uri-to-path.git" + }, + "scripts": { + "test": "mocha --reporter spec" + }, + "types": "index.d.ts", + "version": "1.0.0" +} diff --git a/node_modules/file-uri-to-path/test/test.js b/node_modules/file-uri-to-path/test/test.js new file mode 100644 index 0000000..79305dc --- /dev/null +++ b/node_modules/file-uri-to-path/test/test.js @@ -0,0 +1,24 @@ + +var sep = require('path').sep || '/'; +var assert = require('assert'); +var uri2path = require('../'); +var tests = require('./tests.json'); + +describe('file-uri-to-path', function () { + + Object.keys(tests).forEach(function (uri) { + + // the test cases were generated from Windows' PathCreateFromUrlA() function. + // On Unix, we have to replace the path separator with the Unix one instead of + // the Windows one. + var expected = tests[uri].replace(/\\/g, sep); + + it('should convert ' + JSON.stringify(uri) + ' to ' + JSON.stringify(expected), + function () { + var actual = uri2path(uri); + assert.equal(actual, expected); + }); + + }); + +}); diff --git a/node_modules/file-uri-to-path/test/tests.json b/node_modules/file-uri-to-path/test/tests.json new file mode 100644 index 0000000..b935a63 --- /dev/null +++ b/node_modules/file-uri-to-path/test/tests.json @@ -0,0 +1,13 @@ +{ + "file://host/path": "\\\\host\\path", + "file://localhost/etc/fstab": "\\etc\\fstab", + "file:///etc/fstab": "\\etc\\fstab", + "file:///c:/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", + "file://localhost/c|/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", + "file:///c|/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", + "file://localhost/c:/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", + "file://hostname/path/to/the%20file.txt": "\\\\hostname\\path\\to\\the file.txt", + "file:///c:/path/to/the%20file.txt": "c:\\path\\to\\the file.txt", + "file:///C:/Documents%20and%20Settings/davris/FileSchemeURIs.doc": "C:\\Documents and Settings\\davris\\FileSchemeURIs.doc", + "file:///C:/caf%C3%A9/%C3%A5r/d%C3%BCnn/%E7%89%9B%E9%93%83/Ph%E1%BB%9F/%F0%9F%98%B5.exe": "C:\\café\\år\\dünn\\牛铃\\Phở\\😵.exe" +} From 01e70899add6bb271eac25c8825286a8852544ec Mon Sep 17 00:00:00 2001 From: Samuel Kubai Date: Wed, 8 Sep 2021 15:26:11 +0300 Subject: [PATCH 4/5] fix: remove node modules from version control --- .gitignore | 1 + node_modules/file-uri-to-path/.npmignore | 1 - node_modules/file-uri-to-path/.travis.yml | 30 -------- node_modules/file-uri-to-path/History.md | 21 ------ node_modules/file-uri-to-path/LICENSE | 20 ----- node_modules/file-uri-to-path/README.md | 74 ------------------- node_modules/file-uri-to-path/index.d.ts | 2 - node_modules/file-uri-to-path/index.js | 66 ----------------- node_modules/file-uri-to-path/package.json | 64 ---------------- node_modules/file-uri-to-path/test/test.js | 24 ------ node_modules/file-uri-to-path/test/tests.json | 13 ---- 11 files changed, 1 insertion(+), 315 deletions(-) create mode 100644 .gitignore delete mode 100644 node_modules/file-uri-to-path/.npmignore delete mode 100644 node_modules/file-uri-to-path/.travis.yml delete mode 100644 node_modules/file-uri-to-path/History.md delete mode 100644 node_modules/file-uri-to-path/LICENSE delete mode 100644 node_modules/file-uri-to-path/README.md delete mode 100644 node_modules/file-uri-to-path/index.d.ts delete mode 100644 node_modules/file-uri-to-path/index.js delete mode 100644 node_modules/file-uri-to-path/package.json delete mode 100644 node_modules/file-uri-to-path/test/test.js delete mode 100644 node_modules/file-uri-to-path/test/tests.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae84271 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +./node_modules \ No newline at end of file diff --git a/node_modules/file-uri-to-path/.npmignore b/node_modules/file-uri-to-path/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/file-uri-to-path/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/file-uri-to-path/.travis.yml b/node_modules/file-uri-to-path/.travis.yml deleted file mode 100644 index 016bb6e..0000000 --- a/node_modules/file-uri-to-path/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "0.8" - - "0.10" - - "0.12" - - "1" - - "2" - - "3" - - "4" - - "5" - - "6" - - "7" - - "8" - -install: - - PATH="`npm bin`:`npm bin -g`:$PATH" - # Node 0.8 comes with a too obsolete npm - - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi - # Install dependencies and build - - npm install - -script: - # Output useful info for debugging - - node --version - - npm --version - # Run tests - - npm test diff --git a/node_modules/file-uri-to-path/History.md b/node_modules/file-uri-to-path/History.md deleted file mode 100644 index c8682be..0000000 --- a/node_modules/file-uri-to-path/History.md +++ /dev/null @@ -1,21 +0,0 @@ - -1.0.0 / 2017-07-06 -================== - - * update "mocha" to v3 - * fixed unicode URI decoding (#6) - * add typings for Typescript - * README: use SVG Travis-CI badge - * add LICENSE file (MIT) - * add .travis.yml file (testing Node.js 0.8 through 8 currently) - * add README.md file - -0.0.2 / 2014-01-27 -================== - - * index: invert the path separators on Windows - -0.0.1 / 2014-01-27 -================== - - * initial commit diff --git a/node_modules/file-uri-to-path/LICENSE b/node_modules/file-uri-to-path/LICENSE deleted file mode 100644 index e1af783..0000000 --- a/node_modules/file-uri-to-path/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/file-uri-to-path/README.md b/node_modules/file-uri-to-path/README.md deleted file mode 100644 index ab30be8..0000000 --- a/node_modules/file-uri-to-path/README.md +++ /dev/null @@ -1,74 +0,0 @@ -file-uri-to-path -================ -### Convert a `file:` URI to a file path -[![Build Status](https://travis-ci.org/TooTallNate/file-uri-to-path.svg?branch=master)](https://travis-ci.org/TooTallNate/file-uri-to-path) - -Accepts a `file:` URI and returns a regular file path suitable for use with the -`fs` module functions. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install file-uri-to-path -``` - - -Example -------- - -``` js -var uri2path = require('file-uri-to-path'); - -uri2path('file://localhost/c|/WINDOWS/clock.avi'); -// "c:\\WINDOWS\\clock.avi" - -uri2path('file:///c|/WINDOWS/clock.avi'); -// "c:\\WINDOWS\\clock.avi" - -uri2path('file://localhost/c:/WINDOWS/clock.avi'); -// "c:\\WINDOWS\\clock.avi" - -uri2path('file://hostname/path/to/the%20file.txt'); -// "\\\\hostname\\path\\to\\the file.txt" - -uri2path('file:///c:/path/to/the%20file.txt'); -// "c:\\path\\to\\the file.txt" -``` - - -API ---- - -### fileUriToPath(String uri) → String - - - -License -------- - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/file-uri-to-path/index.d.ts b/node_modules/file-uri-to-path/index.d.ts deleted file mode 100644 index 99dc3f9..0000000 --- a/node_modules/file-uri-to-path/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function fileUriToPath(uri: string): string; -export = fileUriToPath; diff --git a/node_modules/file-uri-to-path/index.js b/node_modules/file-uri-to-path/index.js deleted file mode 100644 index 48cb280..0000000 --- a/node_modules/file-uri-to-path/index.js +++ /dev/null @@ -1,66 +0,0 @@ - -/** - * Module dependencies. - */ - -var sep = require('path').sep || '/'; - -/** - * Module exports. - */ - -module.exports = fileUriToPath; - -/** - * File URI to Path function. - * - * @param {String} uri - * @return {String} path - * @api public - */ - -function fileUriToPath (uri) { - if ('string' != typeof uri || - uri.length <= 7 || - 'file://' != uri.substring(0, 7)) { - throw new TypeError('must pass in a file:// URI to convert to a file path'); - } - - var rest = decodeURI(uri.substring(7)); - var firstSlash = rest.indexOf('/'); - var host = rest.substring(0, firstSlash); - var path = rest.substring(firstSlash + 1); - - // 2. Scheme Definition - // As a special case, can be the string "localhost" or the empty - // string; this is interpreted as "the machine from which the URL is - // being interpreted". - if ('localhost' == host) host = ''; - - if (host) { - host = sep + sep + host; - } - - // 3.2 Drives, drive letters, mount points, file system root - // Drive letters are mapped into the top of a file URI in various ways, - // depending on the implementation; some applications substitute - // vertical bar ("|") for the colon after the drive letter, yielding - // "file:///c|/tmp/test.txt". In some cases, the colon is left - // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the - // colon is simply omitted, as in "file:///c/tmp/test.txt". - path = path.replace(/^(.+)\|/, '$1:'); - - // for Windows, we need to invert the path separators from what a URI uses - if (sep == '\\') { - path = path.replace(/\//g, '\\'); - } - - if (/^.+\:/.test(path)) { - // has Windows drive at beginning of path - } else { - // unix path… - path = sep + path; - } - - return host + path; -} diff --git a/node_modules/file-uri-to-path/package.json b/node_modules/file-uri-to-path/package.json deleted file mode 100644 index 07ca93d..0000000 --- a/node_modules/file-uri-to-path/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_args": [ - [ - "file-uri-to-path@1.0.0", - "/Users/samuelkamau/code/microsoft/msal.js/extensions/msal-node-extensions" - ] - ], - "_from": "file-uri-to-path@1.0.0", - "_id": "file-uri-to-path@1.0.0", - "_inBundle": false, - "_integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "_location": "/bindings/file-uri-to-path", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "file-uri-to-path@1.0.0", - "name": "file-uri-to-path", - "escapedName": "file-uri-to-path", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/bindings" - ], - "_resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/samuelkamau/code/microsoft/msal.js/extensions/msal-node-extensions", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/file-uri-to-path/issues" - }, - "description": "Convert a file: URI to a file path", - "devDependencies": { - "mocha": "3" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/TooTallNate/file-uri-to-path", - "keywords": [ - "file", - "uri", - "convert", - "path" - ], - "license": "MIT", - "main": "index.js", - "name": "file-uri-to-path", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/file-uri-to-path.git" - }, - "scripts": { - "test": "mocha --reporter spec" - }, - "types": "index.d.ts", - "version": "1.0.0" -} diff --git a/node_modules/file-uri-to-path/test/test.js b/node_modules/file-uri-to-path/test/test.js deleted file mode 100644 index 79305dc..0000000 --- a/node_modules/file-uri-to-path/test/test.js +++ /dev/null @@ -1,24 +0,0 @@ - -var sep = require('path').sep || '/'; -var assert = require('assert'); -var uri2path = require('../'); -var tests = require('./tests.json'); - -describe('file-uri-to-path', function () { - - Object.keys(tests).forEach(function (uri) { - - // the test cases were generated from Windows' PathCreateFromUrlA() function. - // On Unix, we have to replace the path separator with the Unix one instead of - // the Windows one. - var expected = tests[uri].replace(/\\/g, sep); - - it('should convert ' + JSON.stringify(uri) + ' to ' + JSON.stringify(expected), - function () { - var actual = uri2path(uri); - assert.equal(actual, expected); - }); - - }); - -}); diff --git a/node_modules/file-uri-to-path/test/tests.json b/node_modules/file-uri-to-path/test/tests.json deleted file mode 100644 index b935a63..0000000 --- a/node_modules/file-uri-to-path/test/tests.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "file://host/path": "\\\\host\\path", - "file://localhost/etc/fstab": "\\etc\\fstab", - "file:///etc/fstab": "\\etc\\fstab", - "file:///c:/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", - "file://localhost/c|/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", - "file:///c|/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", - "file://localhost/c:/WINDOWS/clock.avi": "c:\\WINDOWS\\clock.avi", - "file://hostname/path/to/the%20file.txt": "\\\\hostname\\path\\to\\the file.txt", - "file:///c:/path/to/the%20file.txt": "c:\\path\\to\\the file.txt", - "file:///C:/Documents%20and%20Settings/davris/FileSchemeURIs.doc": "C:\\Documents and Settings\\davris\\FileSchemeURIs.doc", - "file:///C:/caf%C3%A9/%C3%A5r/d%C3%BCnn/%E7%89%9B%E9%93%83/Ph%E1%BB%9F/%F0%9F%98%B5.exe": "C:\\café\\år\\dünn\\牛铃\\Phở\\😵.exe" -} From 3a5a099ed0178b65079ce18e11fccc7130e0af1e Mon Sep 17 00:00:00 2001 From: Samuel Kubai Date: Wed, 8 Sep 2021 15:28:21 +0300 Subject: [PATCH 5/5] fix: update gitignore entry --- .gitignore | 2 +- package-lock.json | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index ae84271..b512c09 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -./node_modules \ No newline at end of file +node_modules \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..09b4c12 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "bindings", + "version": "1.5.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + } + } +}