new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import assertString from './util/assertString';
|
||||
var octal = /^(0o)?[0-7]+$/i;
|
||||
export default function isOctal(str) {
|
||||
assertString(str);
|
||||
return octal.test(str);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "lower-case",
|
||||
"version": "1.1.4",
|
||||
"description": "Lowercase a string",
|
||||
"main": "lower-case.js",
|
||||
"typings": "lower-case.d.ts",
|
||||
"files": [
|
||||
"lower-case.js",
|
||||
"lower-case.d.ts",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"test-std": "mocha -- -R spec --bail",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail",
|
||||
"test": "npm run lint && npm run test-cov"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"coverage/**",
|
||||
"node_modules/**",
|
||||
"bower_components/**"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/blakeembrey/lower-case.git"
|
||||
},
|
||||
"keywords": [
|
||||
"cases",
|
||||
"lower",
|
||||
"lowercase",
|
||||
"case"
|
||||
],
|
||||
"author": {
|
||||
"name": "Blake Embrey",
|
||||
"email": "hello@blakeembrey.com",
|
||||
"url": "http://blakeembrey.me"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/blakeembrey/lower-case/issues"
|
||||
},
|
||||
"homepage": "https://github.com/blakeembrey/lower-case",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.3.5",
|
||||
"mocha": "^2.1.0",
|
||||
"pre-commit": "^1.0.2",
|
||||
"standard": "^2.4.5"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,440 @@
|
||||
// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions):
|
||||
// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py
|
||||
|
||||
'use strict'
|
||||
|
||||
/*
|
||||
* Text wrapping and filling.
|
||||
*/
|
||||
|
||||
// Copyright (C) 1999-2001 Gregory P. Ward.
|
||||
// Copyright (C) 2002, 2003 Python Software Foundation.
|
||||
// Copyright (C) 2020 argparse.js authors
|
||||
// Originally written by Greg Ward <gward@python.net>
|
||||
|
||||
// Hardcode the recognized whitespace characters to the US-ASCII
|
||||
// whitespace characters. The main reason for doing this is that
|
||||
// some Unicode spaces (like \u00a0) are non-breaking whitespaces.
|
||||
//
|
||||
// This less funky little regex just split on recognized spaces. E.g.
|
||||
// "Hello there -- you goof-ball, use the -b option!"
|
||||
// splits into
|
||||
// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
|
||||
const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/
|
||||
|
||||
class TextWrapper {
|
||||
/*
|
||||
* Object for wrapping/filling text. The public interface consists of
|
||||
* the wrap() and fill() methods; the other methods are just there for
|
||||
* subclasses to override in order to tweak the default behaviour.
|
||||
* If you want to completely replace the main wrapping algorithm,
|
||||
* you'll probably have to override _wrap_chunks().
|
||||
*
|
||||
* Several instance attributes control various aspects of wrapping:
|
||||
* width (default: 70)
|
||||
* the maximum width of wrapped lines (unless break_long_words
|
||||
* is false)
|
||||
* initial_indent (default: "")
|
||||
* string that will be prepended to the first line of wrapped
|
||||
* output. Counts towards the line's width.
|
||||
* subsequent_indent (default: "")
|
||||
* string that will be prepended to all lines save the first
|
||||
* of wrapped output; also counts towards each line's width.
|
||||
* expand_tabs (default: true)
|
||||
* Expand tabs in input text to spaces before further processing.
|
||||
* Each tab will become 0 .. 'tabsize' spaces, depending on its position
|
||||
* in its line. If false, each tab is treated as a single character.
|
||||
* tabsize (default: 8)
|
||||
* Expand tabs in input text to 0 .. 'tabsize' spaces, unless
|
||||
* 'expand_tabs' is false.
|
||||
* replace_whitespace (default: true)
|
||||
* Replace all whitespace characters in the input text by spaces
|
||||
* after tab expansion. Note that if expand_tabs is false and
|
||||
* replace_whitespace is true, every tab will be converted to a
|
||||
* single space!
|
||||
* fix_sentence_endings (default: false)
|
||||
* Ensure that sentence-ending punctuation is always followed
|
||||
* by two spaces. Off by default because the algorithm is
|
||||
* (unavoidably) imperfect.
|
||||
* break_long_words (default: true)
|
||||
* Break words longer than 'width'. If false, those words will not
|
||||
* be broken, and some lines might be longer than 'width'.
|
||||
* break_on_hyphens (default: true)
|
||||
* Allow breaking hyphenated words. If true, wrapping will occur
|
||||
* preferably on whitespaces and right after hyphens part of
|
||||
* compound words.
|
||||
* drop_whitespace (default: true)
|
||||
* Drop leading and trailing whitespace from lines.
|
||||
* max_lines (default: None)
|
||||
* Truncate wrapped lines.
|
||||
* placeholder (default: ' [...]')
|
||||
* Append to the last line of truncated text.
|
||||
*/
|
||||
|
||||
constructor(options = {}) {
|
||||
let {
|
||||
width = 70,
|
||||
initial_indent = '',
|
||||
subsequent_indent = '',
|
||||
expand_tabs = true,
|
||||
replace_whitespace = true,
|
||||
fix_sentence_endings = false,
|
||||
break_long_words = true,
|
||||
drop_whitespace = true,
|
||||
break_on_hyphens = true,
|
||||
tabsize = 8,
|
||||
max_lines = undefined,
|
||||
placeholder=' [...]'
|
||||
} = options
|
||||
|
||||
this.width = width
|
||||
this.initial_indent = initial_indent
|
||||
this.subsequent_indent = subsequent_indent
|
||||
this.expand_tabs = expand_tabs
|
||||
this.replace_whitespace = replace_whitespace
|
||||
this.fix_sentence_endings = fix_sentence_endings
|
||||
this.break_long_words = break_long_words
|
||||
this.drop_whitespace = drop_whitespace
|
||||
this.break_on_hyphens = break_on_hyphens
|
||||
this.tabsize = tabsize
|
||||
this.max_lines = max_lines
|
||||
this.placeholder = placeholder
|
||||
}
|
||||
|
||||
|
||||
// -- Private methods -----------------------------------------------
|
||||
// (possibly useful for subclasses to override)
|
||||
|
||||
_munge_whitespace(text) {
|
||||
/*
|
||||
* _munge_whitespace(text : string) -> string
|
||||
*
|
||||
* Munge whitespace in text: expand tabs and convert all other
|
||||
* whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
|
||||
* becomes " foo bar baz".
|
||||
*/
|
||||
if (this.expand_tabs) {
|
||||
text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js
|
||||
}
|
||||
if (this.replace_whitespace) {
|
||||
text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ')
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
_split(text) {
|
||||
/*
|
||||
* _split(text : string) -> [string]
|
||||
*
|
||||
* Split the text to wrap into indivisible chunks. Chunks are
|
||||
* not quite the same as words; see _wrap_chunks() for full
|
||||
* details. As an example, the text
|
||||
* Look, goof-ball -- use the -b option!
|
||||
* breaks into the following chunks:
|
||||
* 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
|
||||
* 'use', ' ', 'the', ' ', '-b', ' ', 'option!'
|
||||
* if break_on_hyphens is True, or in:
|
||||
* 'Look,', ' ', 'goof-ball', ' ', '--', ' ',
|
||||
* 'use', ' ', 'the', ' ', '-b', ' ', option!'
|
||||
* otherwise.
|
||||
*/
|
||||
let chunks = text.split(wordsep_simple_re)
|
||||
chunks = chunks.filter(Boolean)
|
||||
return chunks
|
||||
}
|
||||
|
||||
_handle_long_word(reversed_chunks, cur_line, cur_len, width) {
|
||||
/*
|
||||
* _handle_long_word(chunks : [string],
|
||||
* cur_line : [string],
|
||||
* cur_len : int, width : int)
|
||||
*
|
||||
* Handle a chunk of text (most likely a word, not whitespace) that
|
||||
* is too long to fit in any line.
|
||||
*/
|
||||
// Figure out when indent is larger than the specified width, and make
|
||||
// sure at least one character is stripped off on every pass
|
||||
let space_left
|
||||
if (width < 1) {
|
||||
space_left = 1
|
||||
} else {
|
||||
space_left = width - cur_len
|
||||
}
|
||||
|
||||
// If we're allowed to break long words, then do so: put as much
|
||||
// of the next chunk onto the current line as will fit.
|
||||
if (this.break_long_words) {
|
||||
cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left))
|
||||
reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left)
|
||||
|
||||
// Otherwise, we have to preserve the long word intact. Only add
|
||||
// it to the current line if there's nothing already there --
|
||||
// that minimizes how much we violate the width constraint.
|
||||
} else if (!cur_line) {
|
||||
cur_line.push(...reversed_chunks.pop())
|
||||
}
|
||||
|
||||
// If we're not allowed to break long words, and there's already
|
||||
// text on the current line, do nothing. Next time through the
|
||||
// main loop of _wrap_chunks(), we'll wind up here again, but
|
||||
// cur_len will be zero, so the next line will be entirely
|
||||
// devoted to the long word that we can't handle right now.
|
||||
}
|
||||
|
||||
_wrap_chunks(chunks) {
|
||||
/*
|
||||
* _wrap_chunks(chunks : [string]) -> [string]
|
||||
*
|
||||
* Wrap a sequence of text chunks and return a list of lines of
|
||||
* length 'self.width' or less. (If 'break_long_words' is false,
|
||||
* some lines may be longer than this.) Chunks correspond roughly
|
||||
* to words and the whitespace between them: each chunk is
|
||||
* indivisible (modulo 'break_long_words'), but a line break can
|
||||
* come between any two chunks. Chunks should not have internal
|
||||
* whitespace; ie. a chunk is either all whitespace or a "word".
|
||||
* Whitespace chunks will be removed from the beginning and end of
|
||||
* lines, but apart from that whitespace is preserved.
|
||||
*/
|
||||
let lines = []
|
||||
let indent
|
||||
if (this.width <= 0) {
|
||||
throw Error(`invalid width ${this.width} (must be > 0)`)
|
||||
}
|
||||
if (this.max_lines !== undefined) {
|
||||
if (this.max_lines > 1) {
|
||||
indent = this.subsequent_indent
|
||||
} else {
|
||||
indent = this.initial_indent
|
||||
}
|
||||
if (indent.length + this.placeholder.trimStart().length > this.width) {
|
||||
throw Error('placeholder too large for max width')
|
||||
}
|
||||
}
|
||||
|
||||
// Arrange in reverse order so items can be efficiently popped
|
||||
// from a stack of chucks.
|
||||
chunks = chunks.reverse()
|
||||
|
||||
while (chunks.length > 0) {
|
||||
|
||||
// Start the list of chunks that will make up the current line.
|
||||
// cur_len is just the length of all the chunks in cur_line.
|
||||
let cur_line = []
|
||||
let cur_len = 0
|
||||
|
||||
// Figure out which static string will prefix this line.
|
||||
let indent
|
||||
if (lines) {
|
||||
indent = this.subsequent_indent
|
||||
} else {
|
||||
indent = this.initial_indent
|
||||
}
|
||||
|
||||
// Maximum width for this line.
|
||||
let width = this.width - indent.length
|
||||
|
||||
// First chunk on line is whitespace -- drop it, unless this
|
||||
// is the very beginning of the text (ie. no lines started yet).
|
||||
if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) {
|
||||
chunks.pop()
|
||||
}
|
||||
|
||||
while (chunks.length > 0) {
|
||||
let l = chunks[chunks.length - 1].length
|
||||
|
||||
// Can at least squeeze this chunk onto the current line.
|
||||
if (cur_len + l <= width) {
|
||||
cur_line.push(chunks.pop())
|
||||
cur_len += l
|
||||
|
||||
// Nope, this line is full.
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// The current line is full, and the next chunk is too big to
|
||||
// fit on *any* line (not just this one).
|
||||
if (chunks.length && chunks[chunks.length - 1].length > width) {
|
||||
this._handle_long_word(chunks, cur_line, cur_len, width)
|
||||
cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0)
|
||||
}
|
||||
|
||||
// If the last chunk on this line is all whitespace, drop it.
|
||||
if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') {
|
||||
cur_len -= cur_line[cur_line.length - 1].length
|
||||
cur_line.pop()
|
||||
}
|
||||
|
||||
if (cur_line) {
|
||||
if (this.max_lines === undefined ||
|
||||
lines.length + 1 < this.max_lines ||
|
||||
(chunks.length === 0 ||
|
||||
this.drop_whitespace &&
|
||||
chunks.length === 1 &&
|
||||
!chunks[0].trim()) && cur_len <= width) {
|
||||
// Convert current line back to a string and store it in
|
||||
// list of all lines (return value).
|
||||
lines.push(indent + cur_line.join(''))
|
||||
} else {
|
||||
let had_break = false
|
||||
while (cur_line) {
|
||||
if (cur_line[cur_line.length - 1].trim() &&
|
||||
cur_len + this.placeholder.length <= width) {
|
||||
cur_line.push(this.placeholder)
|
||||
lines.push(indent + cur_line.join(''))
|
||||
had_break = true
|
||||
break
|
||||
}
|
||||
cur_len -= cur_line[-1].length
|
||||
cur_line.pop()
|
||||
}
|
||||
if (!had_break) {
|
||||
if (lines) {
|
||||
let prev_line = lines[lines.length - 1].trimEnd()
|
||||
if (prev_line.length + this.placeholder.length <=
|
||||
this.width) {
|
||||
lines[lines.length - 1] = prev_line + this.placeholder
|
||||
break
|
||||
}
|
||||
}
|
||||
lines.push(indent + this.placeholder.lstrip())
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
_split_chunks(text) {
|
||||
text = this._munge_whitespace(text)
|
||||
return this._split(text)
|
||||
}
|
||||
|
||||
// -- Public interface ----------------------------------------------
|
||||
|
||||
wrap(text) {
|
||||
/*
|
||||
* wrap(text : string) -> [string]
|
||||
*
|
||||
* Reformat the single paragraph in 'text' so it fits in lines of
|
||||
* no more than 'self.width' columns, and return a list of wrapped
|
||||
* lines. Tabs in 'text' are expanded with string.expandtabs(),
|
||||
* and all other whitespace characters (including newline) are
|
||||
* converted to space.
|
||||
*/
|
||||
let chunks = this._split_chunks(text)
|
||||
// not implemented in js
|
||||
//if (this.fix_sentence_endings) {
|
||||
// this._fix_sentence_endings(chunks)
|
||||
//}
|
||||
return this._wrap_chunks(chunks)
|
||||
}
|
||||
|
||||
fill(text) {
|
||||
/*
|
||||
* fill(text : string) -> string
|
||||
*
|
||||
* Reformat the single paragraph in 'text' to fit in lines of no
|
||||
* more than 'self.width' columns, and return a new string
|
||||
* containing the entire wrapped paragraph.
|
||||
*/
|
||||
return this.wrap(text).join('\n')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Convenience interface ---------------------------------------------
|
||||
|
||||
function wrap(text, options = {}) {
|
||||
/*
|
||||
* Wrap a single paragraph of text, returning a list of wrapped lines.
|
||||
*
|
||||
* Reformat the single paragraph in 'text' so it fits in lines of no
|
||||
* more than 'width' columns, and return a list of wrapped lines. By
|
||||
* default, tabs in 'text' are expanded with string.expandtabs(), and
|
||||
* all other whitespace characters (including newline) are converted to
|
||||
* space. See TextWrapper class for available keyword args to customize
|
||||
* wrapping behaviour.
|
||||
*/
|
||||
let { width = 70, ...kwargs } = options
|
||||
let w = new TextWrapper(Object.assign({ width }, kwargs))
|
||||
return w.wrap(text)
|
||||
}
|
||||
|
||||
function fill(text, options = {}) {
|
||||
/*
|
||||
* Fill a single paragraph of text, returning a new string.
|
||||
*
|
||||
* Reformat the single paragraph in 'text' to fit in lines of no more
|
||||
* than 'width' columns, and return a new string containing the entire
|
||||
* wrapped paragraph. As with wrap(), tabs are expanded and other
|
||||
* whitespace characters converted to space. See TextWrapper class for
|
||||
* available keyword args to customize wrapping behaviour.
|
||||
*/
|
||||
let { width = 70, ...kwargs } = options
|
||||
let w = new TextWrapper(Object.assign({ width }, kwargs))
|
||||
return w.fill(text)
|
||||
}
|
||||
|
||||
// -- Loosely related functionality -------------------------------------
|
||||
|
||||
let _whitespace_only_re = /^[ \t]+$/mg
|
||||
let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg
|
||||
|
||||
function dedent(text) {
|
||||
/*
|
||||
* Remove any common leading whitespace from every line in `text`.
|
||||
*
|
||||
* This can be used to make triple-quoted strings line up with the left
|
||||
* edge of the display, while still presenting them in the source code
|
||||
* in indented form.
|
||||
*
|
||||
* Note that tabs and spaces are both treated as whitespace, but they
|
||||
* are not equal: the lines " hello" and "\\thello" are
|
||||
* considered to have no common leading whitespace.
|
||||
*
|
||||
* Entirely blank lines are normalized to a newline character.
|
||||
*/
|
||||
// Look for the longest leading string of spaces and tabs common to
|
||||
// all lines.
|
||||
let margin = undefined
|
||||
text = text.replace(_whitespace_only_re, '')
|
||||
let indents = text.match(_leading_whitespace_re) || []
|
||||
for (let indent of indents) {
|
||||
indent = indent.slice(0, -1)
|
||||
|
||||
if (margin === undefined) {
|
||||
margin = indent
|
||||
|
||||
// Current line more deeply indented than previous winner:
|
||||
// no change (previous winner is still on top).
|
||||
} else if (indent.startsWith(margin)) {
|
||||
// pass
|
||||
|
||||
// Current line consistent with and no deeper than previous winner:
|
||||
// it's the new winner.
|
||||
} else if (margin.startsWith(indent)) {
|
||||
margin = indent
|
||||
|
||||
// Find the largest common whitespace between current line and previous
|
||||
// winner.
|
||||
} else {
|
||||
for (let i = 0; i < margin.length && i < indent.length; i++) {
|
||||
if (margin[i] !== indent[i]) {
|
||||
margin = margin.slice(0, i)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (margin) {
|
||||
text = text.replace(new RegExp('^' + margin, 'mg'), '')
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
module.exports = { wrap, fill, dedent }
|
||||
@@ -0,0 +1,85 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { defer } from './defer';
|
||||
import { ObservableInput } from '../types';
|
||||
|
||||
/**
|
||||
* Checks a boolean at subscription time, and chooses between one of two observable sources
|
||||
*
|
||||
* `iif` expects a function that returns a boolean (the `condition` function), and two sources,
|
||||
* the `trueResult` and the `falseResult`, and returns an Observable.
|
||||
*
|
||||
* At the moment of subscription, the `condition` function is called. If the result is `true`, the
|
||||
* subscription will be to the source passed as the `trueResult`, otherwise, the subscription will be
|
||||
* to the source passed as the `falseResult`.
|
||||
*
|
||||
* If you need to check more than two options to choose between more than one observable, have a look at the {@link defer} creation method.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Change at runtime which Observable will be subscribed
|
||||
*
|
||||
* ```ts
|
||||
* import { iif, of } from 'rxjs';
|
||||
*
|
||||
* let subscribeToFirst;
|
||||
* const firstOrSecond = iif(
|
||||
* () => subscribeToFirst,
|
||||
* of('first'),
|
||||
* of('second')
|
||||
* );
|
||||
*
|
||||
* subscribeToFirst = true;
|
||||
* firstOrSecond.subscribe(value => console.log(value));
|
||||
*
|
||||
* // Logs:
|
||||
* // 'first'
|
||||
*
|
||||
* subscribeToFirst = false;
|
||||
* firstOrSecond.subscribe(value => console.log(value));
|
||||
*
|
||||
* // Logs:
|
||||
* // 'second'
|
||||
* ```
|
||||
*
|
||||
* Control access to an Observable
|
||||
*
|
||||
* ```ts
|
||||
* import { iif, of, EMPTY } from 'rxjs';
|
||||
*
|
||||
* let accessGranted;
|
||||
* const observableIfYouHaveAccess = iif(
|
||||
* () => accessGranted,
|
||||
* of('It seems you have an access...'),
|
||||
* EMPTY
|
||||
* );
|
||||
*
|
||||
* accessGranted = true;
|
||||
* observableIfYouHaveAccess.subscribe({
|
||||
* next: value => console.log(value),
|
||||
* complete: () => console.log('The end')
|
||||
* });
|
||||
*
|
||||
* // Logs:
|
||||
* // 'It seems you have an access...'
|
||||
* // 'The end'
|
||||
*
|
||||
* accessGranted = false;
|
||||
* observableIfYouHaveAccess.subscribe({
|
||||
* next: value => console.log(value),
|
||||
* complete: () => console.log('The end')
|
||||
* });
|
||||
*
|
||||
* // Logs:
|
||||
* // 'The end'
|
||||
* ```
|
||||
*
|
||||
* @see {@link defer}
|
||||
*
|
||||
* @param condition Condition which Observable should be chosen.
|
||||
* @param trueResult An Observable that will be subscribed if condition is true.
|
||||
* @param falseResult An Observable that will be subscribed if condition is false.
|
||||
* @return An observable that proxies to `trueResult` or `falseResult`, depending on the result of the `condition` function.
|
||||
*/
|
||||
export function iif<T, F>(condition: () => boolean, trueResult: ObservableInput<T>, falseResult: ObservableInput<F>): Observable<T | F> {
|
||||
return defer(() => (condition() ? trueResult : falseResult));
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isBtcAddress;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var bech32 = /^(bc1)[a-z0-9]{25,39}$/;
|
||||
var base58 = /^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;
|
||||
|
||||
function isBtcAddress(str) {
|
||||
(0, _assertString.default)(str);
|
||||
return bech32.test(str) || base58.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,111 @@
|
||||
# quick-lru [](https://travis-ci.org/sindresorhus/quick-lru) [](https://coveralls.io/github/sindresorhus/quick-lru?branch=master)
|
||||
|
||||
> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29)
|
||||
|
||||
Useful when you need to cache something and limit memory usage.
|
||||
|
||||
Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install quick-lru
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const QuickLRU = require('quick-lru');
|
||||
|
||||
const lru = new QuickLRU({maxSize: 1000});
|
||||
|
||||
lru.set('🦄', '🌈');
|
||||
|
||||
lru.has('🦄');
|
||||
//=> true
|
||||
|
||||
lru.get('🦄');
|
||||
//=> '🌈'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### new QuickLRU(options?)
|
||||
|
||||
Returns a new instance.
|
||||
|
||||
### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
#### maxSize
|
||||
|
||||
*Required*\
|
||||
Type: `number`
|
||||
|
||||
The maximum number of items before evicting the least recently used items.
|
||||
|
||||
#### onEviction
|
||||
|
||||
*Optional*\
|
||||
Type: `(key, value) => void`
|
||||
|
||||
Called right before an item is evicted from the cache.
|
||||
|
||||
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||
|
||||
### Instance
|
||||
|
||||
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||
|
||||
Both `key` and `value` can be of any type.
|
||||
|
||||
#### .set(key, value)
|
||||
|
||||
Set an item. Returns the instance.
|
||||
|
||||
#### .get(key)
|
||||
|
||||
Get an item.
|
||||
|
||||
#### .has(key)
|
||||
|
||||
Check if an item exists.
|
||||
|
||||
#### .peek(key)
|
||||
|
||||
Get an item without marking it as recently used.
|
||||
|
||||
#### .delete(key)
|
||||
|
||||
Delete an item.
|
||||
|
||||
Returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||
|
||||
#### .clear()
|
||||
|
||||
Delete all items.
|
||||
|
||||
#### .keys()
|
||||
|
||||
Iterable for all the keys.
|
||||
|
||||
#### .values()
|
||||
|
||||
Iterable for all the values.
|
||||
|
||||
#### .size
|
||||
|
||||
The stored item count.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-quick-lru?utm_source=npm-quick-lru&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
@@ -0,0 +1,2 @@
|
||||
test,test2,test3
|
||||
blag,blagh,|blahhh, blah|
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').filterSeries;
|
||||
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.merge = void 0;
|
||||
const merge2 = require("merge2");
|
||||
function merge(streams) {
|
||||
const mergedStream = merge2(streams);
|
||||
streams.forEach((stream) => {
|
||||
stream.once('error', (error) => mergedStream.emit('error', error));
|
||||
});
|
||||
mergedStream.once('close', () => propagateCloseEventToSources(streams));
|
||||
mergedStream.once('end', () => propagateCloseEventToSources(streams));
|
||||
return mergedStream;
|
||||
}
|
||||
exports.merge = merge;
|
||||
function propagateCloseEventToSources(streams) {
|
||||
streams.forEach((stream) => stream.emit('close'));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"regexp.prototype.flags","version":"1.4.3","files":{".editorconfig":{"checkedAt":1678883671537,"integrity":"sha512-p35O0lNr5b8Aha4N1dns/Zy3+rV1ZLx6ffSVcrlURzE+W3zbryu0BkQ6tiGeSgp248nP94ZxUa8iBmtp1ocZng==","mode":420,"size":276},".nycrc":{"checkedAt":1678883669555,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"auto.js":{"checkedAt":1678883671533,"integrity":"sha512-8Q3Im5cACiIFrMmxvLnJnA8SXOjAd1kh/R0UIDVnErDD1WUlJIDrNfaOcIB6rtjAXNhq/OdL1374JM/QcAJ1VQ==","mode":420,"size":36},".eslintrc":{"checkedAt":1678883671709,"integrity":"sha512-Fne5uPXxLAAArc3ju8FDFv+yrlMti4Znqbw/lTEcFLwdQK0gn46Bf9IsIfNVcOZqqfRNi5t/qq3EDdKpgEz56A==","mode":420,"size":215},"LICENSE":{"checkedAt":1678883671709,"integrity":"sha512-63+JOkjF2MIs+LELMQIrjVzHRYrKKhh2vYXZYJBn8T2FRw5t0zHr+VbvnqBUDvx+gCC2VeYZD2TXVArRYDVZng==","mode":420,"size":1082},"implementation.js":{"checkedAt":1678883671709,"integrity":"sha512-KoAdocYXKMcJxsEtOjIzr/vB3LgCquszL92F1fg+xTZRdqmpX9hk7jLu3Jmo6ll+0AoHXq3Vm0c2fj5YsQBkvw==","mode":420,"size":801},"test/implementation.js":{"checkedAt":1678883671709,"integrity":"sha512-XdQscCh+qHGHxCjqfsA7BywaBFK7rMRMgg5aNf+c4IEJeGf/BfQHNLeB9vP5hhQe/sD9u9DMLBMMIWNsD9YN9g==","mode":420,"size":601},"index.js":{"checkedAt":1678883671709,"integrity":"sha512-nzmopT//zwmGDeTEPb/3gYKrideXNVxFUYeuPn/HpV7NI/U9tkQkAdL3glhIOdlf74B0iXgPD8c4h55Wvj4iug==","mode":420,"size":388},"test/index.js":{"checkedAt":1678883671709,"integrity":"sha512-pmuIZgCKKANk6L9zKCI17rePGaxHdMAiYwkw3rkRDfUsOxSEApXW9AZkAKwi+/jEsE5oSQBRXvOySqJJmRh4aQ==","mode":420,"size":420},"polyfill.js":{"checkedAt":1678883671712,"integrity":"sha512-uMQO8pP7/6leNpSEcIefroIsvdSYh1qy0R5jCLxMdF7cyzD/fj6FNWyq572mo/LUyi8AG9Dgd0W/ONRzO1l1Wg==","mode":420,"size":867},"shim.js":{"checkedAt":1678883671712,"integrity":"sha512-Yx9xTxd8tQrr8WhqIWN0oJyziW7lqJQmwZnnGNYsGJW5EM6gbwlfYn+qEUUUW05bnanr57i9s+wyBbDPDRt0rw==","mode":420,"size":779},"test/shimmed.js":{"checkedAt":1678883671716,"integrity":"sha512-Lf/lSg49kfY3p9f3warVytCWleZrqSEBSXh1vRrG0CAziJ7DwDZEfDT7evXIdaoZFuKyv1Nz1LFzWHrLVA138w==","mode":420,"size":1739},"test/tests.js":{"checkedAt":1678883671716,"integrity":"sha512-TisihRY2x+VKAvUt3RxpnYQNbbRPoquK2Rt4VSiCIqK4A3ses+h0HOIYwyzcIWfFM5Y3t5pkIljX8Fd9+n5l5g==","mode":420,"size":4327},"package.json":{"checkedAt":1678883671716,"integrity":"sha512-21hMq8efIeN++RXjsdPXmYtouP2eiqYDO+8rtDqh2Mp0PZZpDZkjk0DR2hqra6Zlmz8b2G6fD0+3QRqLiD7/8w==","mode":420,"size":2354},"CHANGELOG.md":{"checkedAt":1678883671723,"integrity":"sha512-vya57M6m5HsJfrTNh/hLZDDKQtnfMSsec4MHt5qcE5lo5qYgc01RYr55Vtu5yuZu6aUYErWDXBU/YHxihcA+pw==","mode":420,"size":20182},"README.md":{"checkedAt":1678883671723,"integrity":"sha512-6uIs1SFfMb9y6TYNUIE5uLDBieQzkZuafoPkhFUAikj3fHa9oAoYtotxW6gEvmW183isKJLKwottxjaaoUzaiw==","mode":420,"size":2493}}}
|
||||
@@ -0,0 +1,27 @@
|
||||
var createFlow = require('./_createFlow');
|
||||
|
||||
/**
|
||||
* Creates a function that returns the result of invoking the given functions
|
||||
* with the `this` binding of the created function, where each successive
|
||||
* invocation is supplied the return value of the previous.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category Util
|
||||
* @param {...(Function|Function[])} [funcs] The functions to invoke.
|
||||
* @returns {Function} Returns the new composite function.
|
||||
* @see _.flowRight
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flow([_.add, square]);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flow = createFlow();
|
||||
|
||||
module.exports = flow;
|
||||
@@ -0,0 +1,200 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var url = require('url');
|
||||
var LRU = require('lru-cache');
|
||||
var Agent = require('agent-base');
|
||||
var inherits = require('util').inherits;
|
||||
var debug = require('debug')('proxy-agent');
|
||||
var getProxyForUrl = require('proxy-from-env').getProxyForUrl;
|
||||
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var PacProxyAgent = require('pac-proxy-agent');
|
||||
var HttpProxyAgent = require('http-proxy-agent');
|
||||
var HttpsProxyAgent = require('https-proxy-agent');
|
||||
var SocksProxyAgent = require('socks-proxy-agent');
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
exports = module.exports = ProxyAgent;
|
||||
|
||||
/**
|
||||
* Number of `http.Agent` instances to cache.
|
||||
*
|
||||
* This value was arbitrarily chosen... a better
|
||||
* value could be conceived with some benchmarks.
|
||||
*/
|
||||
|
||||
var cacheSize = 20;
|
||||
|
||||
/**
|
||||
* Cache for `http.Agent` instances.
|
||||
*/
|
||||
|
||||
exports.cache = new LRU(cacheSize);
|
||||
|
||||
/**
|
||||
* Built-in proxy types.
|
||||
*/
|
||||
|
||||
exports.proxies = Object.create(null);
|
||||
exports.proxies.http = httpOrHttpsProxy;
|
||||
exports.proxies.https = httpOrHttpsProxy;
|
||||
exports.proxies.socks = SocksProxyAgent;
|
||||
exports.proxies.socks4 = SocksProxyAgent;
|
||||
exports.proxies.socks4a = SocksProxyAgent;
|
||||
exports.proxies.socks5 = SocksProxyAgent;
|
||||
exports.proxies.socks5h = SocksProxyAgent;
|
||||
|
||||
PacProxyAgent.protocols.forEach(function (protocol) {
|
||||
exports.proxies['pac+' + protocol] = PacProxyAgent;
|
||||
});
|
||||
|
||||
function httpOrHttps(opts, secureEndpoint) {
|
||||
if (secureEndpoint) {
|
||||
// HTTPS
|
||||
return https.globalAgent;
|
||||
} else {
|
||||
// HTTP
|
||||
return http.globalAgent;
|
||||
}
|
||||
}
|
||||
|
||||
function httpOrHttpsProxy(opts, secureEndpoint) {
|
||||
if (secureEndpoint) {
|
||||
// HTTPS
|
||||
return new HttpsProxyAgent(opts);
|
||||
} else {
|
||||
// HTTP
|
||||
return new HttpProxyAgent(opts);
|
||||
}
|
||||
}
|
||||
|
||||
function mapOptsToProxy(opts) {
|
||||
// NO_PROXY case
|
||||
if (!opts) {
|
||||
return {
|
||||
uri: 'no proxy',
|
||||
fn: httpOrHttps
|
||||
};
|
||||
}
|
||||
|
||||
if ('string' == typeof opts) opts = url.parse(opts);
|
||||
|
||||
var proxies;
|
||||
if (opts.proxies) {
|
||||
proxies = Object.assign({}, exports.proxies, opts.proxies);
|
||||
} else {
|
||||
proxies = exports.proxies;
|
||||
}
|
||||
|
||||
// get the requested proxy "protocol"
|
||||
var protocol = opts.protocol;
|
||||
if (!protocol) {
|
||||
throw new TypeError('You must specify a "protocol" for the ' +
|
||||
'proxy type (' + Object.keys(proxies).join(', ') + ')');
|
||||
}
|
||||
|
||||
// strip the trailing ":" if present
|
||||
if (':' == protocol[protocol.length - 1]) {
|
||||
protocol = protocol.substring(0, protocol.length - 1);
|
||||
}
|
||||
|
||||
// get the proxy `http.Agent` creation function
|
||||
var proxyFn = proxies[protocol];
|
||||
if ('function' != typeof proxyFn) {
|
||||
throw new TypeError('unsupported proxy protocol: "' + protocol + '"');
|
||||
}
|
||||
|
||||
// format the proxy info back into a URI, since an opts object
|
||||
// could have been passed in originally. This generated URI is used
|
||||
// as part of the "key" for the LRU cache
|
||||
return {
|
||||
opts: opts,
|
||||
uri: url.format({
|
||||
protocol: protocol + ':',
|
||||
slashes: true,
|
||||
auth: opts.auth,
|
||||
hostname: opts.hostname || opts.host,
|
||||
port: opts.port
|
||||
}),
|
||||
fn: proxyFn,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to get an `http.Agent` instance based off of the given proxy URI
|
||||
* information, and the `secure` flag.
|
||||
*
|
||||
* An LRU cache is used, to prevent unnecessary creation of proxy
|
||||
* `http.Agent` instances.
|
||||
*
|
||||
* @param {String} uri proxy url
|
||||
* @param {Boolean} secure true if this is for an HTTPS request, false for HTTP
|
||||
* @return {http.Agent}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function ProxyAgent (opts) {
|
||||
if (!(this instanceof ProxyAgent)) return new ProxyAgent(opts);
|
||||
debug('creating new ProxyAgent instance: %o', opts);
|
||||
Agent.call(this);
|
||||
|
||||
if (opts) {
|
||||
var proxy = mapOptsToProxy(opts);
|
||||
this.proxy = proxy.opts;
|
||||
this.proxyUri = proxy.uri;
|
||||
this.proxyFn = proxy.fn;
|
||||
}
|
||||
}
|
||||
inherits(ProxyAgent, Agent);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
ProxyAgent.prototype.callback = function(req, opts, fn) {
|
||||
var proxyOpts = this.proxy;
|
||||
var proxyUri = this.proxyUri;
|
||||
var proxyFn = this.proxyFn;
|
||||
|
||||
// if we did not instantiate with a proxy, set one per request
|
||||
if (!proxyOpts) {
|
||||
var urlOpts = getProxyForUrl(opts);
|
||||
var proxy = mapOptsToProxy(urlOpts, opts);
|
||||
proxyOpts = proxy.opts;
|
||||
proxyUri = proxy.uri;
|
||||
proxyFn = proxy.fn;
|
||||
}
|
||||
|
||||
// create the "key" for the LRU cache
|
||||
var key = proxyUri;
|
||||
if (opts.secureEndpoint) key += ' secure';
|
||||
|
||||
// attempt to get a cached `http.Agent` instance first
|
||||
var agent = exports.cache.get(key);
|
||||
if (!agent) {
|
||||
// get an `http.Agent` instance from protocol-specific agent function
|
||||
agent = proxyFn(proxyOpts, opts.secureEndpoint);
|
||||
if (agent) {
|
||||
exports.cache.set(key, agent);
|
||||
}
|
||||
} else {
|
||||
debug('cache hit with key: %o', key);
|
||||
}
|
||||
|
||||
if (!proxyOpts) {
|
||||
agent.addRequest(req, opts);
|
||||
} else {
|
||||
// XXX: agent.callback() is an agent-base-ism
|
||||
agent.callback(req, opts)
|
||||
.then(function(socket) { fn(null, socket); })
|
||||
.catch(function(error) { fn(error); });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
||||
|
||||
Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
|
||||
|
||||
@example
|
||||
```
|
||||
import {UnionToIntersection} from 'type-fest';
|
||||
|
||||
type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};
|
||||
|
||||
type Intersection = UnionToIntersection<Union>;
|
||||
//=> {the(): void; great(arg: string): void; escape: boolean};
|
||||
```
|
||||
|
||||
A more applicable example which could make its way into your library code follows.
|
||||
|
||||
@example
|
||||
```
|
||||
import {UnionToIntersection} from 'type-fest';
|
||||
|
||||
class CommandOne {
|
||||
commands: {
|
||||
a1: () => undefined,
|
||||
b1: () => undefined,
|
||||
}
|
||||
}
|
||||
|
||||
class CommandTwo {
|
||||
commands: {
|
||||
a2: (argA: string) => undefined,
|
||||
b2: (argB: string) => undefined,
|
||||
}
|
||||
}
|
||||
|
||||
const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
|
||||
type Union = typeof union;
|
||||
//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
|
||||
|
||||
type Intersection = UnionToIntersection<Union>;
|
||||
//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
|
||||
```
|
||||
|
||||
@category Utilities
|
||||
*/
|
||||
export type UnionToIntersection<Union> = (
|
||||
// `extends unknown` is always going to be the case and is used to convert the
|
||||
// `Union` into a [distributive conditional
|
||||
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
||||
Union extends unknown
|
||||
// The union type is used as the only argument to a function since the union
|
||||
// of function arguments is an intersection.
|
||||
? (distributedUnion: Union) => void
|
||||
// This won't happen.
|
||||
: never
|
||||
// Infer the `Intersection` type since TypeScript represents the positional
|
||||
// arguments of unions of functions as an intersection of the union.
|
||||
) extends ((mergedIntersection: infer Intersection) => void)
|
||||
? Intersection
|
||||
: never;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0.00522,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.02088,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0.00522,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00522,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0.00522,"45":0,"46":0,"47":0,"48":0.01044,"49":0,"50":0,"51":0,"52":0.01566,"53":0,"54":0.00522,"55":0,"56":0,"57":0,"58":0,"59":0.00522,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00522,"69":0,"70":0.00522,"71":0.00522,"72":0.00522,"73":0,"74":0,"75":0.00522,"76":0,"77":0.00522,"78":0.03655,"79":0.00522,"80":0.00522,"81":0.00522,"82":0.00522,"83":0.00522,"84":0.00522,"85":0,"86":0,"87":0.00522,"88":0.00522,"89":0.00522,"90":0.00522,"91":0.00522,"92":0,"93":0.01044,"94":0.02088,"95":0,"96":0,"97":0.00522,"98":0,"99":0,"100":0.00522,"101":0.00522,"102":0.06787,"103":0.00522,"104":0.00522,"105":0.01044,"106":0.01044,"107":0.01566,"108":0.05221,"109":0.85102,"110":0.54298,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0.00522,"36":0,"37":0,"38":0,"39":0,"40":0.01044,"41":0,"42":0,"43":0.00522,"44":0,"45":0,"46":0,"47":0,"48":0.02088,"49":0.02088,"50":0,"51":0,"52":0.00522,"53":0,"54":0,"55":0,"56":0.13053,"57":0,"58":0,"59":0.00522,"60":0.00522,"61":0.01044,"62":0.00522,"63":0.00522,"64":0.00522,"65":0.00522,"66":0.02611,"67":0.00522,"68":0.01566,"69":0.01566,"70":0.01044,"71":0.01566,"72":0.01566,"73":0.01044,"74":0.02088,"75":0.02088,"76":0.08354,"77":0.01566,"78":0.02088,"79":0.08876,"80":0.04177,"81":0.05743,"83":0.08354,"84":0.04177,"85":0.06265,"86":0.06787,"87":0.06787,"88":0.03133,"89":0.04177,"90":0.04177,"91":0.04177,"92":0.02088,"93":0.07832,"94":0.02611,"95":0.01044,"96":0.03133,"97":0.05221,"98":0.03133,"99":0.04699,"100":0.04177,"101":0.06787,"102":0.12008,"103":0.28193,"104":0.07832,"105":0.15141,"106":0.08876,"107":0.18274,"108":1.23216,"109":6.90738,"110":4.09849,"111":0.02088,"112":0.04177,"113":0.01044},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0.00522,"54":0.00522,"55":0.00522,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00522,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00522,"74":0.00522,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.02088,"94":0.21928,"95":0.14619,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0.00522,"13":0,"14":0,"15":0.00522,"16":0,"17":0,"18":0.00522,"79":0,"80":0.00522,"81":0.00522,"83":0.00522,"84":0.00522,"85":0.00522,"86":0.00522,"87":0.01044,"88":0.00522,"89":0.00522,"90":0.00522,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.00522,"101":0,"102":0,"103":0.00522,"104":0.00522,"105":0.00522,"106":0.00522,"107":0.12008,"108":0.0992,"109":1.34702,"110":1.92133},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0.00522,"10":0,"11":0,"12":0.00522,"13":0.02611,"14":0.11486,"15":0.03133,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0.10442,"10.1":0,"11.1":0.00522,"12.1":0.04177,"13.1":0.27149,"14.1":0.33414,"15.1":0.05221,"15.2-15.3":0.04699,"15.4":0.10442,"15.5":0.20362,"15.6":1.11729,"16.0":0.12008,"16.1":0.35503,"16.2":1.22694,"16.3":0.80926,"16.4":0.00522},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0041,"5.0-5.1":0,"6.0-6.1":0.0082,"7.0-7.1":0,"8.1-8.4":0.0041,"9.0-9.2":0.04922,"9.3":0.07794,"10.0-10.2":0.0082,"10.3":0.09845,"11.0-11.2":0.04102,"11.3-11.4":0.04512,"12.0-12.1":0.03282,"12.2-12.5":0.4348,"13.0-13.1":0.03282,"13.2":0.2256,"13.3":0.05332,"13.4-13.7":0.16818,"14.0-14.4":0.47172,"14.5-14.8":0.95164,"15.0-15.1":0.26252,"15.2-15.3":0.38558,"15.4":0.40199,"15.5":0.85319,"15.6":3.92551,"16.0":3.70811,"16.1":10.56648,"16.2":11.13664,"16.3":5.57858,"16.4":0.02871},P:{"4":0.0519,"20":0.61241,"5.0-5.4":0.01038,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.01038,"12.0":0.01038,"13.0":0.01038,"14.0":0.01038,"15.0":0.01038,"16.0":0.04152,"17.0":0.03114,"18.0":0.06228,"19.0":0.76811},I:{"0":0,"3":0.0179,"4":0.06563,"2.1":0.0537,"2.2":0.02983,"2.3":0,"4.1":0.0179,"4.2-4.3":0.17303,"4.4":0,"4.4.3-4.4.4":0.14916},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.03494,"9":0.02329,"10":0.00582,"11":0.08735,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.00478,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.08124},H:{"0":0.25337},L:{"0":29.99886},R:{_:"0"},M:{"0":0.44923},Q:{"13.1":0.03345}};
|
||||
@@ -0,0 +1,113 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.4](https://github.com/inspect-js/is-symbol/compare/v1.0.3...v1.0.4) - 2021-05-08
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`997d43c`](https://github.com/inspect-js/is-symbol/commit/997d43c091d1f8d3a2b3d7dfb17a73cdc5a75dde)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`fe0ccb7`](https://github.com/inspect-js/is-symbol/commit/fe0ccb7b7b64e74e095ef782dcc1d24d6c4b0be4)
|
||||
- [meta] remove unused Makefile and associated utilities [`3ab2748`](https://github.com/inspect-js/is-symbol/commit/3ab2748ab6c2de21fc24f131bb880c68ba0b7b34)
|
||||
- [meta] do not publish github action workflow files [`f20fafe`](https://github.com/inspect-js/is-symbol/commit/f20fafeb21585c7b4871ea19f104fd7696734fe8)
|
||||
- [Tests] run `nyc` on all tests [`5c332fc`](https://github.com/inspect-js/is-symbol/commit/5c332fc92cecbed4a2041bc0c52b991b4a593f34)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`c5a58a8`](https://github.com/inspect-js/is-symbol/commit/c5a58a8bea390a9b02e1c8c4aac30c223370297b)
|
||||
- [readme] fix repo URLs; remove travis badge [`bcd9258`](https://github.com/inspect-js/is-symbol/commit/bcd9258d161fe709148fcc47962df3372c544727)
|
||||
- [actions] add "Allow Edits" workflow [`33ae2d3`](https://github.com/inspect-js/is-symbol/commit/33ae2d3940e9daa6003a84c232874ee558b2fb44)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`e53def0`](https://github.com/inspect-js/is-symbol/commit/e53def0b77c38cbfae87fd8bbfd78953b845ea94)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect` [`ae36504`](https://github.com/inspect-js/is-symbol/commit/ae365048c0c1b13457faa78658b80561f5a0bcd0)
|
||||
- [readme] add actions and codecov badges [`aae7f09`](https://github.com/inspect-js/is-symbol/commit/aae7f09bd59d36df69d3b66d9b351c39fe072330)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`d993fae`](https://github.com/inspect-js/is-symbol/commit/d993fae6d89856d4ab7818874be597249cb8a8cc)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`51808a5`](https://github.com/inspect-js/is-symbol/commit/51808a55f272023201f40a59b2459ec6305bf73a)
|
||||
- [Dev Deps] update `auto-changelog`, `tape` [`c90040f`](https://github.com/inspect-js/is-symbol/commit/c90040f0aeded8d0071a78d5cd593b385f8828ee)
|
||||
- [Dev Deps] update `eslint`, `tape` [`9fee159`](https://github.com/inspect-js/is-symbol/commit/9fee159403d499a5ed2f5cb5db03747d09ab1766)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`b166afc`](https://github.com/inspect-js/is-symbol/commit/b166afc3ae3c6d11721a9558ddb112a28261688d)
|
||||
- [meta] gitignore coverage output [`4a0fe3a`](https://github.com/inspect-js/is-symbol/commit/4a0fe3aa074b933074fcc231ce739005e1fec195)
|
||||
- [actions] update workflows [`fbcbc9e`](https://github.com/inspect-js/is-symbol/commit/fbcbc9eb5bfe2cf9a77d5bd86bb1dece8e5f81d0)
|
||||
- [Dev Deps] update `auto-changelog`; add `aud` [`e66ab98`](https://github.com/inspect-js/is-symbol/commit/e66ab989e48b81b48bd443d35dba0071950c5d7a)
|
||||
- [Deps] update `has-symbols` [`6ce7de5`](https://github.com/inspect-js/is-symbol/commit/6ce7de53c866c068de2c28d97b3a64cf6d5f6a76)
|
||||
- [actions] update rebase action to use checkout v2 [`1173c79`](https://github.com/inspect-js/is-symbol/commit/1173c79914076d73aec9aebc22dce4122e7bd3ae)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`94a6348`](https://github.com/inspect-js/is-symbol/commit/94a6348f6274eac9bf4c5a6057b4f6120fc7d1d1)
|
||||
- [Tests] only audit prod deps [`0692681`](https://github.com/inspect-js/is-symbol/commit/06926811fa029fe0fded5d0af4553a7808c143d1)
|
||||
- [meta] do not publish .nvmrc file [`ed47833`](https://github.com/inspect-js/is-symbol/commit/ed478333c72384f8dbeb51e5fd501238f52a4972)
|
||||
|
||||
## [v1.0.3](https://github.com/inspect-js/is-symbol/compare/v1.0.2...v1.0.3) - 2019-11-20
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] use shared travis-ci configs [`034afdd`](https://github.com/inspect-js/is-symbol/commit/034afdd677c1b72b76751f3e5131acc927a32916)
|
||||
- [Tests] remove `jscs` [`0c026a0`](https://github.com/inspect-js/is-symbol/commit/0c026a06815e46a33a8a5b4b1be8965d32d38e5c)
|
||||
- [meta] add `auto-changelog` [`9a1776b`](https://github.com/inspect-js/is-symbol/commit/9a1776bb49f3e6ac12a5b3a447edcc651216891b)
|
||||
- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`23a6db4`](https://github.com/inspect-js/is-symbol/commit/23a6db49a338d19eab19d876745513820bb6a9dc)
|
||||
- [Tests] up to `node` `v11.7`, `v10.15`, `v8.15`, `v6.16` [`892d92e`](https://github.com/inspect-js/is-symbol/commit/892d92e7c40f3c0577583a98134106181c38bb7e)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `tape` [`c2e6d6a`](https://github.com/inspect-js/is-symbol/commit/c2e6d6a71f839522bbd124b7419f5fc42ffff6d3)
|
||||
- [readme] fix repo URLs [`655c288`](https://github.com/inspect-js/is-symbol/commit/655c288a815856e647dba4b6049b1743cec3533c)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`97b1229`](https://github.com/inspect-js/is-symbol/commit/97b12296bf8fa1ce0c6121bf3de56c413da10aae)
|
||||
- [meta] add FUNDING.yml [`94c64a3`](https://github.com/inspect-js/is-symbol/commit/94c64a367a1c34f960cf6007fc65cfbbcba34ba3)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape`, `semver` [`71ab543`](https://github.com/inspect-js/is-symbol/commit/71ab543e09b820378362f4f66248addd410c6388)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `tape` [`c6212f9`](https://github.com/inspect-js/is-symbol/commit/c6212f94e28622c94bb37189ffc241ee88b5b1dd)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `object-inspect` [`91bc802`](https://github.com/inspect-js/is-symbol/commit/91bc802e18e63f4e8230ee0148302ce849e2f733)
|
||||
- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`8cbe69c`](https://github.com/inspect-js/is-symbol/commit/8cbe69c3fafe9cfbe7d27f710c88d02d2d2c6a00)
|
||||
- [Tests] use `npm audit` instead of `nsp` [`741b51d`](https://github.com/inspect-js/is-symbol/commit/741b51dac868f6b22736c204910d257bcf4d5044)
|
||||
- [meta] add `funding` field [`65b58d1`](https://github.com/inspect-js/is-symbol/commit/65b58d1e9fc572712d462d615e6b2418627d8fb9)
|
||||
- [Deps] update `has-symbols` [`9cb5b2a`](https://github.com/inspect-js/is-symbol/commit/9cb5b2a9a3b89e8e0246be8df4fff3f5ceac7309)
|
||||
|
||||
## [v1.0.2](https://github.com/inspect-js/is-symbol/compare/v1.0.1...v1.0.2) - 2018-09-20
|
||||
|
||||
### Commits
|
||||
|
||||
- Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`e86aaea`](https://github.com/inspect-js/is-symbol/commit/e86aaea8d81356801ecfc60540523e9b809a55f4)
|
||||
- [Tests] on all node minors; improve test matrix [`50bc07f`](https://github.com/inspect-js/is-symbol/commit/50bc07f2ff73e5499b02a61f0a00ea48a84ae213)
|
||||
- [Dev Deps] update `tape`, `jscs`, `nsp`, `semver`, `eslint`, `@ljharb/eslint-config` [`45e17bd`](https://github.com/inspect-js/is-symbol/commit/45e17bdf145846f30122348a94c5e506b90836ba)
|
||||
- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9`; use `nvm install-latest-npm` [`44402cb`](https://github.com/inspect-js/is-symbol/commit/44402cb82d4499e947b48b31b14667d1ebe7e2b4)
|
||||
- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`, `v4.8`; improve matrix; old npm breaks on newer nodes [`9047c23`](https://github.com/inspect-js/is-symbol/commit/9047c232857ecb80551a21cc0b1cc4c91d28da1f)
|
||||
- Update `tape`, `covert`, `jscs`, `semver` [`d57d1ce`](https://github.com/inspect-js/is-symbol/commit/d57d1ce3fc0b740885a1ed5c0738d4a27b29ab07)
|
||||
- Add `npm run eslint` [`0d75a66`](https://github.com/inspect-js/is-symbol/commit/0d75a6638ad6f7ff7d5bc958531a6328fb13e3fe)
|
||||
- Update `eslint` [`042fb3a`](https://github.com/inspect-js/is-symbol/commit/042fb3aec590f0c0d205b15812b285ad95cfff6b)
|
||||
- [Refactor] use `has-symbols` and `object-inspect` [`129bc68`](https://github.com/inspect-js/is-symbol/commit/129bc68dd619b789b9956ac9b63b46257ee1060c)
|
||||
- [Tests] up to `node` `v10.11`, `v8.12` [`c1822e8`](https://github.com/inspect-js/is-symbol/commit/c1822e84d6cc0cee9f1c2893e91b1aa999ad41db)
|
||||
- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`089d2cf`](https://github.com/inspect-js/is-symbol/commit/089d2cf7cad87b75aa534769af11524ad2e79080)
|
||||
- [Tests] up to `node` `v8.4`; newer npm breaks on older node [`05ce701`](https://github.com/inspect-js/is-symbol/commit/05ce701e3c1be8b3266ffac49806832e410491c1)
|
||||
- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. [`241e6a6`](https://github.com/inspect-js/is-symbol/commit/241e6a655c0e19e9dcf0ae88e7fddd4cde394c5c)
|
||||
- Test on latest `node` and `io.js` versions. [`5c8d5de`](https://github.com/inspect-js/is-symbol/commit/5c8d5deb9b7c01a8cdf959082a3d619c19751b0a)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` [`06047bf`](https://github.com/inspect-js/is-symbol/commit/06047bf72b20a66c0b455e80856b2d00b1910391)
|
||||
- [Dev Deps] update `jscs`, `nsp`, `semver`, `eslint`, `@ljharb/eslint-config` [`9d25dd7`](https://github.com/inspect-js/is-symbol/commit/9d25dd79347c89f98207a3bad39f667f1f8a410e)
|
||||
- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`ce173bd`](https://github.com/inspect-js/is-symbol/commit/ce173bda6e146907e3061a0e70463107d955de35)
|
||||
- Update `nsp`, `eslint` [`29e5214`](https://github.com/inspect-js/is-symbol/commit/29e52140fac2049b4a32e175787bb3b184a1dd72)
|
||||
- Update `semver`, `eslint` [`53be884`](https://github.com/inspect-js/is-symbol/commit/53be884c2811f7a4452581003d9cdaf6f9bddd3c)
|
||||
- [Dev Deps] update `eslint`, `nsp`, `semver`, `tape` [`3bd149c`](https://github.com/inspect-js/is-symbol/commit/3bd149c869c099b07104b06c0692755a01f8298c)
|
||||
- [Dev Deps] update `jscs` [`69b4231`](https://github.com/inspect-js/is-symbol/commit/69b4231632b170e5ddb350db2f0c59e6cad6f548)
|
||||
- Test up to `io.js` `v2.1` [`0b61ac7`](https://github.com/inspect-js/is-symbol/commit/0b61ac7ac4de390296aeefb9395549592ea87da4)
|
||||
- [Dev Deps] update `tape` [`5e1b200`](https://github.com/inspect-js/is-symbol/commit/5e1b2008c910bcdabee299a1ac599143ea07c3f9)
|
||||
- Only apps should have lockfiles. [`a191ff5`](https://github.com/inspect-js/is-symbol/commit/a191ff5f0320fc16db42fdaa40f0c21d4326255e)
|
||||
- [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` [`97c87ef`](https://github.com/inspect-js/is-symbol/commit/97c87ef52b966f211e231092a54ef6ed05c99a26)
|
||||
- Test on `io.js` `v2.2` [`42560e4`](https://github.com/inspect-js/is-symbol/commit/42560e466e17cbbb9fa71c0121f4bbbcf266c887)
|
||||
- [Dev Deps] Update `tape`, `eslint` [`149b2f2`](https://github.com/inspect-js/is-symbol/commit/149b2f20bde92b2da12ccfeb8988beb2dc95c37c)
|
||||
- [Tests] fix test messages [`28bd1ed`](https://github.com/inspect-js/is-symbol/commit/28bd1eda310590e13ada19cbd718c85c25d8a0c5)
|
||||
- Test up to `io.js` `v3.0` [`c0dcc98`](https://github.com/inspect-js/is-symbol/commit/c0dcc98313d17151ec043e5452df306618be865e)
|
||||
- `node` now supports Symbols now. [`d1853ad`](https://github.com/inspect-js/is-symbol/commit/d1853adf6369ab9d4c4516bdb032c2e42f52f90a)
|
||||
- [Dev Deps] update `tape` [`f7a6575`](https://github.com/inspect-js/is-symbol/commit/f7a6575fbdef13abcc412c63d22b56943ed85969)
|
||||
- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`aae9c6a`](https://github.com/inspect-js/is-symbol/commit/aae9c6a724578659976ea74e11ec9fe35608607b)
|
||||
- Test on `io.js` `v2.4` [`ab8f449`](https://github.com/inspect-js/is-symbol/commit/ab8f4492115270cc00a479915b02ac1bac75dfed)
|
||||
- Test on `io.js` `v2.3` [`58ce871`](https://github.com/inspect-js/is-symbol/commit/58ce871674e857955b333aa057eeecd68b40e988)
|
||||
|
||||
## [v1.0.1](https://github.com/inspect-js/is-symbol/compare/v1.0.0...v1.0.1) - 2015-01-26
|
||||
|
||||
### Commits
|
||||
|
||||
- Correct package description. [`f4d15b9`](https://github.com/inspect-js/is-symbol/commit/f4d15b928b4b754b097a84f7c3ceac73c486aceb)
|
||||
|
||||
## v1.0.0 - 2015-01-24
|
||||
|
||||
### Commits
|
||||
|
||||
- Dotfiles. [`5d9a744`](https://github.com/inspect-js/is-symbol/commit/5d9a7441f724630070e9bd74a995191cafa1064b)
|
||||
- Tests. [`8af5663`](https://github.com/inspect-js/is-symbol/commit/8af56631950dcee48b36f517837273193a6ba119)
|
||||
- `make release` [`6293446`](https://github.com/inspect-js/is-symbol/commit/629344654a72e7fc8059607d6a86c64b002c3e5d)
|
||||
- package.json [`7d4082c`](https://github.com/inspect-js/is-symbol/commit/7d4082ca9502118e70d24f526704d45a1a7f2067)
|
||||
- Initial commit [`cbb179f`](https://github.com/inspect-js/is-symbol/commit/cbb179f677bd3dcb56ac5e3f0a7a9af503fd8952)
|
||||
- Read me. [`099a775`](https://github.com/inspect-js/is-symbol/commit/099a775e7e751706283ae1cab7a8635c094773a9)
|
||||
- Implementation. [`cb51248`](https://github.com/inspect-js/is-symbol/commit/cb51248eedaf55e0b8ad7dacdab179db2d76e96e)
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare function isString(input: unknown): input is string;
|
||||
export declare function isEmpty(input: string): boolean;
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
Create a type that requires all of the given keys or none of the given keys. The remaining keys are kept as is.
|
||||
|
||||
Use-cases:
|
||||
- Creating interfaces for components with mutually-inclusive keys.
|
||||
|
||||
The caveat with `RequireAllOrNone` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireAllOrNone` can't do anything to prevent extra keys it doesn't know about.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {RequireAllOrNone} from 'type-fest';
|
||||
|
||||
type Responder = {
|
||||
text?: () => string;
|
||||
json?: () => string;
|
||||
secure: boolean;
|
||||
};
|
||||
|
||||
const responder1: RequireAllOrNone<Responder, 'text' | 'json'> = {
|
||||
secure: true
|
||||
};
|
||||
|
||||
const responder2: RequireAllOrNone<Responder, 'text' | 'json'> = {
|
||||
text: () => '{"message": "hi"}',
|
||||
json: () => '{"message": "ok"}',
|
||||
secure: true
|
||||
};
|
||||
```
|
||||
|
||||
@category Object
|
||||
*/
|
||||
export type RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType = never> = (
|
||||
| Required<Pick<ObjectType, KeysType>> // Require all of the given keys.
|
||||
| Partial<Record<KeysType, never>> // Require none of the given keys.
|
||||
) &
|
||||
Omit<ObjectType, KeysType>; // The rest of the keys.
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.identity = void 0;
|
||||
function identity(x) {
|
||||
return x;
|
||||
}
|
||||
exports.identity = identity;
|
||||
//# sourceMappingURL=identity.js.map
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "jsonfile",
|
||||
"version": "4.0.0",
|
||||
"description": "Easily read/write JSON files.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:jprichardson/node-jsonfile.git"
|
||||
},
|
||||
"keywords": [
|
||||
"read",
|
||||
"write",
|
||||
"file",
|
||||
"json",
|
||||
"fs",
|
||||
"fs-extra"
|
||||
],
|
||||
"author": "JP Richardson <jprichardson@gmail.com>",
|
||||
"license": "MIT",
|
||||
"dependencies": {},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "2.x",
|
||||
"rimraf": "^2.4.0",
|
||||
"standard": "^10.0.3"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"test": "npm run lint && npm run unit",
|
||||
"unit": "mocha"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
|
||||
var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD');
|
||||
var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD');
|
||||
|
||||
console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
|
||||
console.log(b, ': preserveSymlinks true');
|
||||
console.log(c, ': preserveSymlinks false');
|
||||
|
||||
if (a !== b && a !== c) {
|
||||
throw 'sync: no match';
|
||||
}
|
||||
console.log('sync: success! a matched either b or c\n');
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"postcss-import","version":"14.1.0","files":{"lib/join-layer.js":{"checkedAt":1678883673213,"integrity":"sha512-YZnQx09yaeavsP0QiorJFD1zbCW1HeadS92byHvVyUM2bbn0VuR4B+1bl/PtKAJPJv3tnICyTvgD9ah+9Oq1TQ==","mode":420,"size":303},"LICENSE":{"checkedAt":1678883673213,"integrity":"sha512-sBr2KRMNbiV0cHv3pyCe7H/QTFMJozEbbMlIMxpLNyqPobERYp6wayXIyt8CHYRhLR+YJ59oYobynCjWX9ejLg==","mode":493,"size":1118},"lib/join-media.js":{"checkedAt":1678883673213,"integrity":"sha512-AJW0tdDN11a/UZYDy+cM5ra1Czh0AduExJkyOhFY9L+5xDdi/D/+usUrOdHq4mwfxsNW8qXGz3Oe7hMK+m4ZLw==","mode":420,"size":468},"index.js":{"checkedAt":1678883673213,"integrity":"sha512-/rAxloxx8XMRpcJT1qiX0RbQxhKYd/zpaub6axB62TtawX3+HmaSE5qol6lb1G+LLCjjAe2EQEPQFLLCW5HZzg==","mode":493,"size":11063},"lib/load-content.js":{"checkedAt":1678883673215,"integrity":"sha512-ZWKFf33Ph6dNGrtAnPM9XHNPicjt2tc2Ka4nSuaFlVfwBUZgV5KbUkdqsfgYvXvmNaFKXmvHjSSvHugFBjdRww==","mode":420,"size":113},"lib/parse-statements.js":{"checkedAt":1678883673215,"integrity":"sha512-AlQkePA99mQeIgxP+DMXsiFbBAl/Fcwt8Q+prah83fKnM8L+AbnuNS5TBerSYIab7TadzgosWDZzr3LdvHxUhg==","mode":420,"size":3773},"lib/resolve-id.js":{"checkedAt":1678883673215,"integrity":"sha512-UZLJGMBrFlxtmP5KKJZLiaXTGRYvAZRL9amAraS/kB/FO+i/0Ub2dmy5uxhoMQbkIXGBKXafwNITCLsfZbpXiA==","mode":420,"size":1030},"package.json":{"checkedAt":1678883673215,"integrity":"sha512-R/ODdG1H2E6GdjyHsaGpHEuWI3JdPMWF0sa479ssYOgjLPlw8W/1USmHib/W7y0Rcr/XJ7vUemmSkouyrAF3AQ==","mode":420,"size":1278},"lib/process-content.js":{"checkedAt":1678883673215,"integrity":"sha512-jQg57Hmm/V5atRhn5qCY3FblbgH4XWQ63WHFUhXxA52PCoKv+EiS+Wd2H34k5kMaNv3p9ppaDLL27gHLIidWKQ==","mode":420,"size":1353},"README.md":{"checkedAt":1678883673217,"integrity":"sha512-19vDDeFlN3KSBy7Dg2WbuGQhLc5+99bZVV+z+Pgz1U6G+nv58Vnyn8LHsCyQjS/UhhL6GF0j65x9VW4nFGyIOw==","mode":420,"size":6508}}}
|
||||
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
The rejection reason when `.cancel()` is called.
|
||||
|
||||
It includes a `.isCanceled` property for convenience.
|
||||
*/
|
||||
export class CancelError extends Error {
|
||||
readonly name: 'CancelError';
|
||||
readonly isCanceled: true;
|
||||
|
||||
constructor(reason?: string);
|
||||
}
|
||||
|
||||
/**
|
||||
Accepts a function that is called when the promise is canceled.
|
||||
|
||||
You're not required to call this function. You can call this function multiple times to add multiple cancel handlers.
|
||||
*/
|
||||
export interface OnCancelFunction {
|
||||
shouldReject: boolean;
|
||||
(cancelHandler: () => void): void;
|
||||
}
|
||||
|
||||
export default class PCancelable<ValueType> extends Promise<ValueType> {
|
||||
/**
|
||||
Whether the promise is canceled.
|
||||
*/
|
||||
readonly isCanceled: boolean;
|
||||
|
||||
/**
|
||||
Cancel the promise and optionally provide a reason.
|
||||
|
||||
The cancellation is synchronous. Calling it after the promise has settled or multiple times does nothing.
|
||||
|
||||
@param reason - The cancellation reason to reject the promise with.
|
||||
*/
|
||||
cancel: (reason?: string) => void;
|
||||
|
||||
/**
|
||||
Create a promise that can be canceled.
|
||||
|
||||
Can be constructed in the same was as a [`Promise` constructor](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise), but with an appended `onCancel` parameter in `executor`. `PCancelable` is a subclass of `Promise`.
|
||||
|
||||
Cancelling will reject the promise with `CancelError`. To avoid that, set `onCancel.shouldReject` to `false`.
|
||||
|
||||
@example
|
||||
```
|
||||
import PCancelable from 'p-cancelable';
|
||||
|
||||
const cancelablePromise = new PCancelable((resolve, reject, onCancel) => {
|
||||
const job = new Job();
|
||||
|
||||
onCancel.shouldReject = false;
|
||||
onCancel(() => {
|
||||
job.stop();
|
||||
});
|
||||
|
||||
job.on('finish', resolve);
|
||||
});
|
||||
|
||||
cancelablePromise.cancel(); // Doesn't throw an error
|
||||
```
|
||||
*/
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value?: ValueType | PromiseLike<ValueType>) => void,
|
||||
reject: (reason?: unknown) => void,
|
||||
onCancel: OnCancelFunction
|
||||
) => void
|
||||
);
|
||||
|
||||
/**
|
||||
Convenience method to make your promise-returning or async function cancelable.
|
||||
|
||||
@param fn - A promise-returning function. The function you specify will have `onCancel` appended to its parameters.
|
||||
|
||||
@example
|
||||
```
|
||||
import PCancelable from 'p-cancelable';
|
||||
|
||||
const fn = PCancelable.fn((input, onCancel) => {
|
||||
const job = new Job();
|
||||
|
||||
onCancel(() => {
|
||||
job.cleanup();
|
||||
});
|
||||
|
||||
return job.start(); //=> Promise
|
||||
});
|
||||
|
||||
const cancelablePromise = fn('input'); //=> PCancelable
|
||||
|
||||
// …
|
||||
|
||||
cancelablePromise.cancel();
|
||||
```
|
||||
*/
|
||||
static fn<ReturnType>(
|
||||
userFn: (onCancel: OnCancelFunction) => PromiseLike<ReturnType>
|
||||
): () => PCancelable<ReturnType>;
|
||||
static fn<Agument1Type, ReturnType>(
|
||||
userFn: (
|
||||
argument1: Agument1Type,
|
||||
onCancel: OnCancelFunction
|
||||
) => PromiseLike<ReturnType>
|
||||
): (argument1: Agument1Type) => PCancelable<ReturnType>;
|
||||
static fn<Agument1Type, Agument2Type, ReturnType>(
|
||||
userFn: (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
onCancel: OnCancelFunction
|
||||
) => PromiseLike<ReturnType>
|
||||
): (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type
|
||||
) => PCancelable<ReturnType>;
|
||||
static fn<Agument1Type, Agument2Type, Agument3Type, ReturnType>(
|
||||
userFn: (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
argument3: Agument3Type,
|
||||
onCancel: OnCancelFunction
|
||||
) => PromiseLike<ReturnType>
|
||||
): (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
argument3: Agument3Type
|
||||
) => PCancelable<ReturnType>;
|
||||
static fn<Agument1Type, Agument2Type, Agument3Type, Agument4Type, ReturnType>(
|
||||
userFn: (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
argument3: Agument3Type,
|
||||
argument4: Agument4Type,
|
||||
onCancel: OnCancelFunction
|
||||
) => PromiseLike<ReturnType>
|
||||
): (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
argument3: Agument3Type,
|
||||
argument4: Agument4Type
|
||||
) => PCancelable<ReturnType>;
|
||||
static fn<
|
||||
Agument1Type,
|
||||
Agument2Type,
|
||||
Agument3Type,
|
||||
Agument4Type,
|
||||
Agument5Type,
|
||||
ReturnType
|
||||
>(
|
||||
userFn: (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
argument3: Agument3Type,
|
||||
argument4: Agument4Type,
|
||||
argument5: Agument5Type,
|
||||
onCancel: OnCancelFunction
|
||||
) => PromiseLike<ReturnType>
|
||||
): (
|
||||
argument1: Agument1Type,
|
||||
argument2: Agument2Type,
|
||||
argument3: Agument3Type,
|
||||
argument4: Agument4Type,
|
||||
argument5: Agument5Type
|
||||
) => PCancelable<ReturnType>;
|
||||
static fn<ReturnType>(
|
||||
userFn: (...arguments: unknown[]) => PromiseLike<ReturnType>
|
||||
): (...arguments: unknown[]) => PCancelable<ReturnType>;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bufferTime.js","sourceRoot":"","sources":["../../../../src/internal/operators/bufferTime.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAsE1D,MAAM,UAAU,UAAU,CAAI,cAAsB;;IAAE,mBAAmB;SAAnB,UAAmB,EAAnB,qBAAmB,EAAnB,IAAmB;QAAnB,kCAAmB;;IACvE,IAAM,SAAS,GAAG,MAAA,YAAY,CAAC,SAAS,CAAC,mCAAI,cAAc,CAAC;IAC5D,IAAM,sBAAsB,GAAG,MAAC,SAAS,CAAC,CAAC,CAAY,mCAAI,IAAI,CAAC;IAChE,IAAM,aAAa,GAAI,SAAS,CAAC,CAAC,CAAY,IAAI,QAAQ,CAAC;IAE3D,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAEhC,IAAI,aAAa,GAAiD,EAAE,CAAC;QAGrE,IAAI,aAAa,GAAG,KAAK,CAAC;QAQ1B,IAAM,IAAI,GAAG,UAAC,MAA2C;YAC/C,IAAA,MAAM,GAAW,MAAM,OAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAY;YAChC,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YACjC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxB,aAAa,IAAI,WAAW,EAAE,CAAC;QACjC,CAAC,CAAC;QAOF,IAAM,WAAW,GAAG;YAClB,IAAI,aAAa,EAAE;gBACjB,IAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;gBAChC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrB,IAAM,MAAM,GAAQ,EAAE,CAAC;gBACvB,IAAM,QAAM,GAAG;oBACb,MAAM,QAAA;oBACN,IAAI,MAAA;iBACL,CAAC;gBACF,aAAa,CAAC,IAAI,CAAC,QAAM,CAAC,CAAC;gBAC3B,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,cAAM,OAAA,IAAI,CAAC,QAAM,CAAC,EAAZ,CAAY,EAAE,cAAc,CAAC,CAAC;aACtE;QACH,CAAC,CAAC;QAEF,IAAI,sBAAsB,KAAK,IAAI,IAAI,sBAAsB,IAAI,CAAC,EAAE;YAIlE,eAAe,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;SACnF;aAAM;YACL,aAAa,GAAG,IAAI,CAAC;SACtB;QAED,WAAW,EAAE,CAAC;QAEd,IAAM,oBAAoB,GAAG,wBAAwB,CACnD,UAAU,EACV,UAAC,KAAQ;;YAKP,IAAM,WAAW,GAAG,aAAc,CAAC,KAAK,EAAE,CAAC;;gBAC3C,KAAqB,IAAA,gBAAA,SAAA,WAAW,CAAA,wCAAA,iEAAE;oBAA7B,IAAM,MAAM,wBAAA;oBAEP,IAAA,MAAM,GAAK,MAAM,OAAX,CAAY;oBAC1B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAEnB,aAAa,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;iBAChD;;;;;;;;;QACH,CAAC,EACD;YAGE,OAAO,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,EAAE;gBAC5B,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAG,CAAC,MAAM,CAAC,CAAC;aAChD;YACD,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,WAAW,EAAE,CAAC;YACpC,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3B,CAAC,EAED,SAAS,EAET,cAAM,OAAA,CAAC,aAAa,GAAG,IAAI,CAAC,EAAtB,CAAsB,CAC7B,CAAC;QAEF,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,32 @@
|
||||
var copyObject = require('./_copyObject'),
|
||||
keysIn = require('./keysIn');
|
||||
|
||||
/**
|
||||
* Converts `value` to a plain object flattening inherited enumerable string
|
||||
* keyed properties of `value` to own properties of the plain object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {Object} Returns the converted plain object.
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
* this.b = 2;
|
||||
* }
|
||||
*
|
||||
* Foo.prototype.c = 3;
|
||||
*
|
||||
* _.assign({ 'a': 1 }, new Foo);
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*
|
||||
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
||||
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
||||
*/
|
||||
function toPlainObject(value) {
|
||||
return copyObject(value, keysIn(value));
|
||||
}
|
||||
|
||||
module.exports = toPlainObject;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CanonicalizeTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/CanonicalizeTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC,UAgBF"}
|
||||
@@ -0,0 +1,28 @@
|
||||
var baseUniq = require('./_baseUniq');
|
||||
|
||||
/**
|
||||
* This method is like `_.uniq` except that it accepts `comparator` which
|
||||
* is invoked to compare elements of `array`. The order of result values is
|
||||
* determined by the order they occur in the array.The comparator is invoked
|
||||
* with two arguments: (arrVal, othVal).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Array
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new duplicate free array.
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
||||
*
|
||||
* _.uniqWith(objects, _.isEqual);
|
||||
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
|
||||
*/
|
||||
function uniqWith(array, comparator) {
|
||||
comparator = typeof comparator == 'function' ? comparator : undefined;
|
||||
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
|
||||
}
|
||||
|
||||
module.exports = uniqWith;
|
||||
@@ -0,0 +1,17 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="bluebird" />
|
||||
import { Converter } from "./Converter";
|
||||
import P from "bluebird";
|
||||
import { JSONResult } from "./lineToJson";
|
||||
import { CSVParseParam } from "./Parameters";
|
||||
import { ParseRuntime } from "./ParseRuntime";
|
||||
export declare abstract class Processor {
|
||||
protected converter: Converter;
|
||||
protected params: CSVParseParam;
|
||||
protected runtime: ParseRuntime;
|
||||
constructor(converter: Converter);
|
||||
abstract process(chunk: Buffer, finalChunk?: boolean): P<ProcessLineResult[]>;
|
||||
abstract destroy(): P<void>;
|
||||
abstract flush(): P<ProcessLineResult[]>;
|
||||
}
|
||||
export declare type ProcessLineResult = string | string[] | JSONResult;
|
||||
@@ -0,0 +1,57 @@
|
||||
# is-boolean-object <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var isBoolean = require('is-boolean-object');
|
||||
var assert = require('assert');
|
||||
|
||||
assert.notOk(isBoolean(undefined));
|
||||
assert.notOk(isBoolean(null));
|
||||
assert.notOk(isBoolean('foo'));
|
||||
assert.notOk(isBoolean(function () {}));
|
||||
assert.notOk(isBoolean([]));
|
||||
assert.notOk(isBoolean({}));
|
||||
assert.notOk(isBoolean(/a/g));
|
||||
assert.notOk(isBoolean(new RegExp('a', 'g')));
|
||||
assert.notOk(isBoolean(new Date()));
|
||||
assert.notOk(isBoolean(42));
|
||||
assert.notOk(isBoolean(NaN));
|
||||
assert.notOk(isBoolean(Infinity));
|
||||
|
||||
assert.ok(isBoolean(new Boolean(42)));
|
||||
assert.ok(isBoolean(false));
|
||||
assert.ok(isBoolean(Object(false)));
|
||||
assert.ok(isBoolean(true));
|
||||
assert.ok(isBoolean(Object(true)));
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/is-boolean-object
|
||||
[2]: https://versionbadg.es/inspect-js/is-boolean-object.svg
|
||||
[5]: https://david-dm.org/inspect-js/is-boolean-object.svg
|
||||
[6]: https://david-dm.org/inspect-js/is-boolean-object
|
||||
[7]: https://david-dm.org/inspect-js/is-boolean-object/dev-status.svg
|
||||
[8]: https://david-dm.org/inspect-js/is-boolean-object#info=devDependencies
|
||||
[11]: https://nodei.co/npm/is-boolean-object.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/is-boolean-object.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/is-boolean-object.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=is-boolean-object
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/is-boolean-object/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-boolean-object/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-boolean-object
|
||||
[actions-url]: https://github.com/inspect-js/is-boolean-object/actions
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = (function () {
|
||||
var SubArray = require("./_sub-array-dummy")
|
||||
, arr;
|
||||
|
||||
if (!SubArray) return false;
|
||||
arr = new SubArray();
|
||||
if (!Array.isArray(arr)) return false;
|
||||
if (!(arr instanceof SubArray)) return false;
|
||||
|
||||
arr[34] = "foo";
|
||||
return arr.length === 35;
|
||||
})();
|
||||
@@ -0,0 +1,27 @@
|
||||
# Natural Number
|
||||
|
||||
Natural _number_ primitive
|
||||
|
||||
## `natural-number/coerce`
|
||||
|
||||
Follows [`integer/coerce`](integer.md#integercoerce) but returns `null` for values below `0`
|
||||
|
||||
```javascript
|
||||
const coerceToNaturalNumber = require("type/natural-number/coerce");
|
||||
|
||||
coerceToNaturalNumber("12.95"); // 12
|
||||
coerceToNaturalNumber(-120); // null
|
||||
coerceToNaturalNumber(null); // null
|
||||
```
|
||||
|
||||
## `natural-number/ensure`
|
||||
|
||||
If given argument is a natural number coercible value (via [`natural-number/coerce`](#natural-numbercoerce)) returns result number.
|
||||
Otherwise `TypeError` is thrown.
|
||||
|
||||
```javascript
|
||||
const ensureNaturalNumber = require("type/natural-number/ensure");
|
||||
|
||||
ensureNaturalNumber(12.93); // "12"
|
||||
ensureNaturalNumber(-230); // Thrown TypeError: null is not a natural number
|
||||
```
|
||||
@@ -0,0 +1,10 @@
|
||||
# `string.includes(position = 0)` _(ext/string\_/includes)_
|
||||
|
||||
`includes` method for strings. Resolve native [includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) if implemented, otherwise fallback to shim implementation.
|
||||
|
||||
```javascript
|
||||
const includes = require("ext/string_/includes");
|
||||
|
||||
includes.call("razdwa", "raz"); // true
|
||||
includes.call("razdwa", "trzy"); // false
|
||||
```
|
||||
@@ -0,0 +1,144 @@
|
||||
'use strict'
|
||||
/*
|
||||
* merge2
|
||||
* https://github.com/teambition/merge2
|
||||
*
|
||||
* Copyright (c) 2014-2020 Teambition
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
const Stream = require('stream')
|
||||
const PassThrough = Stream.PassThrough
|
||||
const slice = Array.prototype.slice
|
||||
|
||||
module.exports = merge2
|
||||
|
||||
function merge2 () {
|
||||
const streamsQueue = []
|
||||
const args = slice.call(arguments)
|
||||
let merging = false
|
||||
let options = args[args.length - 1]
|
||||
|
||||
if (options && !Array.isArray(options) && options.pipe == null) {
|
||||
args.pop()
|
||||
} else {
|
||||
options = {}
|
||||
}
|
||||
|
||||
const doEnd = options.end !== false
|
||||
const doPipeError = options.pipeError === true
|
||||
if (options.objectMode == null) {
|
||||
options.objectMode = true
|
||||
}
|
||||
if (options.highWaterMark == null) {
|
||||
options.highWaterMark = 64 * 1024
|
||||
}
|
||||
const mergedStream = PassThrough(options)
|
||||
|
||||
function addStream () {
|
||||
for (let i = 0, len = arguments.length; i < len; i++) {
|
||||
streamsQueue.push(pauseStreams(arguments[i], options))
|
||||
}
|
||||
mergeStream()
|
||||
return this
|
||||
}
|
||||
|
||||
function mergeStream () {
|
||||
if (merging) {
|
||||
return
|
||||
}
|
||||
merging = true
|
||||
|
||||
let streams = streamsQueue.shift()
|
||||
if (!streams) {
|
||||
process.nextTick(endStream)
|
||||
return
|
||||
}
|
||||
if (!Array.isArray(streams)) {
|
||||
streams = [streams]
|
||||
}
|
||||
|
||||
let pipesCount = streams.length + 1
|
||||
|
||||
function next () {
|
||||
if (--pipesCount > 0) {
|
||||
return
|
||||
}
|
||||
merging = false
|
||||
mergeStream()
|
||||
}
|
||||
|
||||
function pipe (stream) {
|
||||
function onend () {
|
||||
stream.removeListener('merge2UnpipeEnd', onend)
|
||||
stream.removeListener('end', onend)
|
||||
if (doPipeError) {
|
||||
stream.removeListener('error', onerror)
|
||||
}
|
||||
next()
|
||||
}
|
||||
function onerror (err) {
|
||||
mergedStream.emit('error', err)
|
||||
}
|
||||
// skip ended stream
|
||||
if (stream._readableState.endEmitted) {
|
||||
return next()
|
||||
}
|
||||
|
||||
stream.on('merge2UnpipeEnd', onend)
|
||||
stream.on('end', onend)
|
||||
|
||||
if (doPipeError) {
|
||||
stream.on('error', onerror)
|
||||
}
|
||||
|
||||
stream.pipe(mergedStream, { end: false })
|
||||
// compatible for old stream
|
||||
stream.resume()
|
||||
}
|
||||
|
||||
for (let i = 0; i < streams.length; i++) {
|
||||
pipe(streams[i])
|
||||
}
|
||||
|
||||
next()
|
||||
}
|
||||
|
||||
function endStream () {
|
||||
merging = false
|
||||
// emit 'queueDrain' when all streams merged.
|
||||
mergedStream.emit('queueDrain')
|
||||
if (doEnd) {
|
||||
mergedStream.end()
|
||||
}
|
||||
}
|
||||
|
||||
mergedStream.setMaxListeners(0)
|
||||
mergedStream.add = addStream
|
||||
mergedStream.on('unpipe', function (stream) {
|
||||
stream.emit('merge2UnpipeEnd')
|
||||
})
|
||||
|
||||
if (args.length) {
|
||||
addStream.apply(null, args)
|
||||
}
|
||||
return mergedStream
|
||||
}
|
||||
|
||||
// check and pause streams for pipe.
|
||||
function pauseStreams (streams, options) {
|
||||
if (!Array.isArray(streams)) {
|
||||
// Backwards-compat with old-style streams
|
||||
if (!streams._readableState && streams.pipe) {
|
||||
streams = streams.pipe(PassThrough(options))
|
||||
}
|
||||
if (!streams._readableState || !streams.pause || !streams.pipe) {
|
||||
throw new Error('Only readable stream can be merged.')
|
||||
}
|
||||
streams.pause()
|
||||
} else {
|
||||
for (let i = 0, len = streams.length; i < len; i++) {
|
||||
streams[i] = pauseStreams(streams[i], options)
|
||||
}
|
||||
}
|
||||
return streams
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { h } from 'preact';
|
||||
import Row from '../../row';
|
||||
import { BaseComponent, BaseProps } from '../base';
|
||||
import Header from '../../header';
|
||||
export interface TRProps extends BaseProps {
|
||||
row?: Row;
|
||||
header?: Header;
|
||||
messageRow?: boolean;
|
||||
}
|
||||
export declare class TR extends BaseComponent<TRProps, {}> {
|
||||
private getColumn;
|
||||
private handleClick;
|
||||
private getChildren;
|
||||
render(): h.JSX.Element;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
class OldSelector {
|
||||
constructor(selector, prefix) {
|
||||
this.prefix = prefix
|
||||
this.prefixed = selector.prefixed(this.prefix)
|
||||
this.regexp = selector.regexp(this.prefix)
|
||||
|
||||
this.prefixeds = selector
|
||||
.possible()
|
||||
.map(x => [selector.prefixed(x), selector.regexp(x)])
|
||||
|
||||
this.unprefixed = selector.name
|
||||
this.nameRegexp = selector.regexp()
|
||||
}
|
||||
|
||||
/**
|
||||
* Is rule a hack without unprefixed version bottom
|
||||
*/
|
||||
isHack(rule) {
|
||||
let index = rule.parent.index(rule) + 1
|
||||
let rules = rule.parent.nodes
|
||||
|
||||
while (index < rules.length) {
|
||||
let before = rules[index].selector
|
||||
if (!before) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (before.includes(this.unprefixed) && before.match(this.nameRegexp)) {
|
||||
return false
|
||||
}
|
||||
|
||||
let some = false
|
||||
for (let [string, regexp] of this.prefixeds) {
|
||||
if (before.includes(string) && before.match(regexp)) {
|
||||
some = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!some) {
|
||||
return true
|
||||
}
|
||||
|
||||
index += 1
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Does rule contain an unnecessary prefixed selector
|
||||
*/
|
||||
check(rule) {
|
||||
if (!rule.selector.includes(this.prefixed)) {
|
||||
return false
|
||||
}
|
||||
if (!rule.selector.match(this.regexp)) {
|
||||
return false
|
||||
}
|
||||
if (this.isHack(rule)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = OldSelector
|
||||
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
var toPosInt = require('es5-ext/number/to-pos-integer')
|
||||
|
||||
, create = Object.create, hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
module.exports = function (limit) {
|
||||
var size = 0, base = 1, queue = create(null), map = create(null), index = 0, del;
|
||||
limit = toPosInt(limit);
|
||||
return {
|
||||
hit: function (id) {
|
||||
var oldIndex = map[id], nuIndex = ++index;
|
||||
queue[nuIndex] = id;
|
||||
map[id] = nuIndex;
|
||||
if (!oldIndex) {
|
||||
++size;
|
||||
if (size <= limit) return;
|
||||
id = queue[base];
|
||||
del(id);
|
||||
return id;
|
||||
}
|
||||
delete queue[oldIndex];
|
||||
if (base !== oldIndex) return;
|
||||
while (!hasOwnProperty.call(queue, ++base)) continue; //jslint: skip
|
||||
},
|
||||
delete: del = function (id) {
|
||||
var oldIndex = map[id];
|
||||
if (!oldIndex) return;
|
||||
delete queue[oldIndex];
|
||||
delete map[id];
|
||||
--size;
|
||||
if (base !== oldIndex) return;
|
||||
if (!size) {
|
||||
index = 0;
|
||||
base = 1;
|
||||
return;
|
||||
}
|
||||
while (!hasOwnProperty.call(queue, ++base)) continue; //jslint: skip
|
||||
},
|
||||
clear: function () {
|
||||
size = 0;
|
||||
base = 1;
|
||||
queue = create(null);
|
||||
map = create(null);
|
||||
index = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"range.js","sourceRoot":"","sources":["../../../../src/internal/observable/range.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAqDhC,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,KAAc,EAAE,SAAyB;IAC5E,IAAI,KAAK,IAAI,IAAI,EAAE;QAEjB,KAAK,GAAG,KAAK,CAAC;QACd,KAAK,GAAG,CAAC,CAAC;KACX;IAED,IAAI,KAAK,IAAI,CAAC,EAAE;QAEd,OAAO,KAAK,CAAC;KACd;IAGD,MAAM,GAAG,GAAG,KAAK,GAAG,KAAK,CAAC;IAE1B,OAAO,IAAI,UAAU,CACnB,SAAS;QACP,CAAC;YACC,CAAC,UAAU,EAAE,EAAE;gBACb,IAAI,CAAC,GAAG,KAAK,CAAC;gBACd,OAAO,SAAS,CAAC,QAAQ,CAAC;oBACxB,IAAI,CAAC,GAAG,GAAG,EAAE;wBACX,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;wBACrB,IAAI,CAAC,QAAQ,EAAE,CAAC;qBACjB;yBAAM;wBACL,UAAU,CAAC,QAAQ,EAAE,CAAC;qBACvB;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;YACC,CAAC,UAAU,EAAE,EAAE;gBACb,IAAI,CAAC,GAAG,KAAK,CAAC;gBACd,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;oBACpC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;iBACtB;gBACD,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC,CACN,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"OperatorSubscriber.js","sourceRoot":"","sources":["../../../../src/internal/operators/OperatorSubscriber.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAc3C,MAAM,UAAU,wBAAwB,CACtC,WAA4B,EAC5B,MAA2B,EAC3B,UAAuB,EACvB,OAA4B,EAC5B,UAAuB;IAEvB,OAAO,IAAI,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACtF,CAAC;AAMD;IAA2C,sCAAa;IAiBtD,4BACE,WAA4B,EAC5B,MAA2B,EAC3B,UAAuB,EACvB,OAA4B,EACpB,UAAuB,EACvB,iBAAiC;QAN3C,YAoBE,kBAAM,WAAW,CAAC,SAoCnB;QAnDS,gBAAU,GAAV,UAAU,CAAa;QACvB,uBAAiB,GAAjB,iBAAiB,CAAgB;QAezC,KAAI,CAAC,KAAK,GAAG,MAAM;YACjB,CAAC,CAAC,UAAuC,KAAQ;gBAC7C,IAAI;oBACF,MAAM,CAAC,KAAK,CAAC,CAAC;iBACf;gBAAC,OAAO,GAAG,EAAE;oBACZ,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBACxB;YACH,CAAC;YACH,CAAC,CAAC,iBAAM,KAAK,CAAC;QAChB,KAAI,CAAC,MAAM,GAAG,OAAO;YACnB,CAAC,CAAC,UAAuC,GAAQ;gBAC7C,IAAI;oBACF,OAAO,CAAC,GAAG,CAAC,CAAC;iBACd;gBAAC,OAAO,GAAG,EAAE;oBAEZ,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBACxB;wBAAS;oBAER,IAAI,CAAC,WAAW,EAAE,CAAC;iBACpB;YACH,CAAC;YACH,CAAC,CAAC,iBAAM,MAAM,CAAC;QACjB,KAAI,CAAC,SAAS,GAAG,UAAU;YACzB,CAAC,CAAC;gBACE,IAAI;oBACF,UAAU,EAAE,CAAC;iBACd;gBAAC,OAAO,GAAG,EAAE;oBAEZ,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBACxB;wBAAS;oBAER,IAAI,CAAC,WAAW,EAAE,CAAC;iBACpB;YACH,CAAC;YACH,CAAC,CAAC,iBAAM,SAAS,CAAC;;IACtB,CAAC;IAED,wCAAW,GAAX;;QACE,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE;YAC/C,IAAA,QAAM,GAAK,IAAI,OAAT,CAAU;YACxB,iBAAM,WAAW,WAAE,CAAC;YAEpB,CAAC,QAAM,KAAI,MAAA,IAAI,CAAC,UAAU,+CAAf,IAAI,CAAe,CAAA,CAAC;SAChC;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AAnFD,CAA2C,UAAU,GAmFpD"}
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
'clamp': require('./clamp'),
|
||||
'inRange': require('./inRange'),
|
||||
'random': require('./random')
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').eachOfLimit;
|
||||
@@ -0,0 +1,56 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.registerDefaultHelpers = registerDefaultHelpers;
|
||||
exports.moveHelperToHooks = moveHelperToHooks;
|
||||
// istanbul ignore next
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _helpersBlockHelperMissing = require('./helpers/block-helper-missing');
|
||||
|
||||
var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
|
||||
|
||||
var _helpersEach = require('./helpers/each');
|
||||
|
||||
var _helpersEach2 = _interopRequireDefault(_helpersEach);
|
||||
|
||||
var _helpersHelperMissing = require('./helpers/helper-missing');
|
||||
|
||||
var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
|
||||
|
||||
var _helpersIf = require('./helpers/if');
|
||||
|
||||
var _helpersIf2 = _interopRequireDefault(_helpersIf);
|
||||
|
||||
var _helpersLog = require('./helpers/log');
|
||||
|
||||
var _helpersLog2 = _interopRequireDefault(_helpersLog);
|
||||
|
||||
var _helpersLookup = require('./helpers/lookup');
|
||||
|
||||
var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
|
||||
|
||||
var _helpersWith = require('./helpers/with');
|
||||
|
||||
var _helpersWith2 = _interopRequireDefault(_helpersWith);
|
||||
|
||||
function registerDefaultHelpers(instance) {
|
||||
_helpersBlockHelperMissing2['default'](instance);
|
||||
_helpersEach2['default'](instance);
|
||||
_helpersHelperMissing2['default'](instance);
|
||||
_helpersIf2['default'](instance);
|
||||
_helpersLog2['default'](instance);
|
||||
_helpersLookup2['default'](instance);
|
||||
_helpersWith2['default'](instance);
|
||||
}
|
||||
|
||||
function moveHelperToHooks(instance, helperName, keepHelper) {
|
||||
if (instance.helpers[helperName]) {
|
||||
instance.hooks[helperName] = instance.helpers[helperName];
|
||||
if (!keepHelper) {
|
||||
delete instance.helpers[helperName];
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O3lDQUF1QyxnQ0FBZ0M7Ozs7MkJBQzlDLGdCQUFnQjs7OztvQ0FDUCwwQkFBMEI7Ozs7eUJBQ3JDLGNBQWM7Ozs7MEJBQ2IsZUFBZTs7Ozs2QkFDWixrQkFBa0I7Ozs7MkJBQ3BCLGdCQUFnQjs7OztBQUVsQyxTQUFTLHNCQUFzQixDQUFDLFFBQVEsRUFBRTtBQUMvQyx5Q0FBMkIsUUFBUSxDQUFDLENBQUM7QUFDckMsMkJBQWEsUUFBUSxDQUFDLENBQUM7QUFDdkIsb0NBQXNCLFFBQVEsQ0FBQyxDQUFDO0FBQ2hDLHlCQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQ3JCLDBCQUFZLFFBQVEsQ0FBQyxDQUFDO0FBQ3RCLDZCQUFlLFFBQVEsQ0FBQyxDQUFDO0FBQ3pCLDJCQUFhLFFBQVEsQ0FBQyxDQUFDO0NBQ3hCOztBQUVNLFNBQVMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUU7QUFDbEUsTUFBSSxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO0FBQ2hDLFlBQVEsQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFDLEdBQUcsUUFBUSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztBQUMxRCxRQUFJLENBQUMsVUFBVSxFQUFFO0FBQ2YsYUFBTyxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0tBQ3JDO0dBQ0Y7Q0FDRiIsImZpbGUiOiJoZWxwZXJzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVyQmxvY2tIZWxwZXJNaXNzaW5nIGZyb20gJy4vaGVscGVycy9ibG9jay1oZWxwZXItbWlzc2luZyc7XG5pbXBvcnQgcmVnaXN0ZXJFYWNoIGZyb20gJy4vaGVscGVycy9lYWNoJztcbmltcG9ydCByZWdpc3RlckhlbHBlck1pc3NpbmcgZnJvbSAnLi9oZWxwZXJzL2hlbHBlci1taXNzaW5nJztcbmltcG9ydCByZWdpc3RlcklmIGZyb20gJy4vaGVscGVycy9pZic7XG5pbXBvcnQgcmVnaXN0ZXJMb2cgZnJvbSAnLi9oZWxwZXJzL2xvZyc7XG5pbXBvcnQgcmVnaXN0ZXJMb29rdXAgZnJvbSAnLi9oZWxwZXJzL2xvb2t1cCc7XG5pbXBvcnQgcmVnaXN0ZXJXaXRoIGZyb20gJy4vaGVscGVycy93aXRoJztcblxuZXhwb3J0IGZ1bmN0aW9uIHJlZ2lzdGVyRGVmYXVsdEhlbHBlcnMoaW5zdGFuY2UpIHtcbiAgcmVnaXN0ZXJCbG9ja0hlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlckVhY2goaW5zdGFuY2UpO1xuICByZWdpc3RlckhlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlcklmKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJMb2coaW5zdGFuY2UpO1xuICByZWdpc3Rlckxvb2t1cChpbnN0YW5jZSk7XG4gIHJlZ2lzdGVyV2l0aChpbnN0YW5jZSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtb3ZlSGVscGVyVG9Ib29rcyhpbnN0YW5jZSwgaGVscGVyTmFtZSwga2VlcEhlbHBlcikge1xuICBpZiAoaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXSkge1xuICAgIGluc3RhbmNlLmhvb2tzW2hlbHBlck5hbWVdID0gaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXTtcbiAgICBpZiAoIWtlZXBIZWxwZXIpIHtcbiAgICAgIGRlbGV0ZSBpbnN0YW5jZS5oZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIH1cbiAgfVxufVxuIl19
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fromEvent.js","sourceRoot":"","sources":["../../../../src/internal/observable/fromEvent.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,IAAM,uBAAuB,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAU,CAAC;AAC3E,IAAM,kBAAkB,GAAG,CAAC,kBAAkB,EAAE,qBAAqB,CAAU,CAAC;AAChF,IAAM,aAAa,GAAG,CAAC,IAAI,EAAE,KAAK,CAAU,CAAC;AA8N7C,MAAM,UAAU,SAAS,CACvB,MAAW,EACX,SAAiB,EACjB,OAAwD,EACxD,cAAsC;IAEtC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE;QACvB,cAAc,GAAG,OAAO,CAAC;QACzB,OAAO,GAAG,SAAS,CAAC;KACrB;IACD,IAAI,cAAc,EAAE;QAClB,OAAO,SAAS,CAAI,MAAM,EAAE,SAAS,EAAE,OAA+B,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;KAChH;IASK,IAAA,KAAA,OAEJ,aAAa,CAAC,MAAM,CAAC;QACnB,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAC,UAAU,IAAK,OAAA,UAAC,OAAY,IAAK,OAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAA+B,CAAC,EAAvE,CAAuE,EAAzF,CAAyF,CAAC;QACnI,CAAC;YACD,uBAAuB,CAAC,MAAM,CAAC;gBAC/B,CAAC,CAAC,uBAAuB,CAAC,GAAG,CAAC,uBAAuB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBACzE,CAAC,CAAC,yBAAyB,CAAC,MAAM,CAAC;oBACnC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,uBAAuB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;oBAC/D,CAAC,CAAC,EAAE,IAAA,EATD,GAAG,QAAA,EAAE,MAAM,QASV,CAAC;IAOT,IAAI,CAAC,GAAG,EAAE;QACR,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;YACvB,OAAO,QAAQ,CAAC,UAAC,SAAc,IAAK,OAAA,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,OAA+B,CAAC,EAAhE,CAAgE,CAAC,CACnG,SAAS,CAAC,MAAM,CAAC,CACD,CAAC;SACpB;KACF;IAID,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAC;KAC7C;IAED,OAAO,IAAI,UAAU,CAAI,UAAC,UAAU;QAIlC,IAAM,OAAO,GAAG;YAAC,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAK,OAAA,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAAjD,CAAiD,CAAC;QAEtF,GAAG,CAAC,OAAO,CAAC,CAAC;QAEb,OAAO,cAAM,OAAA,MAAO,CAAC,OAAO,CAAC,EAAhB,CAAgB,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC;AASD,SAAS,uBAAuB,CAAC,MAAW,EAAE,SAAiB;IAC7D,OAAO,UAAC,UAAkB,IAAK,OAAA,UAAC,OAAY,IAAK,OAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,EAAtC,CAAsC,EAAxD,CAAwD,CAAC;AAC1F,CAAC;AAOD,SAAS,uBAAuB,CAAC,MAAW;IAC1C,OAAO,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAC7E,CAAC;AAOD,SAAS,yBAAyB,CAAC,MAAW;IAC5C,OAAO,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAOD,SAAS,aAAa,CAAC,MAAW;IAChC,OAAO,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvF,CAAC"}
|
||||
@@ -0,0 +1,2 @@
|
||||
// These are all the basic types that's compatible with all supported TypeScript versions.
|
||||
export * from './base';
|
||||
@@ -0,0 +1,115 @@
|
||||
declare module 'source-map-js' {
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
}
|
||||
|
||||
export interface RawSourceMap extends StartOfSourceMap {
|
||||
version: string;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface LineRange extends Position {
|
||||
lastColumn: number;
|
||||
}
|
||||
|
||||
export interface FindPosition extends Position {
|
||||
// SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
|
||||
bias?: number;
|
||||
}
|
||||
|
||||
export interface SourceFindPosition extends FindPosition {
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface MappedPosition extends Position {
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface MappingItem {
|
||||
source: string;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class SourceMapConsumer {
|
||||
static GENERATED_ORDER: number;
|
||||
static ORIGINAL_ORDER: number;
|
||||
|
||||
static GREATEST_LOWER_BOUND: number;
|
||||
static LEAST_UPPER_BOUND: number;
|
||||
|
||||
constructor(rawSourceMap: RawSourceMap);
|
||||
computeColumnSpans(): void;
|
||||
originalPositionFor(generatedPosition: FindPosition): MappedPosition;
|
||||
generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
|
||||
hasContentsOfAllSources(): boolean;
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
}
|
||||
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original: Position;
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
|
||||
addMapping(mapping: Mapping): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
|
||||
export class SourceNode {
|
||||
constructor();
|
||||
constructor(line: number, column: number, source: string);
|
||||
constructor(line: number, column: number, source: string, chunk?: string, name?: string);
|
||||
static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
|
||||
add(chunk: string): void;
|
||||
prepend(chunk: string): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
|
||||
walkSourceContents(fn: (file: string, content: string) => void): void;
|
||||
join(sep: string): SourceNode;
|
||||
replaceRight(pattern: string, replacement: string): SourceNode;
|
||||
toString(): string;
|
||||
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-map-generator' {
|
||||
import { SourceMapGenerator } from 'source-map-js'
|
||||
export { SourceMapGenerator }
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-map-consumer' {
|
||||
import { SourceMapConsumer } from 'source-map-js'
|
||||
export { SourceMapConsumer }
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-node' {
|
||||
import { SourceNode } from 'source-map-js'
|
||||
export { SourceNode }
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
var $Map = typeof Map === 'function' && Map.prototype ? Map : null;
|
||||
var $Set = typeof Set === 'function' && Set.prototype ? Set : null;
|
||||
|
||||
var exported;
|
||||
|
||||
if (!$Set) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
exported = function isSet(x) {
|
||||
// `Set` is not present in this environment.
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
var $mapHas = $Map ? Map.prototype.has : null;
|
||||
var $setHas = $Set ? Set.prototype.has : null;
|
||||
if (!exported && !$setHas) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
exported = function isSet(x) {
|
||||
// `Set` does not have a `has` method
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = exported || function isSet(x) {
|
||||
if (!x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$setHas.call(x);
|
||||
if ($mapHas) {
|
||||
try {
|
||||
$mapHas.call(x);
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return x instanceof $Set; // core-js workaround, pre-v2.5.0
|
||||
} catch (e) {}
|
||||
return false;
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const { render, hydrate, unmountComponentAtNode } = require('preact/compat');
|
||||
|
||||
function createRoot(container) {
|
||||
return {
|
||||
render(children) {
|
||||
render(children, container);
|
||||
},
|
||||
unmount() {
|
||||
unmountComponentAtNode(container);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.createRoot = createRoot;
|
||||
|
||||
exports.hydrateRoot = function(container, children) {
|
||||
hydrate(children, container);
|
||||
return createRoot(container);
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SIGRTMAX=exports.getRealtimeSignals=void 0;
|
||||
const getRealtimeSignals=function(){
|
||||
const length=SIGRTMAX-SIGRTMIN+1;
|
||||
return Array.from({length},getRealtimeSignal);
|
||||
};exports.getRealtimeSignals=getRealtimeSignals;
|
||||
|
||||
const getRealtimeSignal=function(value,index){
|
||||
return{
|
||||
name:`SIGRT${index+1}`,
|
||||
number:SIGRTMIN+index,
|
||||
action:"terminate",
|
||||
description:"Application-specific signal (realtime)",
|
||||
standard:"posix"};
|
||||
|
||||
};
|
||||
|
||||
const SIGRTMIN=34;
|
||||
const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX;
|
||||
//# sourceMappingURL=realtime.js.map
|
||||
@@ -0,0 +1,145 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $pow = GetIntrinsic('%Math.pow%');
|
||||
var $RangeError = GetIntrinsic('%RangeError%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $charAt = callBound('String.prototype.charAt');
|
||||
var $reverse = callBound('Array.prototype.reverse');
|
||||
var $slice = callBound('Array.prototype.slice');
|
||||
|
||||
var hasOwnProperty = require('./HasOwnProperty');
|
||||
var IsArray = require('./IsArray');
|
||||
var Type = require('./Type');
|
||||
|
||||
var every = require('../helpers/every');
|
||||
var isByteValue = require('../helpers/isByteValue');
|
||||
|
||||
var keys = require('object-keys');
|
||||
|
||||
// https://262.ecma-international.org/8.0/#table-50
|
||||
var TypeToSizes = {
|
||||
__proto__: null,
|
||||
Int8: 1,
|
||||
Uint8: 1,
|
||||
Uint8C: 1,
|
||||
Int16: 2,
|
||||
Uint16: 2,
|
||||
Int32: 4,
|
||||
Uint32: 4,
|
||||
Float32: 4,
|
||||
Float64: 8
|
||||
};
|
||||
|
||||
// https://262.ecma-international.org/8.0/#sec-rawbytestonumber
|
||||
|
||||
module.exports = function RawBytesToNumber(type, rawBytes, isLittleEndian) {
|
||||
if (typeof type !== 'string' || !hasOwnProperty(TypeToSizes, type)) {
|
||||
throw new $TypeError('Assertion failed: `type` must be a TypedArray element type: ' + keys(TypeToSizes));
|
||||
}
|
||||
if (!IsArray(rawBytes) || !every(rawBytes, isByteValue)) {
|
||||
throw new $TypeError('Assertion failed: `rawBytes` must be an Array of bytes');
|
||||
}
|
||||
if (Type(isLittleEndian) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `isLittleEndian` must be a Boolean');
|
||||
}
|
||||
|
||||
var elementSize = TypeToSizes[type]; // step 1
|
||||
|
||||
if (rawBytes.length !== elementSize) {
|
||||
// this assertion is not in the spec, but it'd be an editorial error if it were ever violated
|
||||
throw new $RangeError('Assertion failed: `rawBytes` must have a length of ' + elementSize + ' for type ' + type);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
rawBytes = $slice(rawBytes, 0, elementSize);
|
||||
if (!isLittleEndian) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
rawBytes = $reverse(rawBytes); // step 2
|
||||
}
|
||||
|
||||
/* eslint no-redeclare: 1 */
|
||||
if (type === 'Float32') { // step 3
|
||||
/*
|
||||
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary32 value.
|
||||
If value is an IEEE 754-2008 binary32 NaN value, return the NaN Number value.
|
||||
Return the Number value that corresponds to value.
|
||||
*/
|
||||
var sign = (rawBytes[3] & 0x80) >> 7; // first bit
|
||||
var exponent = ((rawBytes[3] & 0x7F) << 1) // 7 bits from index 3
|
||||
| ((rawBytes[2] & 0x80) >> 7); // 1 bit from index 2
|
||||
var mantissa = ((rawBytes[2] & 0x7F) << 16) // 7 bits from index 2
|
||||
| (rawBytes[1] << 8) // 8 bits from index 1
|
||||
| rawBytes[0]; // 8 bits from index 0
|
||||
|
||||
if (exponent === 0 && mantissa === 0) {
|
||||
return sign === 0 ? 0 : -0;
|
||||
}
|
||||
if (exponent === 0xFF && mantissa === 0) {
|
||||
return sign === 0 ? Infinity : -Infinity;
|
||||
}
|
||||
if (exponent === 0xFF && mantissa !== 0) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
exponent -= 127; // subtract the bias
|
||||
|
||||
// return $pow(-1, sign) * mantissa / $pow(2, 23) * $pow(2, exponent);
|
||||
// return $pow(-1, sign) * (mantissa + 0x1000000) * $pow(2, exponent - 23);
|
||||
return $pow(-1, sign) * (1 + (mantissa / $pow(2, 23))) * $pow(2, exponent);
|
||||
}
|
||||
|
||||
if (type === 'Float64') { // step 4
|
||||
/*
|
||||
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary64 value.
|
||||
If value is an IEEE 754-2008 binary64 NaN value, return the NaN Number value.
|
||||
Return the Number value that corresponds to value.
|
||||
*/
|
||||
var sign = rawBytes[7] & 0x80 ? -1 : 1; // first bit
|
||||
var exponent = ((rawBytes[7] & 0x7F) << 4) // 7 bits from index 7
|
||||
| ((rawBytes[6] & 0xF0) >> 4); // 4 bits from index 6
|
||||
var mantissa = ((rawBytes[6] & 0x0F) * 0x1000000000000) // 4 bits from index 6
|
||||
+ (rawBytes[5] * 0x10000000000) // 8 bits from index 5
|
||||
+ (rawBytes[4] * 0x100000000) // 8 bits from index 4
|
||||
+ (rawBytes[3] * 0x1000000) // 8 bits from index 3
|
||||
+ (rawBytes[2] * 0x10000) // 8 bits from index 2
|
||||
+ (rawBytes[1] * 0x100) // 8 bits from index 1
|
||||
+ rawBytes[0]; // 8 bits from index 0
|
||||
|
||||
if (exponent === 0 && mantissa === 0) {
|
||||
return sign * 0;
|
||||
}
|
||||
if (exponent === 0x7FF && mantissa !== 0) {
|
||||
return NaN;
|
||||
}
|
||||
if (exponent === 0x7FF && mantissa === 0) {
|
||||
return sign * Infinity;
|
||||
}
|
||||
|
||||
exponent -= 1023; // subtract the bias
|
||||
|
||||
return sign * (mantissa + 0x10000000000000) * $pow(2, exponent - 52);
|
||||
}
|
||||
|
||||
// this is common to both branches
|
||||
var intValue = 0;
|
||||
for (var i = 0; i < rawBytes.length; i++) {
|
||||
intValue |= rawBytes[i] << (8 * i);
|
||||
}
|
||||
/*
|
||||
Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number.
|
||||
*/
|
||||
|
||||
if ($charAt(type, 0) !== 'U') { // steps 5-6
|
||||
// Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of a binary little-endian 2's complement number of bit length elementSize × 8.
|
||||
var bitLength = elementSize * 8;
|
||||
if (bitLength < 32) {
|
||||
intValue = (intValue << (32 - bitLength)) >> (32 - bitLength);
|
||||
}
|
||||
}
|
||||
|
||||
return intValue; // step 7
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var toPosInt = require("es5-ext/number/to-pos-integer");
|
||||
|
||||
module.exports = function (optsLength, fnLength, isAsync) {
|
||||
var length;
|
||||
if (isNaN(optsLength)) {
|
||||
length = fnLength;
|
||||
if (!(length >= 0)) return 1;
|
||||
if (isAsync && length) return length - 1;
|
||||
return length;
|
||||
}
|
||||
if (optsLength === false) return false;
|
||||
return toPosInt(optsLength);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timeoutWith.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/timeoutWith.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG5E;uFACuF;AACvF,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACpI;kFACkF;AAClF,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1,37 @@
|
||||
var baseUnset = require('./_baseUnset'),
|
||||
isIndex = require('./_isIndex');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pullAt` without support for individual
|
||||
* indexes or capturing the removed elements.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {number[]} indexes The indexes of elements to remove.
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function basePullAt(array, indexes) {
|
||||
var length = array ? indexes.length : 0,
|
||||
lastIndex = length - 1;
|
||||
|
||||
while (length--) {
|
||||
var index = indexes[length];
|
||||
if (length == lastIndex || index !== previous) {
|
||||
var previous = index;
|
||||
if (isIndex(index)) {
|
||||
splice.call(array, index, 1);
|
||||
} else {
|
||||
baseUnset(array, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
module.exports = basePullAt;
|
||||
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isBIC;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var _isISO31661Alpha = require("./isISO31661Alpha2");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// https://en.wikipedia.org/wiki/ISO_9362
|
||||
var isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;
|
||||
|
||||
function isBIC(str) {
|
||||
(0, _assertString.default)(str); // toUpperCase() should be removed when a new major version goes out that changes
|
||||
// the regex to [A-Z] (per the spec).
|
||||
|
||||
var countryCode = str.slice(4, 6).toUpperCase();
|
||||
|
||||
if (!_isISO31661Alpha.CountryCodes.has(countryCode) && countryCode !== 'XK') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isBICReg.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,173 @@
|
||||
import * as util from './readline.js';
|
||||
import cliWidth from 'cli-width';
|
||||
import wrapAnsi from 'wrap-ansi';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import stringWidth from 'string-width';
|
||||
import ora from 'ora';
|
||||
|
||||
function height(content) {
|
||||
return content.split('\n').length;
|
||||
}
|
||||
|
||||
/** @param {string} content */
|
||||
function lastLine(content) {
|
||||
return content.split('\n').pop();
|
||||
}
|
||||
|
||||
export default class ScreenManager {
|
||||
constructor(rl) {
|
||||
// These variables are keeping information to allow correct prompt re-rendering
|
||||
this.height = 0;
|
||||
this.extraLinesUnderPrompt = 0;
|
||||
|
||||
this.rl = rl;
|
||||
}
|
||||
|
||||
renderWithSpinner(content, bottomContent) {
|
||||
if (this.spinnerId) {
|
||||
clearInterval(this.spinnerId);
|
||||
}
|
||||
|
||||
let spinner;
|
||||
let contentFunc;
|
||||
let bottomContentFunc;
|
||||
|
||||
if (bottomContent) {
|
||||
spinner = ora(bottomContent);
|
||||
contentFunc = () => content;
|
||||
bottomContentFunc = () => spinner.frame();
|
||||
} else {
|
||||
spinner = ora(content);
|
||||
contentFunc = () => spinner.frame();
|
||||
bottomContentFunc = () => '';
|
||||
}
|
||||
|
||||
this.spinnerId = setInterval(
|
||||
() => this.render(contentFunc(), bottomContentFunc(), true),
|
||||
spinner.interval
|
||||
);
|
||||
}
|
||||
|
||||
render(content, bottomContent, spinning = false) {
|
||||
if (this.spinnerId && !spinning) {
|
||||
clearInterval(this.spinnerId);
|
||||
}
|
||||
|
||||
this.rl.output.unmute();
|
||||
this.clean(this.extraLinesUnderPrompt);
|
||||
|
||||
/**
|
||||
* Write message to screen and setPrompt to control backspace
|
||||
*/
|
||||
|
||||
const promptLine = lastLine(content);
|
||||
const rawPromptLine = stripAnsi(promptLine);
|
||||
|
||||
// Remove the rl.line from our prompt. We can't rely on the content of
|
||||
// rl.line (mainly because of the password prompt), so just rely on it's
|
||||
// length.
|
||||
let prompt = rawPromptLine;
|
||||
if (this.rl.line.length) {
|
||||
prompt = prompt.slice(0, -this.rl.line.length);
|
||||
}
|
||||
|
||||
this.rl.setPrompt(prompt);
|
||||
|
||||
// SetPrompt will change cursor position, now we can get correct value
|
||||
const cursorPos = this.rl._getCursorPos();
|
||||
const width = this.normalizedCliWidth();
|
||||
|
||||
content = this.forceLineReturn(content, width);
|
||||
if (bottomContent) {
|
||||
bottomContent = this.forceLineReturn(bottomContent, width);
|
||||
}
|
||||
|
||||
// Manually insert an extra line if we're at the end of the line.
|
||||
// This prevent the cursor from appearing at the beginning of the
|
||||
// current line.
|
||||
if (rawPromptLine.length % width === 0) {
|
||||
content += '\n';
|
||||
}
|
||||
|
||||
const fullContent = content + (bottomContent ? '\n' + bottomContent : '');
|
||||
this.rl.output.write(fullContent);
|
||||
|
||||
/**
|
||||
* Re-adjust the cursor at the correct position.
|
||||
*/
|
||||
|
||||
// We need to consider parts of the prompt under the cursor as part of the bottom
|
||||
// content in order to correctly cleanup and re-render.
|
||||
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows;
|
||||
const bottomContentHeight =
|
||||
promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
|
||||
if (bottomContentHeight > 0) {
|
||||
util.up(this.rl, bottomContentHeight);
|
||||
}
|
||||
|
||||
// Reset cursor at the beginning of the line
|
||||
util.left(this.rl, stringWidth(lastLine(fullContent)));
|
||||
|
||||
// Adjust cursor on the right
|
||||
if (cursorPos.cols > 0) {
|
||||
util.right(this.rl, cursorPos.cols);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up state for next re-rendering
|
||||
*/
|
||||
this.extraLinesUnderPrompt = bottomContentHeight;
|
||||
this.height = height(fullContent);
|
||||
|
||||
this.rl.output.mute();
|
||||
}
|
||||
|
||||
clean(extraLines) {
|
||||
if (extraLines > 0) {
|
||||
util.down(this.rl, extraLines);
|
||||
}
|
||||
|
||||
util.clearLine(this.rl, this.height);
|
||||
}
|
||||
|
||||
done() {
|
||||
this.rl.setPrompt('');
|
||||
this.rl.output.unmute();
|
||||
this.rl.output.write('\n');
|
||||
}
|
||||
|
||||
releaseCursor() {
|
||||
if (this.extraLinesUnderPrompt > 0) {
|
||||
util.down(this.rl, this.extraLinesUnderPrompt);
|
||||
}
|
||||
}
|
||||
|
||||
normalizedCliWidth() {
|
||||
const width = cliWidth({
|
||||
defaultWidth: 80,
|
||||
output: this.rl.output,
|
||||
});
|
||||
return width;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string[]} lines
|
||||
*/
|
||||
breakLines(lines, width = this.normalizedCliWidth()) {
|
||||
// Break lines who're longer than the cli width so we can normalize the natural line
|
||||
// returns behavior across terminals.
|
||||
// re: trim: false; by default, `wrap-ansi` trims whitespace, which
|
||||
// is not what we want.
|
||||
// re: hard: true; by default', `wrap-ansi` does soft wrapping
|
||||
return lines.map((line) =>
|
||||
wrapAnsi(line, width, { trim: false, hard: true }).split('\n')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} content
|
||||
*/
|
||||
forceLineReturn(content, width = this.normalizedCliWidth()) {
|
||||
return this.breakLines(content.split('\n'), width).flat().join('\n');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/core/defaultParsers/parser_jsonarray.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../../../index.html">All files</a> / <a href="index.html">csv2json/libs/core/defaultParsers</a> parser_jsonarray.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/13</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/4</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/13</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span></td><td class="text"><pre class="prettyprint lang-js">Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/defaultParsers/parser_jsonarray.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/defaultParsers/parser_jsonarray.js')
|
||||
Error: Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/defaultParsers/parser_jsonarray.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/defaultParsers/parser_jsonarray.js')
|
||||
at Context.defaultSourceLookup [as sourceFinder] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:15:15)
|
||||
at Context.getSource (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:74:17)
|
||||
at Object.annotateSourceCode (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:172:38)
|
||||
at HtmlReport.onDetail (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/index.js:237:39)
|
||||
at Visitor.(anonymous function) [as onDetail] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:34:30)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:123:17)
|
||||
at /Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:116:23
|
||||
at Array.forEach (native)
|
||||
at visitChildren (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:115:32)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:126:5)</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../../../sorter.js"></script>
|
||||
<script src="../../../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('pull', require('../pull'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
Reference in New Issue
Block a user