WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

36
node_modules/longest-streak/index.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
'use strict'
module.exports = longestStreak
// Get the count of the longest repeating streak of `character` in `value`.
function longestStreak(value, character) {
var count = 0
var maximum = 0
var expected
var index
if (typeof character !== 'string' || character.length !== 1) {
throw new Error('Expected character')
}
value = String(value)
index = value.indexOf(character)
expected = index
while (index !== -1) {
count++
if (index === expected) {
if (count > maximum) {
maximum = count
}
} else {
count = 1
}
expected = index + 1
index = value.indexOf(character, expected)
}
return maximum
}

22
node_modules/longest-streak/license generated vendored Normal file
View File

@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2015 Titus Wormer <mailto:tituswormer@gmail.com>
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.

109
node_modules/longest-streak/package.json generated vendored Normal file
View File

@ -0,0 +1,109 @@
{
"_from": "longest-streak@^2.0.1",
"_id": "longest-streak@2.0.3",
"_inBundle": false,
"_integrity": "sha512-9lz5IVdpwsKLMzQi0MQ+oD9EA0mIGcWYP7jXMTZVXP8D42PwuAk+M/HBFYQoxt1G5OR8m7aSIgb1UymfWGBWEw==",
"_location": "/longest-streak",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "longest-streak@^2.0.1",
"name": "longest-streak",
"escapedName": "longest-streak",
"rawSpec": "^2.0.1",
"saveSpec": null,
"fetchSpec": "^2.0.1"
},
"_requiredBy": [
"/remark-stringify",
"/remark/remark-stringify"
],
"_resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.3.tgz",
"_shasum": "3de7a3f47ee18e9074ded8575b5c091f5d0a4105",
"_spec": "longest-streak@^2.0.1",
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/remark/node_modules/remark-stringify",
"author": {
"name": "Titus Wormer",
"email": "tituswormer@gmail.com",
"url": "https://wooorm.com"
},
"bugs": {
"url": "https://github.com/wooorm/longest-streak/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Titus Wormer",
"email": "tituswormer@gmail.com",
"url": "https://wooorm.com"
}
],
"dependencies": {},
"deprecated": false,
"description": "Count the longest repeating streak of a character",
"devDependencies": {
"browserify": "^16.0.0",
"nyc": "^14.0.0",
"prettier": "^1.12.1",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^4.0.0",
"tape": "^4.6.2",
"tinyify": "^2.5.0",
"xo": "^0.24.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/wooorm/longest-streak#readme",
"keywords": [
"count",
"length",
"longest",
"repeating",
"streak",
"character"
],
"license": "MIT",
"name": "longest-streak",
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/wooorm/longest-streak.git"
},
"scripts": {
"build": "npm run build-bundle && npm run build-mangle",
"build-bundle": "browserify . -s longestStreak -o longest-streak.js",
"build-mangle": "browserify . -s longestStreak -p tinyify -o longest-streak.min.js",
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
"test": "npm run format && npm run build && npm run test-coverage",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js"
},
"version": "2.0.3",
"xo": {
"prettier": true,
"esnext": false,
"ignores": [
"longest-streak.js"
]
}
}

72
node_modules/longest-streak/readme.md generated vendored Normal file
View File

@ -0,0 +1,72 @@
# longest-streak
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
Count the longest repeating streak of a character.
## Installation
[npm][]:
```bash
npm install longest-streak
```
## Usage
```js
var longestStreak = require('longest-streak')
longestStreak('` foo `` bar `', '`') // => 2
```
## API
### `longestStreak(value, character)`
Get the count of the longest repeating streak of `character` in `value`.
###### Parameters
* `value` (`string`) — Content, coerced to string.
* `character` (`string`) — Single character to look for.
###### Returns
`number` — Number of characters at the place where `character` occurs in
its longest streak in `value`.
###### Throws
* `Error` — when `character` is not a single character string.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://img.shields.io/travis/wooorm/longest-streak.svg
[build]: https://travis-ci.org/wooorm/longest-streak
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/longest-streak.svg
[coverage]: https://codecov.io/github/wooorm/longest-streak
[downloads-badge]: https://img.shields.io/npm/dm/longest-streak.svg
[downloads]: https://www.npmjs.com/package/longest-streak
[size-badge]: https://img.shields.io/bundlephobia/minzip/longest-streak.svg
[size]: https://bundlephobia.com/result?p=longest-streak
[npm]: https://docs.npmjs.com/cli/install
[license]: license
[author]: https://wooorm.com