forked from enviPath/enviPy
Current Dev State
This commit is contained in:
7
static/js/ketcher2/node_modules/prettier-bytes/CHANGELOG.md
generated
vendored
Normal file
7
static/js/ketcher2/node_modules/prettier-bytes/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
# prettier-bytes change log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Unreleased
|
||||
* engage
|
||||
61
static/js/ketcher2/node_modules/prettier-bytes/CONTRIBUTING.md
generated
vendored
Normal file
61
static/js/ketcher2/node_modules/prettier-bytes/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# Contributing Guidelines
|
||||
|
||||
Contributions welcome!
|
||||
|
||||
**Before spending lots of time on something, ask for feedback on your idea first!**
|
||||
|
||||
Please search issues and pull requests before adding something new to avoid duplicating efforts and conversations.
|
||||
|
||||
In addition to improving the project by refactoring code and implementing relevant features, this project welcomes the following types of contributions:
|
||||
|
||||
- **Ideas**: participate in an issue thread or start your own to have your voice heard.
|
||||
- **Writing**: contribute your expertise in an area by helping expand the included content.
|
||||
- **Copy editing**: fix typos, clarify language, and generally improve the quality of the content.
|
||||
- **Formatting**: help keep content easy to read with consistent formatting.
|
||||
|
||||
## Installing
|
||||
|
||||
Fork and clone the repo, then `npm install` to install all dependencies.
|
||||
|
||||
## Testing
|
||||
|
||||
Tests are run with `npm test`. Unless you're creating a failing test to increase test coverage or show a problem, please make sure all tests are passing before submitting a pull request.
|
||||
|
||||
## Code Style
|
||||
|
||||
[![standard][standard-image]][standard-url]
|
||||
|
||||
This repository uses [`standard`][standard-url] to maintain code style and consistency and avoid style arguments. `npm test` runs `standard` so you don't have to!
|
||||
|
||||
[standard-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg
|
||||
[standard-url]: https://github.com/feross/standard
|
||||
[semistandard-image]: https://cdn.rawgit.com/flet/semistandard/master/badge.svg
|
||||
[semistandard-url]: https://github.com/Flet/semistandard
|
||||
|
||||
---
|
||||
|
||||
# Collaborating Guidelines
|
||||
|
||||
**This is an OPEN Open Source Project.**
|
||||
|
||||
## What?
|
||||
|
||||
Individuals making significant and valuable contributions are given commit access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
|
||||
|
||||
## Rules
|
||||
|
||||
There are a few basic ground rules for collaborators:
|
||||
|
||||
1. **No `--force` pushes** or modifying the Git history in any way.
|
||||
1. **Non-master branches** ought to be used for ongoing work.
|
||||
1. **External API changes and significant modifications** ought to be subject to an **internal pull request** to solicit feedback from other collaborators.
|
||||
1. Internal pull requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor.
|
||||
1. Contributors should attempt to adhere to the prevailing code style.
|
||||
|
||||
## Releases
|
||||
|
||||
Declaring formal releases remains the prerogative of the project maintainer.
|
||||
|
||||
## Changes to this arrangement
|
||||
|
||||
This is an experiment and feedback is welcome! This document may also be subject to pull requests or changes by collaborators where you believe you have something valuable to add or change.
|
||||
5
static/js/ketcher2/node_modules/prettier-bytes/LICENSE
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/prettier-bytes/LICENSE
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
Copyright (c) 2016, Dan Flettre <dan.flettre@bestbuy.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
64
static/js/ketcher2/node_modules/prettier-bytes/README.md
generated
vendored
Normal file
64
static/js/ketcher2/node_modules/prettier-bytes/README.md
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
# prettier-bytes
|
||||
|
||||
[![npm][npm-image]][npm-url]
|
||||
[![travis][travis-image]][travis-url]
|
||||
[![standard][standard-image]][standard-url]
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/prettier-bytes.svg?style=flat-square
|
||||
[npm-url]: https://www.npmjs.com/package/prettier-bytes
|
||||
[travis-image]: https://img.shields.io/travis/Flet/prettier-bytes.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/Flet/prettier-bytes
|
||||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
|
||||
[standard-url]: http://npm.im/standard
|
||||
|
||||
Augment pretty-bytes to make the output a little more readable (and a little less precise)
|
||||
|
||||
Differences from `pretty-bytes`:
|
||||
- The fractional portion is rounded to one digit (ex: `2.1 MB`).
|
||||
- If there is more than one digit to the left of the decimal, the fractional portion is rounded off (ex: `11 KB`).
|
||||
- Changed `kB` to `KB`, for more prettiness. Regular users are not likely to care about the technical difference.
|
||||
- No dependencies.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install prettier-bytes
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var prettierBytes = require('prettier-bytes')
|
||||
|
||||
var pretty = prettierBytes(1337)
|
||||
console.log(pretty)
|
||||
// logs 1.3 KB
|
||||
```
|
||||
|
||||
Examples from test output:
|
||||
```bash
|
||||
✔ bytes: 2 -> 2 B
|
||||
✔ bytes: 9 -> 9 B
|
||||
✔ bytes: 25 -> 25 B
|
||||
✔ bytes: 235 -> 235 B
|
||||
✔ bytes: 2335 -> 2.3 KB
|
||||
✔ bytes: 23552 -> 24 KB
|
||||
✔ bytes: 235520 -> 236 KB
|
||||
✔ bytes: 2355520 -> 2.4 MB
|
||||
✔ bytes: 23555520 -> 24 MB
|
||||
✔ bytes: 235555520 -> 236 MB
|
||||
✔ bytes: 2355555520 -> 2.4 GB
|
||||
✔ bytes: 23555555520 -> 24 GB
|
||||
✔ bytes: 235556555520 -> 236 GB
|
||||
✔ bytes: 2355556655520 -> 2.4 TB
|
||||
✔ bytes: 23555566655520 -> 24 TB
|
||||
✔ bytes: 235555566665520 -> 236 TB
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.
|
||||
|
||||
## License
|
||||
|
||||
[ISC](LICENSE)
|
||||
30
static/js/ketcher2/node_modules/prettier-bytes/index.js
generated
vendored
Normal file
30
static/js/ketcher2/node_modules/prettier-bytes/index.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
module.exports = prettierBytes
|
||||
|
||||
function prettierBytes (num) {
|
||||
if (typeof num !== 'number' || isNaN(num)) {
|
||||
throw new TypeError('Expected a number, got ' + typeof num)
|
||||
}
|
||||
|
||||
var neg = num < 0
|
||||
var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
|
||||
if (neg) {
|
||||
num = -num
|
||||
}
|
||||
|
||||
if (num < 1) {
|
||||
return (neg ? '-' : '') + num + ' B'
|
||||
}
|
||||
|
||||
var exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1)
|
||||
num = Number(num / Math.pow(1000, exponent))
|
||||
var unit = units[exponent]
|
||||
|
||||
if (num >= 10 || num % 1 === 0) {
|
||||
// Do not show decimals when the number is two-digit, or if the number has no
|
||||
// decimal component.
|
||||
return (neg ? '-' : '') + num.toFixed(0) + ' ' + unit
|
||||
} else {
|
||||
return (neg ? '-' : '') + num.toFixed(1) + ' ' + unit
|
||||
}
|
||||
}
|
||||
59
static/js/ketcher2/node_modules/prettier-bytes/package.json
generated
vendored
Normal file
59
static/js/ketcher2/node_modules/prettier-bytes/package.json
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"_from": "prettier-bytes@^1.0.3",
|
||||
"_id": "prettier-bytes@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-mUsCqkb2mcULYle1+qp/4lV+YtY=",
|
||||
"_location": "/prettier-bytes",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "prettier-bytes@^1.0.3",
|
||||
"name": "prettier-bytes",
|
||||
"escapedName": "prettier-bytes",
|
||||
"rawSpec": "^1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/garnish"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/prettier-bytes/-/prettier-bytes-1.0.4.tgz",
|
||||
"_shasum": "994b02aa46f699c50b6257b5faaa7fe2557e62d6",
|
||||
"_spec": "prettier-bytes@^1.0.3",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/garnish",
|
||||
"author": {
|
||||
"name": "Dan Flettre",
|
||||
"email": "flettre@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Flet/prettier-bytes/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "augment pretty-bytes to make the output a little more readable (and a little less precise)",
|
||||
"devDependencies": {
|
||||
"standard": "*",
|
||||
"tap-spec": "^4.0.2",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/Flet/prettier-bytes",
|
||||
"keywords": [
|
||||
"bytes",
|
||||
"output",
|
||||
"pretty",
|
||||
"pretty-bytes"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "prettier-bytes",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Flet/prettier-bytes.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js | tap-spec && standard"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
}
|
||||
44
static/js/ketcher2/node_modules/prettier-bytes/test/index.js
generated
vendored
Normal file
44
static/js/ketcher2/node_modules/prettier-bytes/test/index.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
var test = require('tape')
|
||||
|
||||
var prettierBytes = require('../')
|
||||
|
||||
var testData = [
|
||||
[2, '2 B'],
|
||||
[9, '9 B'],
|
||||
[25, '25 B'],
|
||||
[235, '235 B'],
|
||||
[2335, '2.3 KB'],
|
||||
[23552, '24 KB'],
|
||||
[235520, '236 KB'],
|
||||
[2355520, '2.4 MB'],
|
||||
[23555520, '24 MB'],
|
||||
[235555520, '236 MB'],
|
||||
[2355555520, '2.4 GB'],
|
||||
[23555555520, '24 GB'],
|
||||
[235556555520, '236 GB'],
|
||||
[2355556655520, '2.4 TB'],
|
||||
[23555566655520, '24 TB'],
|
||||
[235555566665520, '236 TB']
|
||||
]
|
||||
|
||||
test('pretty bytes', function (t) {
|
||||
testData.forEach(function (data) {
|
||||
t.equals(prettierBytes(data[0]), data[1], 'bytes: ' + data[0] + ' -> ' + data[1])
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('throws on non-number', function (t) {
|
||||
t.throws(function () {
|
||||
prettierBytes('this is a string')
|
||||
})
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('throws on NaN', function (t) {
|
||||
t.throws(function () {
|
||||
prettierBytes(NaN)
|
||||
})
|
||||
t.end()
|
||||
})
|
||||
Reference in New Issue
Block a user