Simulator first commit
This commit is contained in:
1
node_modules/file-uri-to-path/.npmignore
generated
vendored
Normal file
1
node_modules/file-uri-to-path/.npmignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
/node_modules
|
30
node_modules/file-uri-to-path/.travis.yml
generated
vendored
Normal file
30
node_modules/file-uri-to-path/.travis.yml
generated
vendored
Normal file
@ -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
|
21
node_modules/file-uri-to-path/History.md
generated
vendored
Normal file
21
node_modules/file-uri-to-path/History.md
generated
vendored
Normal file
@ -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
|
20
node_modules/file-uri-to-path/LICENSE
generated
vendored
Normal file
20
node_modules/file-uri-to-path/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
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.
|
74
node_modules/file-uri-to-path/README.md
generated
vendored
Normal file
74
node_modules/file-uri-to-path/README.md
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
file-uri-to-path
|
||||
================
|
||||
### Convert a `file:` URI to a file path
|
||||
[](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.
|
2
node_modules/file-uri-to-path/index.d.ts
generated
vendored
Normal file
2
node_modules/file-uri-to-path/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare function fileUriToPath(uri: string): string;
|
||||
export = fileUriToPath;
|
66
node_modules/file-uri-to-path/index.js
generated
vendored
Normal file
66
node_modules/file-uri-to-path/index.js
generated
vendored
Normal file
@ -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, <host> 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;
|
||||
}
|
61
node_modules/file-uri-to-path/package.json
generated
vendored
Normal file
61
node_modules/file-uri-to-path/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_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": "/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",
|
||||
"_shasum": "553a7b8446ff6f684359c445f1e37a05dacc33dd",
|
||||
"_spec": "file-uri-to-path@1.0.0",
|
||||
"_where": "/home/sergiu/linx-audio-simulator/node_modules/bindings",
|
||||
"author": {
|
||||
"name": "Nathan Rajlich",
|
||||
"email": "nathan@tootallnate.net",
|
||||
"url": "http://n8.io/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/TooTallNate/file-uri-to-path/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"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"
|
||||
}
|
24
node_modules/file-uri-to-path/test/test.js
generated
vendored
Normal file
24
node_modules/file-uri-to-path/test/test.js
generated
vendored
Normal file
@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
13
node_modules/file-uri-to-path/test/tests.json
generated
vendored
Normal file
13
node_modules/file-uri-to-path/test/tests.json
generated
vendored
Normal file
@ -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"
|
||||
}
|
Reference in New Issue
Block a user