mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-01 07:33:37 +00:00
fix
This commit is contained in:
9
node_modules/to-buffer/.travis.yml
generated
vendored
Normal file
9
node_modules/to-buffer/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
sudo: false
|
||||
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "5"
|
||||
- "4"
|
||||
- "0.12"
|
||||
- "0.10"
|
21
node_modules/to-buffer/LICENSE
generated
vendored
Normal file
21
node_modules/to-buffer/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Mathias Buus
|
||||
|
||||
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.
|
23
node_modules/to-buffer/README.md
generated
vendored
Normal file
23
node_modules/to-buffer/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# to-buffer
|
||||
|
||||
Pass in a string, get a buffer back. Pass in a buffer, get the same buffer back.
|
||||
|
||||
```
|
||||
npm install to-buffer
|
||||
```
|
||||
|
||||
[](https://travis-ci.org/mafintosh/to-buffer)
|
||||
|
||||
## Usage
|
||||
|
||||
``` js
|
||||
var toBuffer = require('to-buffer')
|
||||
console.log(toBuffer('hi')) // <Buffer 68 69>
|
||||
console.log(toBuffer(Buffer('hi'))) // <Buffer 68 69>
|
||||
console.log(toBuffer('6869', 'hex')) // <Buffer 68 69>
|
||||
console.log(toBuffer(43)) // throws
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
14
node_modules/to-buffer/index.js
generated
vendored
Normal file
14
node_modules/to-buffer/index.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
module.exports = toBuffer
|
||||
|
||||
var makeBuffer = Buffer.from && Buffer.from !== Uint8Array.from ? Buffer.from : bufferFrom
|
||||
|
||||
function bufferFrom (buf, enc) {
|
||||
return new Buffer(buf, enc)
|
||||
}
|
||||
|
||||
function toBuffer (buf, enc) {
|
||||
if (Buffer.isBuffer(buf)) return buf
|
||||
if (typeof buf === 'string') return makeBuffer(buf, enc)
|
||||
if (Array.isArray(buf)) return makeBuffer(buf)
|
||||
throw new Error('Input should be a buffer or a string')
|
||||
}
|
52
node_modules/to-buffer/package.json
generated
vendored
Normal file
52
node_modules/to-buffer/package.json
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"_from": "to-buffer@^1.1.1",
|
||||
"_id": "to-buffer@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==",
|
||||
"_location": "/to-buffer",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "to-buffer@^1.1.1",
|
||||
"name": "to-buffer",
|
||||
"escapedName": "to-buffer",
|
||||
"rawSpec": "^1.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/tar-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
|
||||
"_shasum": "493bd48f62d7c43fcded313a03dcadb2e1213a80",
|
||||
"_spec": "to-buffer@^1.1.1",
|
||||
"_where": "C:\\Users\\matia\\Musix\\node_modules\\tar-stream",
|
||||
"author": {
|
||||
"name": "Mathias Buus",
|
||||
"url": "@mafintosh"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mafintosh/to-buffer/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Pass in a string, get a buffer back. Pass in a buffer, get the same buffer back",
|
||||
"devDependencies": {
|
||||
"standard": "^6.0.5",
|
||||
"tape": "^4.4.0"
|
||||
},
|
||||
"homepage": "https://github.com/mafintosh/to-buffer",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "to-buffer",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mafintosh/to-buffer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && tape test.js"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
26
node_modules/to-buffer/test.js
generated
vendored
Normal file
26
node_modules/to-buffer/test.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
var tape = require('tape')
|
||||
var toBuffer = require('./')
|
||||
|
||||
tape('buffer returns buffer', function (t) {
|
||||
t.same(toBuffer(Buffer('hi')), Buffer('hi'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('string returns buffer', function (t) {
|
||||
t.same(toBuffer('hi'), Buffer('hi'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('string + enc returns buffer', function (t) {
|
||||
t.same(toBuffer('6869', 'hex'), Buffer('hi'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('other input throws', function (t) {
|
||||
try {
|
||||
toBuffer(42)
|
||||
} catch (err) {
|
||||
t.same(err.message, 'Input should be a buffer or a string')
|
||||
t.end()
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user