new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('stubArray', require('../stubArray'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"CC","8":"J","132":"D E"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC","2":"DC tB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"I v J D E F A B C K L G zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"HC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB","2":"F"},G:{"1":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"1":"oC"},I:{"1":"tB I f pC qC rC sC BC tC uC"},J:{"1":"D A"},K:{"1":"A B C h qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:2,C:"CSS3 selectors"};
|
||||
@@ -0,0 +1 @@
|
||||
export const VERSION = "6.0.0";
|
||||
@@ -0,0 +1,538 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var relative = require('path').relative
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Get the path to base files on.
|
||||
*/
|
||||
|
||||
var basePath = process.cwd()
|
||||
|
||||
/**
|
||||
* Determine if namespace is contained in the string.
|
||||
*/
|
||||
|
||||
function containsNamespace (str, namespace) {
|
||||
var vals = str.split(/[ ,]+/)
|
||||
var ns = String(namespace).toLowerCase()
|
||||
|
||||
for (var i = 0; i < vals.length; i++) {
|
||||
var val = vals[i]
|
||||
|
||||
// namespace contained
|
||||
if (val && (val === '*' || val.toLowerCase() === ns)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a data descriptor to accessor descriptor.
|
||||
*/
|
||||
|
||||
function convertDataDescriptorToAccessor (obj, prop, message) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
var value = descriptor.value
|
||||
|
||||
descriptor.get = function getter () { return value }
|
||||
|
||||
if (descriptor.writable) {
|
||||
descriptor.set = function setter (val) { return (value = val) }
|
||||
}
|
||||
|
||||
delete descriptor.value
|
||||
delete descriptor.writable
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
|
||||
return descriptor
|
||||
}
|
||||
|
||||
/**
|
||||
* Create arguments string to keep arity.
|
||||
*/
|
||||
|
||||
function createArgumentsString (arity) {
|
||||
var str = ''
|
||||
|
||||
for (var i = 0; i < arity; i++) {
|
||||
str += ', arg' + i
|
||||
}
|
||||
|
||||
return str.substr(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stack string from stack.
|
||||
*/
|
||||
|
||||
function createStackString (stack) {
|
||||
var str = this.name + ': ' + this.namespace
|
||||
|
||||
if (this.message) {
|
||||
str += ' deprecated ' + this.message
|
||||
}
|
||||
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
str += '\n at ' + stack[i].toString()
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
var file = site[0]
|
||||
|
||||
function deprecate (message) {
|
||||
// call to self as log
|
||||
log.call(deprecate, message)
|
||||
}
|
||||
|
||||
deprecate._file = file
|
||||
deprecate._ignored = isignored(namespace)
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = istraced(namespace)
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if event emitter has listeners of a given type.
|
||||
*
|
||||
* The way to do this check is done three different ways in Node.js >= 0.8
|
||||
* so this consolidates them into a minimal set using instance methods.
|
||||
*
|
||||
* @param {EventEmitter} emitter
|
||||
* @param {string} type
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function eehaslisteners (emitter, type) {
|
||||
var count = typeof emitter.listenerCount !== 'function'
|
||||
? emitter.listeners(type).length
|
||||
: emitter.listenerCount(type)
|
||||
|
||||
return count > 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is ignored.
|
||||
*/
|
||||
|
||||
function isignored (namespace) {
|
||||
if (process.noDeprecation) {
|
||||
// --no-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.NO_DEPRECATION || ''
|
||||
|
||||
// namespace ignored
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is traced.
|
||||
*/
|
||||
|
||||
function istraced (namespace) {
|
||||
if (process.traceDeprecation) {
|
||||
// --trace-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.TRACE_DEPRECATION || ''
|
||||
|
||||
// namespace traced
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Display deprecation message.
|
||||
*/
|
||||
|
||||
function log (message, site) {
|
||||
var haslisteners = eehaslisteners(process, 'deprecation')
|
||||
|
||||
// abort early if no destination
|
||||
if (!haslisteners && this._ignored) {
|
||||
return
|
||||
}
|
||||
|
||||
var caller
|
||||
var callFile
|
||||
var callSite
|
||||
var depSite
|
||||
var i = 0
|
||||
var seen = false
|
||||
var stack = getStack()
|
||||
var file = this._file
|
||||
|
||||
if (site) {
|
||||
// provided site
|
||||
depSite = site
|
||||
callSite = callSiteLocation(stack[1])
|
||||
callSite.name = depSite.name
|
||||
file = callSite[0]
|
||||
} else {
|
||||
// get call site
|
||||
i = 2
|
||||
depSite = callSiteLocation(stack[i])
|
||||
callSite = depSite
|
||||
}
|
||||
|
||||
// get caller of deprecated thing in relation to file
|
||||
for (; i < stack.length; i++) {
|
||||
caller = callSiteLocation(stack[i])
|
||||
callFile = caller[0]
|
||||
|
||||
if (callFile === file) {
|
||||
seen = true
|
||||
} else if (callFile === this._file) {
|
||||
file = this._file
|
||||
} else if (seen) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var key = caller
|
||||
? depSite.join(':') + '__' + caller.join(':')
|
||||
: undefined
|
||||
|
||||
if (key !== undefined && key in this._warned) {
|
||||
// already warned
|
||||
return
|
||||
}
|
||||
|
||||
this._warned[key] = true
|
||||
|
||||
// generate automatic message from call site
|
||||
var msg = message
|
||||
if (!msg) {
|
||||
msg = callSite === depSite || !callSite.name
|
||||
? defaultMessage(depSite)
|
||||
: defaultMessage(callSite)
|
||||
}
|
||||
|
||||
// emit deprecation if listeners exist
|
||||
if (haslisteners) {
|
||||
var err = DeprecationError(this._namespace, msg, stack.slice(i))
|
||||
process.emit('deprecation', err)
|
||||
return
|
||||
}
|
||||
|
||||
// format and write message
|
||||
var format = process.stderr.isTTY
|
||||
? formatColor
|
||||
: formatPlain
|
||||
var output = format.call(this, msg, caller, stack.slice(i))
|
||||
process.stderr.write(output + '\n', 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get call site location as array.
|
||||
*/
|
||||
|
||||
function callSiteLocation (callSite) {
|
||||
var file = callSite.getFileName() || '<anonymous>'
|
||||
var line = callSite.getLineNumber()
|
||||
var colm = callSite.getColumnNumber()
|
||||
|
||||
if (callSite.isEval()) {
|
||||
file = callSite.getEvalOrigin() + ', ' + file
|
||||
}
|
||||
|
||||
var site = [file, line, colm]
|
||||
|
||||
site.callSite = callSite
|
||||
site.name = callSite.getFunctionName()
|
||||
|
||||
return site
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a default message from the site.
|
||||
*/
|
||||
|
||||
function defaultMessage (site) {
|
||||
var callSite = site.callSite
|
||||
var funcName = site.name
|
||||
|
||||
// make useful anonymous name
|
||||
if (!funcName) {
|
||||
funcName = '<anonymous@' + formatLocation(site) + '>'
|
||||
}
|
||||
|
||||
var context = callSite.getThis()
|
||||
var typeName = context && callSite.getTypeName()
|
||||
|
||||
// ignore useless type name
|
||||
if (typeName === 'Object') {
|
||||
typeName = undefined
|
||||
}
|
||||
|
||||
// make useful type name
|
||||
if (typeName === 'Function') {
|
||||
typeName = context.name || typeName
|
||||
}
|
||||
|
||||
return typeName && callSite.getMethodName()
|
||||
? typeName + '.' + funcName
|
||||
: funcName
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message without color.
|
||||
*/
|
||||
|
||||
function formatPlain (msg, caller, stack) {
|
||||
var timestamp = new Date().toUTCString()
|
||||
|
||||
var formatted = timestamp +
|
||||
' ' + this._namespace +
|
||||
' deprecated ' + msg
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n at ' + stack[i].toString()
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' at ' + formatLocation(caller)
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message with color.
|
||||
*/
|
||||
|
||||
function formatColor (msg, caller, stack) {
|
||||
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
|
||||
' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
|
||||
' \x1b[0m' + msg + '\x1b[39m' // reset
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format call site location.
|
||||
*/
|
||||
|
||||
function formatLocation (callSite) {
|
||||
return relative(basePath, callSite[0]) +
|
||||
':' + callSite[1] +
|
||||
':' + callSite[2]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stack as array of call sites.
|
||||
*/
|
||||
|
||||
function getStack () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = Math.max(10, limit)
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice this function off the top
|
||||
var stack = obj.stack.slice(1)
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture call site stack from v8.
|
||||
*/
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
var args = createArgumentsString(fn.length)
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
site.name = fn.name
|
||||
|
||||
// eslint-disable-next-line no-new-func
|
||||
var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',
|
||||
'"use strict"\n' +
|
||||
'return function (' + args + ') {' +
|
||||
'log.call(deprecate, message, site)\n' +
|
||||
'return fn.apply(this, arguments)\n' +
|
||||
'}')(fn, log, this, message, site)
|
||||
|
||||
return deprecatedfn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
|
||||
var deprecate = this
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
// set site name
|
||||
site.name = prop
|
||||
|
||||
// convert data descriptor
|
||||
if ('value' in descriptor) {
|
||||
descriptor = convertDataDescriptorToAccessor(obj, prop, message)
|
||||
}
|
||||
|
||||
var get = descriptor.get
|
||||
var set = descriptor.set
|
||||
|
||||
// wrap getter
|
||||
if (typeof get === 'function') {
|
||||
descriptor.get = function getter () {
|
||||
log.call(deprecate, message, site)
|
||||
return get.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
// wrap setter
|
||||
if (typeof set === 'function') {
|
||||
descriptor.set = function setter () {
|
||||
log.call(deprecate, message, site)
|
||||
return set.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DeprecationError for deprecation
|
||||
*/
|
||||
|
||||
function DeprecationError (namespace, message, stack) {
|
||||
var error = new Error()
|
||||
var stackString
|
||||
|
||||
Object.defineProperty(error, 'constructor', {
|
||||
value: DeprecationError
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'message', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: message,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: 'DeprecationError',
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'namespace', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: namespace,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'stack', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
if (stackString !== undefined) {
|
||||
return stackString
|
||||
}
|
||||
|
||||
// prepare stack trace
|
||||
return (stackString = createStackString.call(this, stack))
|
||||
},
|
||||
set: function setter (val) {
|
||||
stackString = val
|
||||
}
|
||||
})
|
||||
|
||||
return error
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
# statuses
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][ci-image]][ci-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
HTTP status utility for node.
|
||||
|
||||
This module provides a list of status codes and messages sourced from
|
||||
a few different projects:
|
||||
|
||||
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
||||
* The [Node.js project](https://nodejs.org/)
|
||||
* The [NGINX project](https://www.nginx.com/)
|
||||
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install statuses
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var status = require('statuses')
|
||||
```
|
||||
|
||||
### status(code)
|
||||
|
||||
Returns the status message string for a known HTTP status code. The code
|
||||
may be a number or a string. An error is thrown for an unknown status code.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
status(403) // => 'Forbidden'
|
||||
status('403') // => 'Forbidden'
|
||||
status(306) // throws
|
||||
```
|
||||
|
||||
### status(msg)
|
||||
|
||||
Returns the numeric status code for a known HTTP status message. The message
|
||||
is case-insensitive. An error is thrown for an unknown status message.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
status('forbidden') // => 403
|
||||
status('Forbidden') // => 403
|
||||
status('foo') // throws
|
||||
```
|
||||
|
||||
### status.codes
|
||||
|
||||
Returns an array of all the status codes as `Integer`s.
|
||||
|
||||
### status.code[msg]
|
||||
|
||||
Returns the numeric status code for a known status message (in lower-case),
|
||||
otherwise `undefined`.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status['not found'] // => 404
|
||||
```
|
||||
|
||||
### status.empty[code]
|
||||
|
||||
Returns `true` if a status code expects an empty body.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.empty[200] // => undefined
|
||||
status.empty[204] // => true
|
||||
status.empty[304] // => true
|
||||
```
|
||||
|
||||
### status.message[code]
|
||||
|
||||
Returns the string message for a known numeric status code, otherwise
|
||||
`undefined`. This object is the same format as the
|
||||
[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.message[404] // => 'Not Found'
|
||||
```
|
||||
|
||||
### status.redirect[code]
|
||||
|
||||
Returns `true` if a status code is a valid redirect status.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.redirect[200] // => undefined
|
||||
status.redirect[301] // => true
|
||||
```
|
||||
|
||||
### status.retry[code]
|
||||
|
||||
Returns `true` if you should retry the rest.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.retry[501] // => undefined
|
||||
status.retry[503] // => true
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci
|
||||
[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
||||
[node-version-image]: https://badgen.net/npm/node/statuses
|
||||
[node-version-url]: https://nodejs.org/en/download
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/statuses
|
||||
[npm-url]: https://npmjs.org/package/statuses
|
||||
[npm-version-image]: https://badgen.net/npm/v/statuses
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.not = void 0;
|
||||
function not(pred, thisArg) {
|
||||
return function (value, index) { return !pred.call(thisArg, value, index); };
|
||||
}
|
||||
exports.not = not;
|
||||
//# sourceMappingURL=not.js.map
|
||||
@@ -0,0 +1,499 @@
|
||||
import { o as YAMLReferenceError, T as Type, g as YAMLSemanticError, _ as _createForOfIteratorHelper, e as _defineProperty, j as _inherits, k as _createSuper, c as _classCallCheck, p as _assertThisInitialized, b as _createClass, a as _typeof, l as _get, m as _getPrototypeOf } from './PlainValue-b8036b75.js';
|
||||
import { j as resolveString, b as binaryOptions, c as stringifyString, h as resolveSeq, P as Pair, d as YAMLMap, Y as YAMLSeq, t as toJSON, S as Scalar, l as findPair, g as resolveMap, k as stringifyNumber } from './resolveSeq-492ab440.js';
|
||||
|
||||
/* global atob, btoa, Buffer */
|
||||
var binary = {
|
||||
identify: function identify(value) {
|
||||
return value instanceof Uint8Array;
|
||||
},
|
||||
// Buffer inherits from Uint8Array
|
||||
default: false,
|
||||
tag: 'tag:yaml.org,2002:binary',
|
||||
|
||||
/**
|
||||
* Returns a Buffer in node and an Uint8Array in browsers
|
||||
*
|
||||
* To use the resulting buffer as an image, you'll want to do something like:
|
||||
*
|
||||
* const blob = new Blob([buffer], { type: 'image/jpeg' })
|
||||
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
||||
*/
|
||||
resolve: function resolve(doc, node) {
|
||||
var src = resolveString(doc, node);
|
||||
|
||||
if (typeof Buffer === 'function') {
|
||||
return Buffer.from(src, 'base64');
|
||||
} else if (typeof atob === 'function') {
|
||||
// On IE 11, atob() can't handle newlines
|
||||
var str = atob(src.replace(/[\n\r]/g, ''));
|
||||
var buffer = new Uint8Array(str.length);
|
||||
|
||||
for (var i = 0; i < str.length; ++i) {
|
||||
buffer[i] = str.charCodeAt(i);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
} else {
|
||||
var msg = 'This environment does not support reading binary tags; either Buffer or atob is required';
|
||||
doc.errors.push(new YAMLReferenceError(node, msg));
|
||||
return null;
|
||||
}
|
||||
},
|
||||
options: binaryOptions,
|
||||
stringify: function stringify(_ref, ctx, onComment, onChompKeep) {
|
||||
var comment = _ref.comment,
|
||||
type = _ref.type,
|
||||
value = _ref.value;
|
||||
var src;
|
||||
|
||||
if (typeof Buffer === 'function') {
|
||||
src = value instanceof Buffer ? value.toString('base64') : Buffer.from(value.buffer).toString('base64');
|
||||
} else if (typeof btoa === 'function') {
|
||||
var s = '';
|
||||
|
||||
for (var i = 0; i < value.length; ++i) {
|
||||
s += String.fromCharCode(value[i]);
|
||||
}
|
||||
|
||||
src = btoa(s);
|
||||
} else {
|
||||
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
||||
}
|
||||
|
||||
if (!type) type = binaryOptions.defaultType;
|
||||
|
||||
if (type === Type.QUOTE_DOUBLE) {
|
||||
value = src;
|
||||
} else {
|
||||
var lineWidth = binaryOptions.lineWidth;
|
||||
var n = Math.ceil(src.length / lineWidth);
|
||||
var lines = new Array(n);
|
||||
|
||||
for (var _i = 0, o = 0; _i < n; ++_i, o += lineWidth) {
|
||||
lines[_i] = src.substr(o, lineWidth);
|
||||
}
|
||||
|
||||
value = lines.join(type === Type.BLOCK_LITERAL ? '\n' : ' ');
|
||||
}
|
||||
|
||||
return stringifyString({
|
||||
comment: comment,
|
||||
type: type,
|
||||
value: value
|
||||
}, ctx, onComment, onChompKeep);
|
||||
}
|
||||
};
|
||||
|
||||
function parsePairs(doc, cst) {
|
||||
var seq = resolveSeq(doc, cst);
|
||||
|
||||
for (var i = 0; i < seq.items.length; ++i) {
|
||||
var item = seq.items[i];
|
||||
if (item instanceof Pair) continue;else if (item instanceof YAMLMap) {
|
||||
if (item.items.length > 1) {
|
||||
var msg = 'Each pair must have its own sequence indicator';
|
||||
throw new YAMLSemanticError(cst, msg);
|
||||
}
|
||||
|
||||
var pair = item.items[0] || new Pair();
|
||||
if (item.commentBefore) pair.commentBefore = pair.commentBefore ? "".concat(item.commentBefore, "\n").concat(pair.commentBefore) : item.commentBefore;
|
||||
if (item.comment) pair.comment = pair.comment ? "".concat(item.comment, "\n").concat(pair.comment) : item.comment;
|
||||
item = pair;
|
||||
}
|
||||
seq.items[i] = item instanceof Pair ? item : new Pair(item);
|
||||
}
|
||||
|
||||
return seq;
|
||||
}
|
||||
function createPairs(schema, iterable, ctx) {
|
||||
var pairs = new YAMLSeq(schema);
|
||||
pairs.tag = 'tag:yaml.org,2002:pairs';
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(iterable),
|
||||
_step;
|
||||
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var it = _step.value;
|
||||
var key = void 0,
|
||||
value = void 0;
|
||||
|
||||
if (Array.isArray(it)) {
|
||||
if (it.length === 2) {
|
||||
key = it[0];
|
||||
value = it[1];
|
||||
} else throw new TypeError("Expected [key, value] tuple: ".concat(it));
|
||||
} else if (it && it instanceof Object) {
|
||||
var keys = Object.keys(it);
|
||||
|
||||
if (keys.length === 1) {
|
||||
key = keys[0];
|
||||
value = it[key];
|
||||
} else throw new TypeError("Expected { key: value } tuple: ".concat(it));
|
||||
} else {
|
||||
key = it;
|
||||
}
|
||||
|
||||
var pair = schema.createPair(key, value, ctx);
|
||||
pairs.items.push(pair);
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return pairs;
|
||||
}
|
||||
var pairs = {
|
||||
default: false,
|
||||
tag: 'tag:yaml.org,2002:pairs',
|
||||
resolve: parsePairs,
|
||||
createNode: createPairs
|
||||
};
|
||||
|
||||
var YAMLOMap = /*#__PURE__*/function (_YAMLSeq) {
|
||||
_inherits(YAMLOMap, _YAMLSeq);
|
||||
|
||||
var _super = _createSuper(YAMLOMap);
|
||||
|
||||
function YAMLOMap() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, YAMLOMap);
|
||||
|
||||
_this = _super.call(this);
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "add", YAMLMap.prototype.add.bind(_assertThisInitialized(_this)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "delete", YAMLMap.prototype.delete.bind(_assertThisInitialized(_this)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "get", YAMLMap.prototype.get.bind(_assertThisInitialized(_this)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "has", YAMLMap.prototype.has.bind(_assertThisInitialized(_this)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "set", YAMLMap.prototype.set.bind(_assertThisInitialized(_this)));
|
||||
|
||||
_this.tag = YAMLOMap.tag;
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(YAMLOMap, [{
|
||||
key: "toJSON",
|
||||
value: function toJSON$1(_, ctx) {
|
||||
var map = new Map();
|
||||
if (ctx && ctx.onCreate) ctx.onCreate(map);
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(this.items),
|
||||
_step;
|
||||
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var pair = _step.value;
|
||||
var key = void 0,
|
||||
value = void 0;
|
||||
|
||||
if (pair instanceof Pair) {
|
||||
key = toJSON(pair.key, '', ctx);
|
||||
value = toJSON(pair.value, key, ctx);
|
||||
} else {
|
||||
key = toJSON(pair, '', ctx);
|
||||
}
|
||||
|
||||
if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');
|
||||
map.set(key, value);
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}]);
|
||||
|
||||
return YAMLOMap;
|
||||
}(YAMLSeq);
|
||||
|
||||
_defineProperty(YAMLOMap, "tag", 'tag:yaml.org,2002:omap');
|
||||
|
||||
function parseOMap(doc, cst) {
|
||||
var pairs = parsePairs(doc, cst);
|
||||
var seenKeys = [];
|
||||
|
||||
var _iterator2 = _createForOfIteratorHelper(pairs.items),
|
||||
_step2;
|
||||
|
||||
try {
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
var key = _step2.value.key;
|
||||
|
||||
if (key instanceof Scalar) {
|
||||
if (seenKeys.includes(key.value)) {
|
||||
var msg = 'Ordered maps must not include duplicate keys';
|
||||
throw new YAMLSemanticError(cst, msg);
|
||||
} else {
|
||||
seenKeys.push(key.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
|
||||
return Object.assign(new YAMLOMap(), pairs);
|
||||
}
|
||||
|
||||
function createOMap(schema, iterable, ctx) {
|
||||
var pairs = createPairs(schema, iterable, ctx);
|
||||
var omap = new YAMLOMap();
|
||||
omap.items = pairs.items;
|
||||
return omap;
|
||||
}
|
||||
|
||||
var omap = {
|
||||
identify: function identify(value) {
|
||||
return value instanceof Map;
|
||||
},
|
||||
nodeClass: YAMLOMap,
|
||||
default: false,
|
||||
tag: 'tag:yaml.org,2002:omap',
|
||||
resolve: parseOMap,
|
||||
createNode: createOMap
|
||||
};
|
||||
|
||||
var YAMLSet = /*#__PURE__*/function (_YAMLMap) {
|
||||
_inherits(YAMLSet, _YAMLMap);
|
||||
|
||||
var _super = _createSuper(YAMLSet);
|
||||
|
||||
function YAMLSet() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, YAMLSet);
|
||||
|
||||
_this = _super.call(this);
|
||||
_this.tag = YAMLSet.tag;
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(YAMLSet, [{
|
||||
key: "add",
|
||||
value: function add(key) {
|
||||
var pair = key instanceof Pair ? key : new Pair(key);
|
||||
var prev = findPair(this.items, pair.key);
|
||||
if (!prev) this.items.push(pair);
|
||||
}
|
||||
}, {
|
||||
key: "get",
|
||||
value: function get(key, keepPair) {
|
||||
var pair = findPair(this.items, key);
|
||||
return !keepPair && pair instanceof Pair ? pair.key instanceof Scalar ? pair.key.value : pair.key : pair;
|
||||
}
|
||||
}, {
|
||||
key: "set",
|
||||
value: function set(key, value) {
|
||||
if (typeof value !== 'boolean') throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(_typeof(value)));
|
||||
var prev = findPair(this.items, key);
|
||||
|
||||
if (prev && !value) {
|
||||
this.items.splice(this.items.indexOf(prev), 1);
|
||||
} else if (!prev && value) {
|
||||
this.items.push(new Pair(key));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "toJSON",
|
||||
value: function toJSON(_, ctx) {
|
||||
return _get(_getPrototypeOf(YAMLSet.prototype), "toJSON", this).call(this, _, ctx, Set);
|
||||
}
|
||||
}, {
|
||||
key: "toString",
|
||||
value: function toString(ctx, onComment, onChompKeep) {
|
||||
if (!ctx) return JSON.stringify(this);
|
||||
if (this.hasAllNullValues()) return _get(_getPrototypeOf(YAMLSet.prototype), "toString", this).call(this, ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');
|
||||
}
|
||||
}]);
|
||||
|
||||
return YAMLSet;
|
||||
}(YAMLMap);
|
||||
|
||||
_defineProperty(YAMLSet, "tag", 'tag:yaml.org,2002:set');
|
||||
|
||||
function parseSet(doc, cst) {
|
||||
var map = resolveMap(doc, cst);
|
||||
if (!map.hasAllNullValues()) throw new YAMLSemanticError(cst, 'Set items must all have null values');
|
||||
return Object.assign(new YAMLSet(), map);
|
||||
}
|
||||
|
||||
function createSet(schema, iterable, ctx) {
|
||||
var set = new YAMLSet();
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(iterable),
|
||||
_step;
|
||||
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var value = _step.value;
|
||||
set.items.push(schema.createPair(value, null, ctx));
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
var set = {
|
||||
identify: function identify(value) {
|
||||
return value instanceof Set;
|
||||
},
|
||||
nodeClass: YAMLSet,
|
||||
default: false,
|
||||
tag: 'tag:yaml.org,2002:set',
|
||||
resolve: parseSet,
|
||||
createNode: createSet
|
||||
};
|
||||
|
||||
var parseSexagesimal = function parseSexagesimal(sign, parts) {
|
||||
var n = parts.split(':').reduce(function (n, p) {
|
||||
return n * 60 + Number(p);
|
||||
}, 0);
|
||||
return sign === '-' ? -n : n;
|
||||
}; // hhhh:mm:ss.sss
|
||||
|
||||
|
||||
var stringifySexagesimal = function stringifySexagesimal(_ref) {
|
||||
var value = _ref.value;
|
||||
if (isNaN(value) || !isFinite(value)) return stringifyNumber(value);
|
||||
var sign = '';
|
||||
|
||||
if (value < 0) {
|
||||
sign = '-';
|
||||
value = Math.abs(value);
|
||||
}
|
||||
|
||||
var parts = [value % 60]; // seconds, including ms
|
||||
|
||||
if (value < 60) {
|
||||
parts.unshift(0); // at least one : is required
|
||||
} else {
|
||||
value = Math.round((value - parts[0]) / 60);
|
||||
parts.unshift(value % 60); // minutes
|
||||
|
||||
if (value >= 60) {
|
||||
value = Math.round((value - parts[0]) / 60);
|
||||
parts.unshift(value); // hours
|
||||
}
|
||||
}
|
||||
|
||||
return sign + parts.map(function (n) {
|
||||
return n < 10 ? '0' + String(n) : String(n);
|
||||
}).join(':').replace(/000000\d*$/, '') // % 60 may introduce error
|
||||
;
|
||||
};
|
||||
|
||||
var intTime = {
|
||||
identify: function identify(value) {
|
||||
return typeof value === 'number';
|
||||
},
|
||||
default: true,
|
||||
tag: 'tag:yaml.org,2002:int',
|
||||
format: 'TIME',
|
||||
test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,
|
||||
resolve: function resolve(str, sign, parts) {
|
||||
return parseSexagesimal(sign, parts.replace(/_/g, ''));
|
||||
},
|
||||
stringify: stringifySexagesimal
|
||||
};
|
||||
var floatTime = {
|
||||
identify: function identify(value) {
|
||||
return typeof value === 'number';
|
||||
},
|
||||
default: true,
|
||||
tag: 'tag:yaml.org,2002:float',
|
||||
format: 'TIME',
|
||||
test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,
|
||||
resolve: function resolve(str, sign, parts) {
|
||||
return parseSexagesimal(sign, parts.replace(/_/g, ''));
|
||||
},
|
||||
stringify: stringifySexagesimal
|
||||
};
|
||||
var timestamp = {
|
||||
identify: function identify(value) {
|
||||
return value instanceof Date;
|
||||
},
|
||||
default: true,
|
||||
tag: 'tag:yaml.org,2002:timestamp',
|
||||
// If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
|
||||
// may be omitted altogether, resulting in a date format. In such a case, the time part is
|
||||
// assumed to be 00:00:00Z (start of day, UTC).
|
||||
test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
|
||||
'(?:(?:t|T|[ \\t]+)' + // t | T | whitespace
|
||||
'([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
|
||||
'(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
|
||||
')?' + ')$'),
|
||||
resolve: function resolve(str, year, month, day, hour, minute, second, millisec, tz) {
|
||||
if (millisec) millisec = (millisec + '00').substr(1, 3);
|
||||
var date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);
|
||||
|
||||
if (tz && tz !== 'Z') {
|
||||
var d = parseSexagesimal(tz[0], tz.slice(1));
|
||||
if (Math.abs(d) < 30) d *= 60;
|
||||
date -= 60000 * d;
|
||||
}
|
||||
|
||||
return new Date(date);
|
||||
},
|
||||
stringify: function stringify(_ref2) {
|
||||
var value = _ref2.value;
|
||||
return value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '');
|
||||
}
|
||||
};
|
||||
|
||||
/* global console, process, YAML_SILENCE_DEPRECATION_WARNINGS, YAML_SILENCE_WARNINGS */
|
||||
function shouldWarn(deprecation) {
|
||||
var env = typeof process !== 'undefined' && process.env || {};
|
||||
|
||||
if (deprecation) {
|
||||
if (typeof YAML_SILENCE_DEPRECATION_WARNINGS !== 'undefined') return !YAML_SILENCE_DEPRECATION_WARNINGS;
|
||||
return !env.YAML_SILENCE_DEPRECATION_WARNINGS;
|
||||
}
|
||||
|
||||
if (typeof YAML_SILENCE_WARNINGS !== 'undefined') return !YAML_SILENCE_WARNINGS;
|
||||
return !env.YAML_SILENCE_WARNINGS;
|
||||
}
|
||||
|
||||
function warn(warning, type) {
|
||||
if (shouldWarn(false)) {
|
||||
var emit = typeof process !== 'undefined' && process.emitWarning; // This will throw in Jest if `warning` is an Error instance due to
|
||||
// https://github.com/facebook/jest/issues/2549
|
||||
|
||||
if (emit) emit(warning, type);else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(type ? "".concat(type, ": ").concat(warning) : warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
function warnFileDeprecation(filename) {
|
||||
if (shouldWarn(true)) {
|
||||
var path = filename.replace(/.*yaml[/\\]/i, '').replace(/\.js$/, '').replace(/\\/g, '/');
|
||||
warn("The endpoint 'yaml/".concat(path, "' will be removed in a future release."), 'DeprecationWarning');
|
||||
}
|
||||
}
|
||||
var warned = {};
|
||||
function warnOptionDeprecation(name, alternative) {
|
||||
if (!warned[name] && shouldWarn(true)) {
|
||||
warned[name] = true;
|
||||
var msg = "The option '".concat(name, "' will be removed in a future release");
|
||||
msg += alternative ? ", use '".concat(alternative, "' instead.") : '.';
|
||||
warn(msg, 'DeprecationWarning');
|
||||
}
|
||||
}
|
||||
|
||||
export { warnOptionDeprecation as a, binary as b, warnFileDeprecation as c, floatTime as f, intTime as i, omap as o, pairs as p, set as s, timestamp as t, warn as w };
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../../src/internal/operators/scan.ts"],"names":[],"mappings":";;;AACA,qCAAuC;AACvC,iDAAgD;AAqFhD,SAAgB,IAAI,CAAU,WAA2D,EAAE,IAAQ;IAMjG,OAAO,cAAO,CAAC,6BAAa,CAAC,WAAW,EAAE,IAAS,EAAE,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACrF,CAAC;AAPD,oBAOC"}
|
||||
@@ -0,0 +1,3 @@
|
||||
require('preact/compat');
|
||||
|
||||
module.exports = require('preact/jsx-runtime');
|
||||
@@ -0,0 +1,55 @@
|
||||
# registry-url
|
||||
|
||||
> Get the set npm registry URL
|
||||
|
||||
It's usually `https://registry.npmjs.org/`, but it's [configurable](https://docs.npmjs.com/misc/registry).
|
||||
|
||||
Use this if you do anything with the npm registry as users will expect it to use their configured registry.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install registry-url
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ini
|
||||
# .npmrc
|
||||
registry = 'https://custom-registry.com/'
|
||||
```
|
||||
|
||||
```js
|
||||
import registryUrl from 'registry-url';
|
||||
|
||||
console.log(registryUrl());
|
||||
//=> 'https://custom-registry.com/'
|
||||
```
|
||||
|
||||
It can also retrieve the registry URL associated with an [npm scope](https://docs.npmjs.com/misc/scope).
|
||||
|
||||
```ini
|
||||
# .npmrc
|
||||
@myco:registry = 'https://custom-registry.com/'
|
||||
```
|
||||
|
||||
```js
|
||||
import registryUrl from 'registry-url';
|
||||
|
||||
console.log(registryUrl('@myco'));
|
||||
//=> 'https://custom-registry.com/'
|
||||
```
|
||||
|
||||
If the provided scope is not in the user's `.npmrc` file, then `registry-url` will check for the existence of `registry`, or if that's not set, fallback to the default npm registry.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-registry-url?utm_source=npm-registry-url&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,93 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for index.ts</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> index.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>5/5</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>5/5</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 high'></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></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">35x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span></td><td class="text"><pre class="prettyprint lang-js">import { TransformOptions } from "stream";
|
||||
import { CSVParseParam } from "./Parameters";
|
||||
import { Converter } from "./Converter";
|
||||
const helper = function (param?: Partial<CSVParseParam>, options?: TransformOptions): Converter {
|
||||
return new Converter(param, options);
|
||||
}
|
||||
|
||||
helper["Converter"] = Converter;
|
||||
export =helper;</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 Thu May 17 2018 01:25:26 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,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.windowWhen = void 0;
|
||||
var Subject_1 = require("../Subject");
|
||||
var lift_1 = require("../util/lift");
|
||||
var OperatorSubscriber_1 = require("./OperatorSubscriber");
|
||||
var innerFrom_1 = require("../observable/innerFrom");
|
||||
function windowWhen(closingSelector) {
|
||||
return lift_1.operate(function (source, subscriber) {
|
||||
var window;
|
||||
var closingSubscriber;
|
||||
var handleError = function (err) {
|
||||
window.error(err);
|
||||
subscriber.error(err);
|
||||
};
|
||||
var openWindow = function () {
|
||||
closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
|
||||
window === null || window === void 0 ? void 0 : window.complete();
|
||||
window = new Subject_1.Subject();
|
||||
subscriber.next(window.asObservable());
|
||||
var closingNotifier;
|
||||
try {
|
||||
closingNotifier = innerFrom_1.innerFrom(closingSelector());
|
||||
}
|
||||
catch (err) {
|
||||
handleError(err);
|
||||
return;
|
||||
}
|
||||
closingNotifier.subscribe((closingSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, openWindow, openWindow, handleError)));
|
||||
};
|
||||
openWindow();
|
||||
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) { return window.next(value); }, function () {
|
||||
window.complete();
|
||||
subscriber.complete();
|
||||
}, handleError, function () {
|
||||
closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
|
||||
window = null;
|
||||
}));
|
||||
});
|
||||
}
|
||||
exports.windowWhen = windowWhen;
|
||||
//# sourceMappingURL=windowWhen.js.map
|
||||
@@ -0,0 +1,58 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [3.0.1](https://github.com/nexdrew/ansi-align/compare/v3.0.0...v3.0.1) (2021-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** update string-width to version 4.1.0 ([#52](https://github.com/nexdrew/ansi-align/issues/52)) ([ab5b733](https://github.com/nexdrew/ansi-align/commit/ab5b733b1c30eef87b75e15459f2216db28d7ed3))
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/nexdrew/ansi-align/compare/v2.0.0...v3.0.0) (2018-12-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** update string-width to version 3.0.0 ([#50](https://github.com/nexdrew/ansi-align/issues/50)) ([67f0d8f](https://github.com/nexdrew/ansi-align/commit/67f0d8f))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **package:** Node 4 no longer supported, please update to Node 6+ or use ansi-align@2.0.0
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/nexdrew/ansi-align/compare/v1.1.0...v2.0.0) (2017-05-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ES2015ify, dropping support for Node <4 ([#30](https://github.com/nexdrew/ansi-align/issues/30)) ([7b43f48](https://github.com/nexdrew/ansi-align/commit/7b43f48))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use ansi-align@1.1.0
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/nexdrew/ansi-align/compare/v1.0.0...v1.1.0) (2016-06-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support left-alignment as no-op ([#3](https://github.com/nexdrew/ansi-align/issues/3)) ([e581db6](https://github.com/nexdrew/ansi-align/commit/e581db6))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2016-04-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* initial commit ([1914d90](https://github.com/nexdrew/ansi-align/commit/1914d90))
|
||||
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _utils = require('./utils');
|
||||
|
||||
var logger = {
|
||||
methodMap: ['debug', 'info', 'warn', 'error'],
|
||||
level: 'info',
|
||||
|
||||
// Maps a given level value to the `methodMap` indexes above.
|
||||
lookupLevel: function lookupLevel(level) {
|
||||
if (typeof level === 'string') {
|
||||
var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
|
||||
if (levelMap >= 0) {
|
||||
level = levelMap;
|
||||
} else {
|
||||
level = parseInt(level, 10);
|
||||
}
|
||||
}
|
||||
|
||||
return level;
|
||||
},
|
||||
|
||||
// Can be overridden in the host environment
|
||||
log: function log(level) {
|
||||
level = logger.lookupLevel(level);
|
||||
|
||||
if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
|
||||
var method = logger.methodMap[level];
|
||||
// eslint-disable-next-line no-console
|
||||
if (!console[method]) {
|
||||
method = 'log';
|
||||
}
|
||||
|
||||
for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
message[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
console[method].apply(console, message); // eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports['default'] = logger;
|
||||
module.exports = exports['default'];
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2xvZ2dlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O3FCQUF3QixTQUFTOztBQUVqQyxJQUFJLE1BQU0sR0FBRztBQUNYLFdBQVMsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sQ0FBQztBQUM3QyxPQUFLLEVBQUUsTUFBTTs7O0FBR2IsYUFBVyxFQUFFLHFCQUFTLEtBQUssRUFBRTtBQUMzQixRQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsRUFBRTtBQUM3QixVQUFJLFFBQVEsR0FBRyxlQUFRLE1BQU0sQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUM7QUFDOUQsVUFBSSxRQUFRLElBQUksQ0FBQyxFQUFFO0FBQ2pCLGFBQUssR0FBRyxRQUFRLENBQUM7T0FDbEIsTUFBTTtBQUNMLGFBQUssR0FBRyxRQUFRLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO09BQzdCO0tBQ0Y7O0FBRUQsV0FBTyxLQUFLLENBQUM7R0FDZDs7O0FBR0QsS0FBRyxFQUFFLGFBQVMsS0FBSyxFQUFjO0FBQy9CLFNBQUssR0FBRyxNQUFNLENBQUMsV0FBVyxDQUFDLEtBQUssQ0FBQyxDQUFDOztBQUVsQyxRQUNFLE9BQU8sT0FBTyxLQUFLLFdBQVcsSUFDOUIsTUFBTSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksS0FBSyxFQUN6QztBQUNBLFVBQUksTUFBTSxHQUFHLE1BQU0sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLENBQUM7O0FBRXJDLFVBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLEVBQUU7QUFDcEIsY0FBTSxHQUFHLEtBQUssQ0FBQztPQUNoQjs7d0NBWG1CLE9BQU87QUFBUCxlQUFPOzs7QUFZM0IsYUFBTyxDQUFDLE1BQU0sT0FBQyxDQUFmLE9BQU8sRUFBWSxPQUFPLENBQUMsQ0FBQztLQUM3QjtHQUNGO0NBQ0YsQ0FBQzs7cUJBRWEsTUFBTSIsImZpbGUiOiJsb2dnZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBpbmRleE9mIH0gZnJvbSAnLi91dGlscyc7XG5cbmxldCBsb2dnZXIgPSB7XG4gIG1ldGhvZE1hcDogWydkZWJ1ZycsICdpbmZvJywgJ3dhcm4nLCAnZXJyb3InXSxcbiAgbGV2ZWw6ICdpbmZvJyxcblxuICAvLyBNYXBzIGEgZ2l2ZW4gbGV2ZWwgdmFsdWUgdG8gdGhlIGBtZXRob2RNYXBgIGluZGV4ZXMgYWJvdmUuXG4gIGxvb2t1cExldmVsOiBmdW5jdGlvbihsZXZlbCkge1xuICAgIGlmICh0eXBlb2YgbGV2ZWwgPT09ICdzdHJpbmcnKSB7XG4gICAgICBsZXQgbGV2ZWxNYXAgPSBpbmRleE9mKGxvZ2dlci5tZXRob2RNYXAsIGxldmVsLnRvTG93ZXJDYXNlKCkpO1xuICAgICAgaWYgKGxldmVsTWFwID49IDApIHtcbiAgICAgICAgbGV2ZWwgPSBsZXZlbE1hcDtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGxldmVsID0gcGFyc2VJbnQobGV2ZWwsIDEwKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbGV2ZWw7XG4gIH0sXG5cbiAgLy8gQ2FuIGJlIG92ZXJyaWRkZW4gaW4gdGhlIGhvc3QgZW52aXJvbm1lbnRcbiAgbG9nOiBmdW5jdGlvbihsZXZlbCwgLi4ubWVzc2FnZSkge1xuICAgIGxldmVsID0gbG9nZ2VyLmxvb2t1cExldmVsKGxldmVsKTtcblxuICAgIGlmIChcbiAgICAgIHR5cGVvZiBjb25zb2xlICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgbG9nZ2VyLmxvb2t1cExldmVsKGxvZ2dlci5sZXZlbCkgPD0gbGV2ZWxcbiAgICApIHtcbiAgICAgIGxldCBtZXRob2QgPSBsb2dnZXIubWV0aG9kTWFwW2xldmVsXTtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gICAgICBpZiAoIWNvbnNvbGVbbWV0aG9kXSkge1xuICAgICAgICBtZXRob2QgPSAnbG9nJztcbiAgICAgIH1cbiAgICAgIGNvbnNvbGVbbWV0aG9kXSguLi5tZXNzYWdlKTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBsb2dnZXI7XG4iXX0=
|
||||
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2014 Nicolas Bevacqua
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"windowToggle.js","sourceRoot":"","sources":["../../../../src/internal/operators/windowToggle.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiD9C,MAAM,UAAU,YAAY,CAC1B,QAA4B,EAC5B,eAAuD;IAEvD,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAChC,IAAM,OAAO,GAAiB,EAAE,CAAC;QAEjC,IAAM,WAAW,GAAG,UAAC,GAAQ;YAC3B,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE;gBACzB,OAAO,CAAC,KAAK,EAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC7B;YACD,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC,CAAC;QAEF,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,CAC3B,wBAAwB,CACtB,UAAU,EACV,UAAC,SAAS;YACR,IAAM,MAAM,GAAG,IAAI,OAAO,EAAK,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,IAAM,mBAAmB,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/C,IAAM,WAAW,GAAG;gBAClB,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC3B,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAClB,mBAAmB,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;YAEF,IAAI,eAAgC,CAAC;YACrC,IAAI;gBACF,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;aACzD;YAAC,OAAO,GAAG,EAAE;gBACZ,WAAW,CAAC,GAAG,CAAC,CAAC;gBACjB,OAAO;aACR;YAED,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAEvC,mBAAmB,CAAC,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,wBAAwB,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;QAC3H,CAAC,EACD,IAAI,CACL,CACF,CAAC;QAGF,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,UAAC,KAAQ;;YAGP,IAAM,WAAW,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;;gBACpC,KAAqB,IAAA,gBAAA,SAAA,WAAW,CAAA,wCAAA,iEAAE;oBAA7B,IAAM,QAAM,wBAAA;oBACf,QAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBACpB;;;;;;;;;QACH,CAAC,EACD;YAEE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE;gBACzB,OAAO,CAAC,KAAK,EAAG,CAAC,QAAQ,EAAE,CAAC;aAC7B;YACD,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,EACD,WAAW,EACX;YAME,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE;gBACzB,OAAO,CAAC,KAAK,EAAG,CAAC,WAAW,EAAE,CAAC;aAChC;QACH,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,43 @@
|
||||
var escapeHtmlChar = require('./_escapeHtmlChar'),
|
||||
toString = require('./toString');
|
||||
|
||||
/** Used to match HTML entities and HTML characters. */
|
||||
var reUnescapedHtml = /[&<>"']/g,
|
||||
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
||||
|
||||
/**
|
||||
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
|
||||
* corresponding HTML entities.
|
||||
*
|
||||
* **Note:** No other characters are escaped. To escape additional
|
||||
* characters use a third-party library like [_he_](https://mths.be/he).
|
||||
*
|
||||
* Though the ">" character is escaped for symmetry, characters like
|
||||
* ">" and "/" don't need escaping in HTML and have no special meaning
|
||||
* unless they're part of a tag or unquoted attribute value. See
|
||||
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
|
||||
* (under "semi-related fun fact") for more details.
|
||||
*
|
||||
* When working with HTML you should always
|
||||
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
|
||||
* XSS vectors.
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @memberOf _
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
* @example
|
||||
*
|
||||
* _.escape('fred, barney, & pebbles');
|
||||
* // => 'fred, barney, & pebbles'
|
||||
*/
|
||||
function escape(string) {
|
||||
string = toString(string);
|
||||
return (string && reHasUnescapedHtml.test(string))
|
||||
? string.replace(reUnescapedHtml, escapeHtmlChar)
|
||||
: string;
|
||||
}
|
||||
|
||||
module.exports = escape;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,19 @@
|
||||
# @babel/code-frame
|
||||
|
||||
> Generate errors that contain a code frame that point to source locations.
|
||||
|
||||
See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/code-frame
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/code-frame --dev
|
||||
```
|
||||
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsapAction = void 0;
|
||||
var AsyncAction_1 = require("./AsyncAction");
|
||||
var immediateProvider_1 = require("./immediateProvider");
|
||||
var AsapAction = (function (_super) {
|
||||
__extends(AsapAction, _super);
|
||||
function AsapAction(scheduler, work) {
|
||||
var _this = _super.call(this, scheduler, work) || this;
|
||||
_this.scheduler = scheduler;
|
||||
_this.work = work;
|
||||
return _this;
|
||||
}
|
||||
AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
||||
if (delay === void 0) { delay = 0; }
|
||||
if (delay !== null && delay > 0) {
|
||||
return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
||||
}
|
||||
scheduler.actions.push(this);
|
||||
return scheduler._scheduled || (scheduler._scheduled = immediateProvider_1.immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));
|
||||
};
|
||||
AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
||||
var _a;
|
||||
if (delay === void 0) { delay = 0; }
|
||||
if (delay != null ? delay > 0 : this.delay > 0) {
|
||||
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
||||
}
|
||||
var actions = scheduler.actions;
|
||||
if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
|
||||
immediateProvider_1.immediateProvider.clearImmediate(id);
|
||||
scheduler._scheduled = undefined;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
return AsapAction;
|
||||
}(AsyncAction_1.AsyncAction));
|
||||
exports.AsapAction = AsapAction;
|
||||
//# sourceMappingURL=AsapAction.js.map
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"importHelpers": true,
|
||||
"target": "es5",
|
||||
"downlevelIteration": true,
|
||||
"outDir": "../dist/esm5"
|
||||
},
|
||||
"exclude": ["./internal/umd.ts"]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Jason Miller
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').unmemoize;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"J D E CC"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","257":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","289":"tB EC FC","292":"DC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","33":"I"},E:{"1":"v D E F A B C K L G KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","33":"I HC zB","129":"J IC JC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e RC SC qB AC TC rB","2":"F PC QC"},G:{"1":"E UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","33":"zB"},H:{"2":"oC"},I:{"1":"tB I f qC rC sC BC tC uC","33":"pC"},J:{"1":"D A"},K:{"1":"B C h qB AC rB","2":"A"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","257":"AD"}},B:4,C:"CSS3 Border-radius (rounded corners)"};
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* IS `true` for Node.js 10.10 and greater.
|
||||
*/
|
||||
export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean;
|
||||
@@ -0,0 +1,43 @@
|
||||
import {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep';
|
||||
|
||||
/**
|
||||
Convert object properties to snake case recursively.
|
||||
|
||||
This can be useful when, for example, converting some API types from a different style.
|
||||
|
||||
@see SnakeCase
|
||||
@see SnakeCasedProperties
|
||||
|
||||
@example
|
||||
```
|
||||
interface User {
|
||||
userId: number;
|
||||
userName: string;
|
||||
}
|
||||
|
||||
interface UserWithFriends {
|
||||
userInfo: User;
|
||||
userFriends: User[];
|
||||
}
|
||||
|
||||
const result: SnakeCasedPropertiesDeep<UserWithFriends> = {
|
||||
user_info: {
|
||||
user_id: 1,
|
||||
user_name: 'Tom',
|
||||
},
|
||||
user_friends: [
|
||||
{
|
||||
user_id: 2,
|
||||
user_name: 'Jerry',
|
||||
},
|
||||
{
|
||||
user_id: 3,
|
||||
user_name: 'Spike',
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
@category Template Literals
|
||||
*/
|
||||
export type SnakeCasedPropertiesDeep<Value> = DelimiterCasedPropertiesDeep<Value, '_'>;
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "path-key",
|
||||
"version": "3.1.1",
|
||||
"description": "Get the PATH environment variable key cross-platform",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/path-key",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"key",
|
||||
"environment",
|
||||
"env",
|
||||
"variable",
|
||||
"var",
|
||||
"get",
|
||||
"cross-platform",
|
||||
"windows"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^11.13.0",
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import {Except} from './except';
|
||||
import {ConditionalKeys} from './conditional-keys';
|
||||
|
||||
/**
|
||||
Exclude keys from a shape that matches the given `Condition`.
|
||||
|
||||
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
||||
|
||||
@example
|
||||
```
|
||||
import {Primitive, ConditionalExcept} from 'type-fest';
|
||||
|
||||
class Awesome {
|
||||
name: string;
|
||||
successes: number;
|
||||
failures: bigint;
|
||||
|
||||
run() {}
|
||||
}
|
||||
|
||||
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
||||
//=> {run: () => void}
|
||||
```
|
||||
|
||||
@example
|
||||
```
|
||||
import {ConditionalExcept} from 'type-fest';
|
||||
|
||||
interface Example {
|
||||
a: string;
|
||||
b: string | number;
|
||||
c: () => void;
|
||||
d: {};
|
||||
}
|
||||
|
||||
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
||||
//=> {b: string | number; c: () => void; d: {}}
|
||||
```
|
||||
|
||||
@category Utilities
|
||||
*/
|
||||
export type ConditionalExcept<Base, Condition> = Except<
|
||||
Base,
|
||||
ConditionalKeys<Base, Condition>
|
||||
>;
|
||||
@@ -0,0 +1,49 @@
|
||||
import { __generator } from "tslib";
|
||||
import { identity } from '../util/identity';
|
||||
import { isScheduler } from '../util/isScheduler';
|
||||
import { defer } from './defer';
|
||||
import { scheduleIterable } from '../scheduled/scheduleIterable';
|
||||
export function generate(initialStateOrOptions, condition, iterate, resultSelectorOrScheduler, scheduler) {
|
||||
var _a, _b;
|
||||
var resultSelector;
|
||||
var initialState;
|
||||
if (arguments.length === 1) {
|
||||
(_a = initialStateOrOptions, initialState = _a.initialState, condition = _a.condition, iterate = _a.iterate, _b = _a.resultSelector, resultSelector = _b === void 0 ? identity : _b, scheduler = _a.scheduler);
|
||||
}
|
||||
else {
|
||||
initialState = initialStateOrOptions;
|
||||
if (!resultSelectorOrScheduler || isScheduler(resultSelectorOrScheduler)) {
|
||||
resultSelector = identity;
|
||||
scheduler = resultSelectorOrScheduler;
|
||||
}
|
||||
else {
|
||||
resultSelector = resultSelectorOrScheduler;
|
||||
}
|
||||
}
|
||||
function gen() {
|
||||
var state;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
state = initialState;
|
||||
_a.label = 1;
|
||||
case 1:
|
||||
if (!(!condition || condition(state))) return [3, 4];
|
||||
return [4, resultSelector(state)];
|
||||
case 2:
|
||||
_a.sent();
|
||||
_a.label = 3;
|
||||
case 3:
|
||||
state = iterate(state);
|
||||
return [3, 1];
|
||||
case 4: return [2];
|
||||
}
|
||||
});
|
||||
}
|
||||
return defer((scheduler
|
||||
?
|
||||
function () { return scheduleIterable(gen(), scheduler); }
|
||||
:
|
||||
gen));
|
||||
}
|
||||
//# sourceMappingURL=generate.js.map
|
||||
@@ -0,0 +1,209 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
var $log = GetIntrinsic('%Math.log%');
|
||||
var $log2E = GetIntrinsic('%Math.LOG2E%');
|
||||
var $log2 = GetIntrinsic('%Math.log2%', true) || function log2(x) {
|
||||
return $log(x) * $log2E;
|
||||
};
|
||||
var $parseInt = GetIntrinsic('%parseInt%');
|
||||
var $pow = GetIntrinsic('%Math.pow%');
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $BigInt = GetIntrinsic('%BigInt%', true);
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $reverse = callBound('Array.prototype.reverse');
|
||||
var $numberToString = callBound('Number.prototype.toString');
|
||||
var $strSlice = callBound('String.prototype.slice');
|
||||
|
||||
var abs = require('./abs');
|
||||
var hasOwnProperty = require('./HasOwnProperty');
|
||||
var ToBigInt64 = require('./ToBigInt64');
|
||||
var ToBigUint64 = require('./ToBigUint64');
|
||||
var ToInt16 = require('./ToInt16');
|
||||
var ToInt32 = require('./ToInt32');
|
||||
var ToInt8 = require('./ToInt8');
|
||||
var ToUint16 = require('./ToUint16');
|
||||
var ToUint32 = require('./ToUint32');
|
||||
var ToUint8 = require('./ToUint8');
|
||||
var ToUint8Clamp = require('./ToUint8Clamp');
|
||||
var Type = require('./Type');
|
||||
|
||||
var isNaN = require('../helpers/isNaN');
|
||||
var isFinite = require('../helpers/isFinite');
|
||||
|
||||
var keys = require('object-keys');
|
||||
|
||||
// https://262.ecma-international.org/11.0/#table-the-typedarray-constructors
|
||||
var TypeToSizes = {
|
||||
__proto__: null,
|
||||
Int8: 1,
|
||||
Uint8: 1,
|
||||
Uint8C: 1,
|
||||
Int16: 2,
|
||||
Uint16: 2,
|
||||
Int32: 4,
|
||||
Uint32: 4,
|
||||
BigInt64: 8,
|
||||
BigUint64: 8,
|
||||
Float32: 4,
|
||||
Float64: 8
|
||||
};
|
||||
|
||||
var TypeToAO = {
|
||||
__proto__: null,
|
||||
Int8: ToInt8,
|
||||
Uint8: ToUint8,
|
||||
Uint8C: ToUint8Clamp,
|
||||
Int16: ToInt16,
|
||||
Uint16: ToUint16,
|
||||
Int32: ToInt32,
|
||||
Uint32: ToUint32,
|
||||
BigInt64: ToBigInt64,
|
||||
BigUint64: ToBigUint64
|
||||
};
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-numerictorawbytes
|
||||
|
||||
module.exports = function NumericToRawBytes(type, value, isLittleEndian) {
|
||||
if (typeof type !== 'string' || !hasOwnProperty(TypeToSizes, type)) {
|
||||
throw new $TypeError('Assertion failed: `type` must be a TypedArray element type: ' + keys(TypeToSizes));
|
||||
}
|
||||
if (Type(value) !== 'Number' && Type(value) !== 'BigInt') {
|
||||
throw new $TypeError('Assertion failed: `value` must be a Number or a BigInt');
|
||||
}
|
||||
if (Type(isLittleEndian) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `isLittleEndian` must be a Boolean');
|
||||
}
|
||||
|
||||
var rawBytes = [];
|
||||
var exponent;
|
||||
|
||||
if (type === 'Float32') { // step 1
|
||||
if (isNaN(value)) {
|
||||
return isLittleEndian ? [0, 0, 192, 127] : [127, 192, 0, 0]; // hardcoded
|
||||
}
|
||||
|
||||
var leastSig;
|
||||
|
||||
if (value === 0) {
|
||||
leastSig = Object.is(value, -0) ? 0x80 : 0;
|
||||
return isLittleEndian ? [0, 0, 0, leastSig] : [leastSig, 0, 0, 0];
|
||||
}
|
||||
|
||||
if (!isFinite(value)) {
|
||||
leastSig = value < 0 ? 255 : 127;
|
||||
return isLittleEndian ? [0, 0, 128, leastSig] : [leastSig, 128, 0, 0];
|
||||
}
|
||||
|
||||
var sign = value < 0 ? 1 : 0;
|
||||
value = abs(value); // eslint-disable-line no-param-reassign
|
||||
|
||||
exponent = 0;
|
||||
while (value >= 2) {
|
||||
exponent += 1;
|
||||
value /= 2; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
|
||||
while (value < 1) {
|
||||
exponent -= 1;
|
||||
value *= 2; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
|
||||
var mantissa = value - 1;
|
||||
mantissa *= $pow(2, 23);
|
||||
mantissa = $floor(mantissa);
|
||||
|
||||
exponent += 127;
|
||||
exponent = exponent << 23;
|
||||
|
||||
var result = sign << 31;
|
||||
result |= exponent;
|
||||
result |= mantissa;
|
||||
|
||||
var byte0 = result & 255;
|
||||
result = result >> 8;
|
||||
var byte1 = result & 255;
|
||||
result = result >> 8;
|
||||
var byte2 = result & 255;
|
||||
result = result >> 8;
|
||||
var byte3 = result & 255;
|
||||
|
||||
if (isLittleEndian) {
|
||||
return [byte0, byte1, byte2, byte3];
|
||||
}
|
||||
return [byte3, byte2, byte1, byte0];
|
||||
} else if (type === 'Float64') { // step 2
|
||||
if (value === 0) {
|
||||
leastSig = Object.is(value, -0) ? 0x80 : 0;
|
||||
return isLittleEndian ? [0, 0, 0, 0, 0, 0, 0, leastSig] : [leastSig, 0, 0, 0, 0, 0, 0, 0];
|
||||
}
|
||||
if (isNaN(value)) {
|
||||
return isLittleEndian ? [0, 0, 0, 0, 0, 0, 248, 127] : [127, 248, 0, 0, 0, 0, 0, 0];
|
||||
}
|
||||
if (!isFinite(value)) {
|
||||
var infBytes = value < 0 ? [0, 0, 0, 0, 0, 0, 240, 255] : [0, 0, 0, 0, 0, 0, 240, 127];
|
||||
return isLittleEndian ? infBytes : $reverse(infBytes);
|
||||
}
|
||||
|
||||
var isNegative = value < 0;
|
||||
if (isNegative) { value = -value; } // eslint-disable-line no-param-reassign
|
||||
|
||||
exponent = $floor($log2(value));
|
||||
var significand = (value / $pow(2, exponent)) - 1;
|
||||
|
||||
var bitString = '';
|
||||
for (var i = 0; i < 52; i++) {
|
||||
significand *= 2;
|
||||
if (significand >= 1) {
|
||||
bitString += '1';
|
||||
significand -= 1;
|
||||
} else {
|
||||
bitString += '0';
|
||||
}
|
||||
}
|
||||
|
||||
exponent += 1023;
|
||||
var exponentBits = $numberToString(exponent, 2);
|
||||
while (exponentBits.length < 11) { exponentBits = '0' + exponentBits; }
|
||||
|
||||
var fullBitString = (isNegative ? '1' : '0') + exponentBits + bitString;
|
||||
while (fullBitString.length < 64) { fullBitString = '0' + fullBitString; }
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
rawBytes[i] = $parseInt($strSlice(fullBitString, i * 8, (i + 1) * 8), 2);
|
||||
}
|
||||
|
||||
return isLittleEndian ? $reverse(rawBytes) : rawBytes;
|
||||
} // step 3
|
||||
|
||||
var n = TypeToSizes[type]; // step 3.a
|
||||
|
||||
var convOp = TypeToAO[type]; // step 3.b
|
||||
|
||||
var intValue = convOp(value); // step 3.c
|
||||
|
||||
var isBigInt = type === 'BigInt64' || type === 'BigUint64';
|
||||
/*
|
||||
if (intValue >= 0) { // step 3.d
|
||||
// Let rawBytes be a List containing the n-byte binary encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
|
||||
} else { // step 3.e
|
||||
// Let rawBytes be a List containing the n-byte binary 2's complement encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
|
||||
}
|
||||
*/
|
||||
if (intValue < 0) {
|
||||
intValue = intValue >>> 0;
|
||||
}
|
||||
var OxFF = isBigInt ? $BigInt(0xFF) : 0xFF;
|
||||
var eight = isBigInt ? $BigInt(8) : 8;
|
||||
for (i = 0; i < n; i++) {
|
||||
rawBytes[isLittleEndian ? i : n - 1 - i] = $Number(intValue & OxFF);
|
||||
intValue = intValue >> eight;
|
||||
}
|
||||
|
||||
return rawBytes; // step 4
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
# is-stream
|
||||
|
||||
> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install is-stream
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import fs from 'node:fs';
|
||||
import {isStream} from 'is-stream';
|
||||
|
||||
isStream(fs.createReadStream('unicorn.png'));
|
||||
//=> true
|
||||
|
||||
isStream({});
|
||||
//=> false
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### isStream(stream)
|
||||
|
||||
Returns a `boolean` for whether it's a [`Stream`](https://nodejs.org/api/stream.html#stream_stream).
|
||||
|
||||
#### isWritableStream(stream)
|
||||
|
||||
Returns a `boolean` for whether it's a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable).
|
||||
|
||||
#### isReadableStream(stream)
|
||||
|
||||
Returns a `boolean` for whether it's a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable).
|
||||
|
||||
#### isDuplexStream(stream)
|
||||
|
||||
Returns a `boolean` for whether it's a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex).
|
||||
|
||||
#### isTransformStream(stream)
|
||||
|
||||
Returns a `boolean` for whether it's a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform).
|
||||
|
||||
## Related
|
||||
|
||||
- [is-file-stream](https://github.com/jamestalmage/is-file-stream) - Detect if a stream is a file stream
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-is-stream?utm_source=npm-is-stream&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,230 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var getEol_1 = __importDefault(require("./getEol"));
|
||||
var util_1 = require("./util");
|
||||
var defaulDelimiters = [",", "|", "\t", ";", ":"];
|
||||
var RowSplit = /** @class */ (function () {
|
||||
function RowSplit(conv) {
|
||||
this.conv = conv;
|
||||
this.cachedRegExp = {};
|
||||
this.delimiterEmitted = false;
|
||||
this._needEmitDelimiter = undefined;
|
||||
this.quote = conv.parseParam.quote;
|
||||
this.trim = conv.parseParam.trim;
|
||||
this.escape = conv.parseParam.escape;
|
||||
}
|
||||
Object.defineProperty(RowSplit.prototype, "needEmitDelimiter", {
|
||||
get: function () {
|
||||
if (this._needEmitDelimiter === undefined) {
|
||||
this._needEmitDelimiter = this.conv.listeners("delimiter").length > 0;
|
||||
}
|
||||
return this._needEmitDelimiter;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
RowSplit.prototype.parse = function (fileline) {
|
||||
if (fileline.length === 0 || (this.conv.parseParam.ignoreEmpty && fileline.trim().length === 0)) {
|
||||
return { cells: [], closed: true };
|
||||
}
|
||||
var quote = this.quote;
|
||||
var trim = this.trim;
|
||||
var escape = this.escape;
|
||||
if (this.conv.parseRuntime.delimiter instanceof Array || this.conv.parseRuntime.delimiter.toLowerCase() === "auto") {
|
||||
this.conv.parseRuntime.delimiter = this.getDelimiter(fileline);
|
||||
}
|
||||
if (this.needEmitDelimiter && !this.delimiterEmitted) {
|
||||
this.conv.emit("delimiter", this.conv.parseRuntime.delimiter);
|
||||
this.delimiterEmitted = true;
|
||||
}
|
||||
var delimiter = this.conv.parseRuntime.delimiter;
|
||||
var rowArr = fileline.split(delimiter);
|
||||
if (quote === "off") {
|
||||
if (trim) {
|
||||
for (var i = 0; i < rowArr.length; i++) {
|
||||
rowArr[i] = rowArr[i].trim();
|
||||
}
|
||||
}
|
||||
return { cells: rowArr, closed: true };
|
||||
}
|
||||
else {
|
||||
return this.toCSVRow(rowArr, trim, quote, delimiter);
|
||||
}
|
||||
};
|
||||
RowSplit.prototype.toCSVRow = function (rowArr, trim, quote, delimiter) {
|
||||
var row = [];
|
||||
var inquote = false;
|
||||
var quoteBuff = '';
|
||||
for (var i = 0, rowLen = rowArr.length; i < rowLen; i++) {
|
||||
var e = rowArr[i];
|
||||
if (!inquote && trim) {
|
||||
e = util_1.trimLeft(e);
|
||||
}
|
||||
var len = e.length;
|
||||
if (!inquote) {
|
||||
if (len === 2 && e === this.quote + this.quote) {
|
||||
row.push("");
|
||||
continue;
|
||||
}
|
||||
else if (this.isQuoteOpen(e)) { //quote open
|
||||
e = e.substr(1);
|
||||
if (this.isQuoteClose(e)) { //quote close
|
||||
e = e.substring(0, e.lastIndexOf(quote));
|
||||
e = this.escapeQuote(e);
|
||||
row.push(e);
|
||||
continue;
|
||||
}
|
||||
else if (e.indexOf(quote) !== -1) {
|
||||
var count = 0;
|
||||
var prev = "";
|
||||
for (var _i = 0, e_1 = e; _i < e_1.length; _i++) {
|
||||
var c = e_1[_i];
|
||||
// count quotes only if previous character is not escape char
|
||||
if (c === quote && prev !== this.escape) {
|
||||
count++;
|
||||
prev = "";
|
||||
}
|
||||
else {
|
||||
// save previous char to temp variable
|
||||
prev = c;
|
||||
}
|
||||
}
|
||||
if (count % 2 === 1) {
|
||||
if (trim) {
|
||||
e = util_1.trimRight(e);
|
||||
}
|
||||
row.push(quote + e);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
inquote = true;
|
||||
quoteBuff += e;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
inquote = true;
|
||||
quoteBuff += e;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (trim) {
|
||||
e = util_1.trimRight(e);
|
||||
}
|
||||
row.push(e);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else { //previous quote not closed
|
||||
if (this.isQuoteClose(e)) { //close double quote
|
||||
inquote = false;
|
||||
e = e.substr(0, len - 1);
|
||||
quoteBuff += delimiter + e;
|
||||
quoteBuff = this.escapeQuote(quoteBuff);
|
||||
if (trim) {
|
||||
quoteBuff = util_1.trimRight(quoteBuff);
|
||||
}
|
||||
row.push(quoteBuff);
|
||||
quoteBuff = "";
|
||||
}
|
||||
else {
|
||||
quoteBuff += delimiter + e;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (!inquote && param._needFilterRow) {
|
||||
// row = filterRow(row, param);
|
||||
// }
|
||||
return { cells: row, closed: !inquote };
|
||||
};
|
||||
RowSplit.prototype.getDelimiter = function (fileline) {
|
||||
var checker;
|
||||
if (this.conv.parseParam.delimiter === "auto") {
|
||||
checker = defaulDelimiters;
|
||||
}
|
||||
else if (this.conv.parseParam.delimiter instanceof Array) {
|
||||
checker = this.conv.parseParam.delimiter;
|
||||
}
|
||||
else {
|
||||
return this.conv.parseParam.delimiter;
|
||||
}
|
||||
var count = 0;
|
||||
var rtn = ",";
|
||||
checker.forEach(function (delim) {
|
||||
var delimCount = fileline.split(delim).length;
|
||||
if (delimCount > count) {
|
||||
rtn = delim;
|
||||
count = delimCount;
|
||||
}
|
||||
});
|
||||
return rtn;
|
||||
};
|
||||
RowSplit.prototype.isQuoteOpen = function (str) {
|
||||
var quote = this.quote;
|
||||
var escape = this.escape;
|
||||
return str[0] === quote && (str[1] !== quote ||
|
||||
str[1] === escape && (str[2] === quote || str.length === 2));
|
||||
};
|
||||
RowSplit.prototype.isQuoteClose = function (str) {
|
||||
var quote = this.quote;
|
||||
var escape = this.escape;
|
||||
if (this.conv.parseParam.trim) {
|
||||
str = util_1.trimRight(str);
|
||||
}
|
||||
var count = 0;
|
||||
var idx = str.length - 1;
|
||||
while (str[idx] === quote || str[idx] === escape) {
|
||||
idx--;
|
||||
count++;
|
||||
}
|
||||
return count % 2 !== 0;
|
||||
};
|
||||
// private twoDoubleQuote(str: string): string {
|
||||
// var twoQuote = this.quote + this.quote;
|
||||
// var curIndex = -1;
|
||||
// while ((curIndex = str.indexOf(twoQuote, curIndex)) > -1) {
|
||||
// str = str.substring(0, curIndex) + str.substring(++curIndex);
|
||||
// }
|
||||
// return str;
|
||||
// }
|
||||
RowSplit.prototype.escapeQuote = function (segment) {
|
||||
var key = "es|" + this.quote + "|" + this.escape;
|
||||
if (this.cachedRegExp[key] === undefined) {
|
||||
this.cachedRegExp[key] = new RegExp('\\' + this.escape + '\\' + this.quote, 'g');
|
||||
}
|
||||
var regExp = this.cachedRegExp[key];
|
||||
// console.log(regExp,segment);
|
||||
return segment.replace(regExp, this.quote);
|
||||
};
|
||||
RowSplit.prototype.parseMultiLines = function (lines) {
|
||||
var csvLines = [];
|
||||
var left = "";
|
||||
while (lines.length) {
|
||||
var line = left + lines.shift();
|
||||
var row = this.parse(line);
|
||||
if (row.cells.length === 0 && this.conv.parseParam.ignoreEmpty) {
|
||||
continue;
|
||||
}
|
||||
if (row.closed || this.conv.parseParam.alwaysSplitAtEOL) {
|
||||
if (this.conv.parseRuntime.selectedColumns) {
|
||||
csvLines.push(util_1.filterArray(row.cells, this.conv.parseRuntime.selectedColumns));
|
||||
}
|
||||
else {
|
||||
csvLines.push(row.cells);
|
||||
}
|
||||
left = "";
|
||||
}
|
||||
else {
|
||||
left = line + (getEol_1.default(line, this.conv.parseRuntime) || "\n");
|
||||
}
|
||||
}
|
||||
return { rowsCells: csvLines, partial: left };
|
||||
};
|
||||
return RowSplit;
|
||||
}());
|
||||
exports.RowSplit = RowSplit;
|
||||
//# sourceMappingURL=rowSplit.js.map
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* This splits a string on a top-level character.
|
||||
*
|
||||
* Regex doesn't support recursion (at least not the JS-flavored version).
|
||||
* So we have to use a tiny state machine to keep track of paren placement.
|
||||
*
|
||||
* Expected behavior using commas:
|
||||
* var(--a, 0 0 1px rgb(0, 0, 0)), 0 0 1px rgb(0, 0, 0)
|
||||
* ─┬─ ┬ ┬ ┬
|
||||
* x x x ╰──────── Split because top-level
|
||||
* ╰──────────────┴──┴───────────── Ignored b/c inside >= 1 levels of parens
|
||||
*
|
||||
* @param {string} input
|
||||
* @param {string} separator
|
||||
*/
|
||||
export function splitAtTopLevelOnly(input, separator) {
|
||||
let stack = []
|
||||
let parts = []
|
||||
let lastPos = 0
|
||||
|
||||
for (let idx = 0; idx < input.length; idx++) {
|
||||
let char = input[idx]
|
||||
|
||||
if (stack.length === 0 && char === separator[0]) {
|
||||
if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
|
||||
parts.push(input.slice(lastPos, idx))
|
||||
lastPos = idx + separator.length
|
||||
}
|
||||
}
|
||||
|
||||
if (char === '(' || char === '[' || char === '{') {
|
||||
stack.push(char)
|
||||
} else if (
|
||||
(char === ')' && stack[stack.length - 1] === '(') ||
|
||||
(char === ']' && stack[stack.length - 1] === '[') ||
|
||||
(char === '}' && stack[stack.length - 1] === '{')
|
||||
) {
|
||||
stack.pop()
|
||||
}
|
||||
}
|
||||
|
||||
parts.push(input.slice(lastPos))
|
||||
|
||||
return parts
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? Math.clz32 : require("./shim");
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "globalyzer",
|
||||
"version": "0.1.0",
|
||||
"description": "Detects and extract the glob part of a string",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/terkelg/globalyzer"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"keywords": [
|
||||
"glob",
|
||||
"analyzer",
|
||||
"base",
|
||||
"detect"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "tape test/*.js | tap-spec"
|
||||
},
|
||||
"author": "Terkel Gjervig",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"tap-spec": "^4.1.1",
|
||||
"tape": "^4.9.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
var resolveException = require("../resolve-exception");
|
||||
|
||||
module.exports = function (value, coerced, options) {
|
||||
if (coerced >= options.min) return coerced;
|
||||
var errorMessage =
|
||||
options && options.name
|
||||
? "Expected %n to be greater or equal " + options.min + ", received %v"
|
||||
: "%v is not greater or equal " + options.min;
|
||||
return resolveException(value, errorMessage, options);
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { asyncScheduler } from '../scheduler/async';
|
||||
import { audit } from './audit';
|
||||
import { timer } from '../observable/timer';
|
||||
export function auditTime(duration, scheduler) {
|
||||
if (scheduler === void 0) { scheduler = asyncScheduler; }
|
||||
return audit(function () { return timer(duration, scheduler); });
|
||||
}
|
||||
//# sourceMappingURL=auditTime.js.map
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "validateConfig", {
|
||||
enumerable: true,
|
||||
get: ()=>validateConfig
|
||||
});
|
||||
const _log = /*#__PURE__*/ _interopRequireDefault(require("./log"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function validateConfig(config) {
|
||||
if (config.content.files.length === 0) {
|
||||
_log.default.warn("content-problems", [
|
||||
"The `content` option in your Tailwind CSS configuration is missing or empty.",
|
||||
"Configure your content sources or your generated CSS will be missing styles.",
|
||||
"https://tailwindcss.com/docs/content-configuration"
|
||||
]);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fieldA.title, fieldA.children.0.name, fieldA.children.0.id,fieldA.children.1.name, fieldA.children.1.employee.0.name,fieldA.children.1.employee.1.name, fieldA.address.0,fieldA.address.1, description
|
||||
Food Factory, Oscar, 0023, Tikka, Tim, Joe, 3 Lame Road, Grantstown, A fresh new food factory
|
||||
Kindom Garden, Ceil, 54, Pillow, Amst, Tom, 24 Shaker Street, HelloTown, Awesome castle
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Checks `value` to determine whether a default value should be returned in
|
||||
* its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
|
||||
* or `undefined`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.14.0
|
||||
* @category Util
|
||||
* @param {*} value The value to check.
|
||||
* @param {*} defaultValue The default value.
|
||||
* @returns {*} Returns the resolved value.
|
||||
* @example
|
||||
*
|
||||
* _.defaultTo(1, 10);
|
||||
* // => 1
|
||||
*
|
||||
* _.defaultTo(undefined, 10);
|
||||
* // => 10
|
||||
*/
|
||||
function defaultTo(value, defaultValue) {
|
||||
return (value == null || value !== value) ? defaultValue : value;
|
||||
}
|
||||
|
||||
module.exports = defaultTo;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mergeMapTo.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/mergeMapTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI9E,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,CAAC,OAAO,CAAC,EAC3D,eAAe,EAAE,CAAC,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,OAAO,CAAC,EACjE,eAAe,EAAE,CAAC,EAClB,cAAc,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,EAC5G,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1,16 @@
|
||||
export declare function width(
|
||||
width: string | number,
|
||||
containerWidth?: number,
|
||||
): number;
|
||||
export declare function px(width: number): string;
|
||||
/**
|
||||
* Accepts a ShadowTable and tries to find the clientWidth
|
||||
* that is already rendered on the web browser
|
||||
*
|
||||
* @param shadowTable
|
||||
* @param columnId
|
||||
*/
|
||||
export declare function getWidth(
|
||||
shadowTable: Element,
|
||||
columnId: string,
|
||||
): number;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('zipObject', require('../zipObject'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,18 @@
|
||||
export default class Search {
|
||||
globalSearch;
|
||||
constructor(context) {
|
||||
this.globalSearch = context.globalSearch;
|
||||
}
|
||||
set(value, scope = null) {
|
||||
this.globalSearch.update(store => {
|
||||
store = {
|
||||
value: value ?? '',
|
||||
scope: scope ?? null
|
||||
};
|
||||
return store;
|
||||
});
|
||||
}
|
||||
remove() {
|
||||
this.globalSearch.set({ value: null, scope: null });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { dirname, resolve } from 'path';
|
||||
import { readdirSync, statSync } from 'fs';
|
||||
|
||||
export default function (start, callback) {
|
||||
let dir = resolve('.', start);
|
||||
let tmp, stats = statSync(dir);
|
||||
|
||||
if (!stats.isDirectory()) {
|
||||
dir = dirname(dir);
|
||||
}
|
||||
|
||||
while (true) {
|
||||
tmp = callback(dir, readdirSync(dir));
|
||||
if (tmp) return resolve(dir, tmp);
|
||||
dir = dirname(tmp = dir);
|
||||
if (tmp === dir) break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var homedir = require('../lib/homedir');
|
||||
var path = require('path');
|
||||
|
||||
var test = require('tape');
|
||||
var mkdirp = require('mkdirp');
|
||||
var rimraf = require('rimraf');
|
||||
var mv = require('mv');
|
||||
var copyDir = require('copy-dir');
|
||||
var tmp = require('tmp');
|
||||
|
||||
var HOME = homedir();
|
||||
|
||||
var hnm = path.join(HOME, '.node_modules');
|
||||
var hnl = path.join(HOME, '.node_libraries');
|
||||
|
||||
var resolve = require('../async');
|
||||
|
||||
function makeDir(t, dir, cb) {
|
||||
mkdirp(dir, function (err) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else {
|
||||
t.teardown(function cleanup() {
|
||||
rimraf.sync(dir);
|
||||
});
|
||||
cb();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function makeTempDir(t, dir, cb) {
|
||||
if (fs.existsSync(dir)) {
|
||||
var tmpResult = tmp.dirSync();
|
||||
t.teardown(tmpResult.removeCallback);
|
||||
var backup = path.join(tmpResult.name, path.basename(dir));
|
||||
mv(dir, backup, function (err) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else {
|
||||
t.teardown(function () {
|
||||
mv(backup, dir, cb);
|
||||
});
|
||||
makeDir(t, dir, cb);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
makeDir(t, dir, cb);
|
||||
}
|
||||
}
|
||||
|
||||
test('homedir module paths', function (t) {
|
||||
t.plan(7);
|
||||
|
||||
makeTempDir(t, hnm, function (err) {
|
||||
t.error(err, 'no error with HNM temp dir');
|
||||
if (err) {
|
||||
return t.end();
|
||||
}
|
||||
|
||||
var bazHNMDir = path.join(hnm, 'baz');
|
||||
var dotMainDir = path.join(hnm, 'dot_main');
|
||||
copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNMDir);
|
||||
copyDir.sync(path.join(__dirname, 'resolver/dot_main'), dotMainDir);
|
||||
|
||||
var bazPkg = { name: 'baz', main: 'quux.js' };
|
||||
var dotMainPkg = { main: 'index' };
|
||||
|
||||
var bazHNMmain = path.join(bazHNMDir, 'quux.js');
|
||||
t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`');
|
||||
var dotMainMain = path.join(dotMainDir, 'index.js');
|
||||
t.equal(require.resolve('dot_main'), dotMainMain, 'sanity check: require.resolve finds `dot_main`');
|
||||
|
||||
makeTempDir(t, hnl, function (err) {
|
||||
t.error(err, 'no error with HNL temp dir');
|
||||
if (err) {
|
||||
return t.end();
|
||||
}
|
||||
var bazHNLDir = path.join(hnl, 'baz');
|
||||
copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNLDir);
|
||||
|
||||
var dotSlashMainDir = path.join(hnl, 'dot_slash_main');
|
||||
var dotSlashMainMain = path.join(dotSlashMainDir, 'index.js');
|
||||
var dotSlashMainPkg = { main: 'index' };
|
||||
copyDir.sync(path.join(__dirname, 'resolver/dot_slash_main'), dotSlashMainDir);
|
||||
|
||||
t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`');
|
||||
t.equal(require.resolve('dot_slash_main'), dotSlashMainMain, 'sanity check: require.resolve finds HNL `dot_slash_main`');
|
||||
|
||||
t.test('with temp dirs', function (st) {
|
||||
st.plan(3);
|
||||
|
||||
st.test('just in `$HOME/.node_modules`', function (s2t) {
|
||||
s2t.plan(3);
|
||||
|
||||
resolve('dot_main', function (err, res, pkg) {
|
||||
s2t.error(err, 'no error resolving `dot_main`');
|
||||
s2t.equal(res, dotMainMain, '`dot_main` resolves in `$HOME/.node_modules`');
|
||||
s2t.deepEqual(pkg, dotMainPkg);
|
||||
});
|
||||
});
|
||||
|
||||
st.test('just in `$HOME/.node_libraries`', function (s2t) {
|
||||
s2t.plan(3);
|
||||
|
||||
resolve('dot_slash_main', function (err, res, pkg) {
|
||||
s2t.error(err, 'no error resolving `dot_slash_main`');
|
||||
s2t.equal(res, dotSlashMainMain, '`dot_slash_main` resolves in `$HOME/.node_libraries`');
|
||||
s2t.deepEqual(pkg, dotSlashMainPkg);
|
||||
});
|
||||
});
|
||||
|
||||
st.test('in `$HOME/.node_libraries` and `$HOME/.node_modules`', function (s2t) {
|
||||
s2t.plan(3);
|
||||
|
||||
resolve('baz', function (err, res, pkg) {
|
||||
s2t.error(err, 'no error resolving `baz`');
|
||||
s2t.equal(res, bazHNMmain, '`baz` resolves in `$HOME/.node_modules` when in both');
|
||||
s2t.deepEqual(pkg, bazPkg);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
RegExp.prototype.flags <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![Build Status][travis-svg]][travis-url]
|
||||
[![dependency status][deps-svg]][deps-url]
|
||||
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
[![browser support][testling-svg]][testling-url]
|
||||
|
||||
An ES6 spec-compliant `RegExp.prototype.flags` shim. Invoke its "shim" method to shim RegExp.prototype.flags if it is unavailable.
|
||||
*Note*: `RegExp#flags` requires a true ES5 environment - specifically, one with ES5 getters.
|
||||
|
||||
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES5-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.flags).
|
||||
|
||||
Most common usage:
|
||||
```js
|
||||
var flags = require('regexp.prototype.flags');
|
||||
|
||||
assert(flags(/a/) === '');
|
||||
assert(flags(new RegExp('a') === '');
|
||||
assert(flags(/a/mig) === 'gim');
|
||||
assert(flags(new RegExp('a', 'mig')) === 'gim');
|
||||
|
||||
if (!RegExp.prototype.flags) {
|
||||
flags.shim();
|
||||
}
|
||||
|
||||
assert(flags(/a/) === /a/.flags);
|
||||
assert(flags(new RegExp('a') === new RegExp('a').flags);
|
||||
assert(flags(/a/mig) === /a/mig.flags);
|
||||
assert(flags(new RegExp('a', 'mig')) === new RegExp('a', 'mig').flags);
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.com/package/regexp.prototype.flags
|
||||
[npm-version-svg]: http://versionbadg.es/es-shims/RegExp.prototype.flags.svg
|
||||
[travis-svg]: https://travis-ci.org/es-shims/RegExp.prototype.flags.svg
|
||||
[travis-url]: https://travis-ci.org/es-shims/RegExp.prototype.flags
|
||||
[deps-svg]: https://david-dm.org/es-shims/RegExp.prototype.flags.svg
|
||||
[deps-url]: https://david-dm.org/es-shims/RegExp.prototype.flags
|
||||
[dev-deps-svg]: https://david-dm.org/es-shims/RegExp.prototype.flags/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/es-shims/RegExp.prototype.flags#info=devDependencies
|
||||
[testling-svg]: https://ci.testling.com/es-shims/RegExp.prototype.flags.png
|
||||
[testling-url]: https://ci.testling.com/es-shims/RegExp.prototype.flags
|
||||
[npm-badge-png]: https://nodei.co/npm/regexp.prototype.flags.png?downloads=true&stars=true
|
||||
[license-image]: http://img.shields.io/npm/l/regexp.prototype.flags.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: http://img.shields.io/npm/dm/regexp.prototype.flags.svg
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=regexp.prototype.flags
|
||||
@@ -0,0 +1,44 @@
|
||||
import assertString from './util/assertString';
|
||||
var macAddress48 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/;
|
||||
var macAddress48NoSeparators = /^([0-9a-fA-F]){12}$/;
|
||||
var macAddress48WithDots = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/;
|
||||
var macAddress64 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/;
|
||||
var macAddress64NoSeparators = /^([0-9a-fA-F]){16}$/;
|
||||
var macAddress64WithDots = /^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;
|
||||
export default function isMACAddress(str, options) {
|
||||
assertString(str);
|
||||
|
||||
if (options !== null && options !== void 0 && options.eui) {
|
||||
options.eui = String(options.eui);
|
||||
}
|
||||
/**
|
||||
* @deprecated `no_colons` TODO: remove it in the next major
|
||||
*/
|
||||
|
||||
|
||||
if (options !== null && options !== void 0 && options.no_colons || options !== null && options !== void 0 && options.no_separators) {
|
||||
if (options.eui === '48') {
|
||||
return macAddress48NoSeparators.test(str);
|
||||
}
|
||||
|
||||
if (options.eui === '64') {
|
||||
return macAddress64NoSeparators.test(str);
|
||||
}
|
||||
|
||||
return macAddress48NoSeparators.test(str) || macAddress64NoSeparators.test(str);
|
||||
}
|
||||
|
||||
if ((options === null || options === void 0 ? void 0 : options.eui) === '48') {
|
||||
return macAddress48.test(str) || macAddress48WithDots.test(str);
|
||||
}
|
||||
|
||||
if ((options === null || options === void 0 ? void 0 : options.eui) === '64') {
|
||||
return macAddress64.test(str) || macAddress64WithDots.test(str);
|
||||
}
|
||||
|
||||
return isMACAddress(str, {
|
||||
eui: '48'
|
||||
}) || isMACAddress(str, {
|
||||
eui: '64'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Thanks to Andrew Clover:
|
||||
// http://stackoverflow.com/questions/3561493
|
||||
// /is-there-a-regexp-escape-function-in-javascript
|
||||
|
||||
"use strict";
|
||||
|
||||
var re = /[-/\\^$*+?.()|[\]{}]/g;
|
||||
|
||||
module.exports = function (str) { return String(str).replace(re, "\\$&"); };
|
||||
@@ -0,0 +1,8 @@
|
||||
// Credit: http://www.2ality.com/2014/05/is-integer.html
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports = function (value) {
|
||||
if (typeof value !== "number") return false;
|
||||
return value % 1 === 0;
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, ensureRegExp = require("../../reg-exp/ensure");
|
||||
|
||||
describe("reg-exp/ensure", function () {
|
||||
it("Should return input value", function () {
|
||||
var value = /foo/;
|
||||
assert.equal(ensureRegExp(value), value);
|
||||
});
|
||||
it("Should crash on invalid value", function () {
|
||||
try {
|
||||
ensureRegExp(null);
|
||||
throw new Error("Unexpected");
|
||||
} catch (error) {
|
||||
assert.equal(error.name, "TypeError");
|
||||
assert(error.message.includes("is not a regular expression object"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,220 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
||||
const _arg = /*#__PURE__*/ _interopRequireDefault(require("arg"));
|
||||
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
||||
const _build = require("./build");
|
||||
const _help = require("./help");
|
||||
const _init = require("./init");
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isESM() {
|
||||
const pkgPath = _path.default.resolve("./package.json");
|
||||
try {
|
||||
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
||||
return pkg.type && pkg.type === "module";
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
let configs = isESM() ? {
|
||||
tailwind: "tailwind.config.cjs"
|
||||
} : {
|
||||
tailwind: "tailwind.config.js"
|
||||
};
|
||||
// ---
|
||||
function oneOf(...options) {
|
||||
return Object.assign((value = true)=>{
|
||||
for (let option of options){
|
||||
let parsed = option(value);
|
||||
if (parsed === value) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
throw new Error("...");
|
||||
}, {
|
||||
manualParsing: true
|
||||
});
|
||||
}
|
||||
let commands = {
|
||||
init: {
|
||||
run: _init.init,
|
||||
args: {
|
||||
"--full": {
|
||||
type: Boolean,
|
||||
description: `Initialize a full \`${configs.tailwind}\` file`
|
||||
},
|
||||
"-f": "--full"
|
||||
}
|
||||
},
|
||||
build: {
|
||||
run: _build.build,
|
||||
args: {
|
||||
"--input": {
|
||||
type: String,
|
||||
description: "Input file"
|
||||
},
|
||||
"--output": {
|
||||
type: String,
|
||||
description: "Output file"
|
||||
},
|
||||
"--watch": {
|
||||
type: oneOf(String, Boolean),
|
||||
description: "Watch for changes and rebuild as needed"
|
||||
},
|
||||
"--poll": {
|
||||
type: Boolean,
|
||||
description: "Use polling instead of filesystem events when watching"
|
||||
},
|
||||
"--content": {
|
||||
type: String,
|
||||
description: "Content paths to use for removing unused classes"
|
||||
},
|
||||
"--minify": {
|
||||
type: Boolean,
|
||||
description: "Minify the output"
|
||||
},
|
||||
"--config": {
|
||||
type: String,
|
||||
description: "Path to a custom config file"
|
||||
},
|
||||
"-c": "--config",
|
||||
"-i": "--input",
|
||||
"-o": "--output",
|
||||
"-m": "--minify",
|
||||
"-w": "--watch",
|
||||
"-p": "--poll"
|
||||
}
|
||||
}
|
||||
};
|
||||
let sharedFlags = {
|
||||
"--help": {
|
||||
type: Boolean,
|
||||
description: "Display usage information"
|
||||
},
|
||||
"-h": "--help"
|
||||
};
|
||||
if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
|
||||
(0, _help.help)({
|
||||
usage: [
|
||||
"tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
|
||||
"tailwindcss init [--full] [options...]"
|
||||
],
|
||||
commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
|
||||
options: {
|
||||
...commands.build.args,
|
||||
...sharedFlags
|
||||
}
|
||||
});
|
||||
process.exit(0);
|
||||
}
|
||||
let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
|
||||
if (commands[command] === undefined) {
|
||||
if (_fs.default.existsSync(_path.default.resolve(command))) {
|
||||
// TODO: Deprecate this in future versions
|
||||
// Check if non-existing command, might be a file.
|
||||
command = "build";
|
||||
} else {
|
||||
(0, _help.help)({
|
||||
message: `Invalid command: ${command}`,
|
||||
usage: [
|
||||
"tailwindcss <command> [options]"
|
||||
],
|
||||
commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
|
||||
options: sharedFlags
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
// Execute command
|
||||
let { args: flags , run } = commands[command];
|
||||
let args = (()=>{
|
||||
try {
|
||||
let result = (0, _arg.default)(Object.fromEntries(Object.entries({
|
||||
...flags,
|
||||
...sharedFlags
|
||||
}).filter(([_key, value])=>{
|
||||
var _value_type;
|
||||
return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
|
||||
}).map(([key, value])=>[
|
||||
key,
|
||||
typeof value === "object" ? value.type : value
|
||||
])), {
|
||||
permissive: true
|
||||
});
|
||||
// Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
|
||||
for(let i = result["_"].length - 1; i >= 0; --i){
|
||||
let flag = result["_"][i];
|
||||
if (!flag.startsWith("-")) continue;
|
||||
let [flagName, flagValue] = flag.split("=");
|
||||
let handler = flags[flagName];
|
||||
// Resolve flagName & handler
|
||||
while(typeof handler === "string"){
|
||||
flagName = handler;
|
||||
handler = flags[handler];
|
||||
}
|
||||
if (!handler) continue;
|
||||
let args = [];
|
||||
let offset = i + 1;
|
||||
// --flag value syntax was used so we need to pull `value` from `args`
|
||||
if (flagValue === undefined) {
|
||||
// Parse args for current flag
|
||||
while(result["_"][offset] && !result["_"][offset].startsWith("-")){
|
||||
args.push(result["_"][offset++]);
|
||||
}
|
||||
// Cleanup manually parsed flags + args
|
||||
result["_"].splice(i, 1 + args.length);
|
||||
// No args were provided, use default value defined in handler
|
||||
// One arg was provided, use that directly
|
||||
// Multiple args were provided so pass them all in an array
|
||||
flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args;
|
||||
} else {
|
||||
// Remove the whole flag from the args array
|
||||
result["_"].splice(i, 1);
|
||||
}
|
||||
// Set the resolved value in the `result` object
|
||||
result[flagName] = handler.type(flagValue, flagName);
|
||||
}
|
||||
// Ensure that the `command` is always the first argument in the `args`.
|
||||
// This is important so that we don't have to check if a default command
|
||||
// (build) was used or not from within each plugin.
|
||||
//
|
||||
// E.g.: tailwindcss input.css -> _: ['build', 'input.css']
|
||||
// E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
|
||||
if (result["_"][0] !== command) {
|
||||
result["_"].unshift(command);
|
||||
}
|
||||
return result;
|
||||
} catch (err) {
|
||||
if (err.code === "ARG_UNKNOWN_OPTION") {
|
||||
(0, _help.help)({
|
||||
message: err.message,
|
||||
usage: [
|
||||
"tailwindcss <command> [options]"
|
||||
],
|
||||
options: sharedFlags
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
})();
|
||||
if (args["--help"]) {
|
||||
(0, _help.help)({
|
||||
options: {
|
||||
...flags,
|
||||
...sharedFlags
|
||||
},
|
||||
usage: [
|
||||
`tailwindcss ${command} [options]`
|
||||
]
|
||||
});
|
||||
process.exit(0);
|
||||
}
|
||||
run(args, configs);
|
||||
@@ -0,0 +1,34 @@
|
||||
let OldValue = require('../old-value')
|
||||
let Value = require('../value')
|
||||
|
||||
class Pixelated extends Value {
|
||||
/**
|
||||
* Use non-standard name for WebKit and Firefox
|
||||
*/
|
||||
replace(string, prefix) {
|
||||
if (prefix === '-webkit-') {
|
||||
return string.replace(this.regexp(), '$1-webkit-optimize-contrast')
|
||||
}
|
||||
if (prefix === '-moz-') {
|
||||
return string.replace(this.regexp(), '$1-moz-crisp-edges')
|
||||
}
|
||||
return super.replace(string, prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Different name for WebKit and Firefox
|
||||
*/
|
||||
old(prefix) {
|
||||
if (prefix === '-webkit-') {
|
||||
return new OldValue(this.name, '-webkit-optimize-contrast')
|
||||
}
|
||||
if (prefix === '-moz-') {
|
||||
return new OldValue(this.name, '-moz-crisp-edges')
|
||||
}
|
||||
return super.old(prefix)
|
||||
}
|
||||
}
|
||||
|
||||
Pixelated.names = ['pixelated']
|
||||
|
||||
module.exports = Pixelated
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-lines-per-function": 0,
|
||||
"max-params": 0,
|
||||
"new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }],
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user