new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
var mergeAdjacent = require('./merge-adjacent');
|
||||
var mergeMediaQueries = require('./merge-media-queries');
|
||||
var mergeNonAdjacentByBody = require('./merge-non-adjacent-by-body');
|
||||
var mergeNonAdjacentBySelector = require('./merge-non-adjacent-by-selector');
|
||||
var reduceNonAdjacent = require('./reduce-non-adjacent');
|
||||
var removeDuplicateFontAtRules = require('./remove-duplicate-font-at-rules');
|
||||
var removeDuplicateMediaQueries = require('./remove-duplicate-media-queries');
|
||||
var removeDuplicates = require('./remove-duplicates');
|
||||
var removeUnusedAtRules = require('./remove-unused-at-rules');
|
||||
var restructure = require('./restructure');
|
||||
|
||||
var optimizeProperties = require('./properties/optimize');
|
||||
|
||||
var OptimizationLevel = require('../../options/optimization-level').OptimizationLevel;
|
||||
|
||||
var Token = require('../../tokenizer/token');
|
||||
|
||||
function removeEmpty(tokens) {
|
||||
for (var i = 0, l = tokens.length; i < l; i++) {
|
||||
var token = tokens[i];
|
||||
var isEmpty = false;
|
||||
|
||||
switch (token[0]) {
|
||||
case Token.RULE:
|
||||
isEmpty = token[1].length === 0 || token[2].length === 0;
|
||||
break;
|
||||
case Token.NESTED_BLOCK:
|
||||
removeEmpty(token[2]);
|
||||
isEmpty = token[2].length === 0;
|
||||
break;
|
||||
case Token.AT_RULE:
|
||||
isEmpty = token[1].length === 0;
|
||||
break;
|
||||
case Token.AT_RULE_BLOCK:
|
||||
isEmpty = token[2].length === 0;
|
||||
}
|
||||
|
||||
if (isEmpty) {
|
||||
tokens.splice(i, 1);
|
||||
i--;
|
||||
l--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function recursivelyOptimizeBlocks(tokens, context) {
|
||||
for (var i = 0, l = tokens.length; i < l; i++) {
|
||||
var token = tokens[i];
|
||||
|
||||
if (token[0] == Token.NESTED_BLOCK) {
|
||||
var isKeyframes = /@(-moz-|-o-|-webkit-)?keyframes/.test(token[1][0][1]);
|
||||
level2Optimize(token[2], context, !isKeyframes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function recursivelyOptimizeProperties(tokens, context) {
|
||||
for (var i = 0, l = tokens.length; i < l; i++) {
|
||||
var token = tokens[i];
|
||||
|
||||
switch (token[0]) {
|
||||
case Token.RULE:
|
||||
optimizeProperties(token[2], true, true, context);
|
||||
break;
|
||||
case Token.NESTED_BLOCK:
|
||||
recursivelyOptimizeProperties(token[2], context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function level2Optimize(tokens, context, withRestructuring) {
|
||||
var levelOptions = context.options.level[OptimizationLevel.Two];
|
||||
var reduced;
|
||||
var i;
|
||||
|
||||
recursivelyOptimizeBlocks(tokens, context);
|
||||
recursivelyOptimizeProperties(tokens, context);
|
||||
|
||||
if (levelOptions.removeDuplicateRules) {
|
||||
removeDuplicates(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.mergeAdjacentRules) {
|
||||
mergeAdjacent(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.reduceNonAdjacentRules) {
|
||||
reduceNonAdjacent(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.mergeNonAdjacentRules && levelOptions.mergeNonAdjacentRules != 'body') {
|
||||
mergeNonAdjacentBySelector(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.mergeNonAdjacentRules && levelOptions.mergeNonAdjacentRules != 'selector') {
|
||||
mergeNonAdjacentByBody(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.restructureRules && levelOptions.mergeAdjacentRules && withRestructuring) {
|
||||
restructure(tokens, context);
|
||||
mergeAdjacent(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.restructureRules && !levelOptions.mergeAdjacentRules && withRestructuring) {
|
||||
restructure(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.removeDuplicateFontRules) {
|
||||
removeDuplicateFontAtRules(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.removeDuplicateMediaBlocks) {
|
||||
removeDuplicateMediaQueries(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.removeUnusedAtRules) {
|
||||
removeUnusedAtRules(tokens, context);
|
||||
}
|
||||
|
||||
if (levelOptions.mergeMedia) {
|
||||
reduced = mergeMediaQueries(tokens, context);
|
||||
for (i = reduced.length - 1; i >= 0; i--) {
|
||||
level2Optimize(reduced[i][2], context, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (levelOptions.removeEmpty) {
|
||||
removeEmpty(tokens);
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
module.exports = level2Optimize;
|
||||
@@ -0,0 +1,60 @@
|
||||
'use strict'
|
||||
const Parser = require('./parser.js')
|
||||
const util = require('util')
|
||||
|
||||
const dump = _ => util.inspect(_, {colors: true, depth: 10, breakLength: Infinity})
|
||||
class DebugParser extends Parser {
|
||||
stateName (state) {
|
||||
// istanbul ignore next
|
||||
return (state.parser && state.parser.name) || state.name || ('anonymous')
|
||||
}
|
||||
runOne () {
|
||||
const callStack = this.stack.concat(this.state).map(_ => this.stateName(_)).join(' <- ')
|
||||
console.log('RUN', callStack, dump({line: this.line, col: this.col, char: this.char, ret: this.state.returned}))
|
||||
return super.runOne()
|
||||
}
|
||||
finish () {
|
||||
const obj = super.finish()
|
||||
// istanbul ignore if
|
||||
if (this.stack.length !== 0) {
|
||||
throw new Parser.Error('All states did not return by end of stream')
|
||||
}
|
||||
return obj
|
||||
}
|
||||
callStack () {
|
||||
const callStack = this.stack.map(_ => this.stateName(_)).join(' ').replace(/\S/g, ' ')
|
||||
return callStack ? callStack + ' ' : ''
|
||||
}
|
||||
next (fn) {
|
||||
console.log(' ', this.callStack(), 'NEXT', this.stateName(fn))
|
||||
return super.next(fn)
|
||||
}
|
||||
goto (fn) {
|
||||
console.log(' ', this.callStack(), 'GOTO', this.stateName(fn))
|
||||
super.next(fn)
|
||||
return false
|
||||
}
|
||||
call (fn, returnWith) {
|
||||
console.log(' ', this.callStack(), 'CALL', fn.name, returnWith ? '-> ' + returnWith.name : '')
|
||||
if (returnWith) super.next(returnWith)
|
||||
this.stack.push(this.state)
|
||||
this.state = {parser: fn, buf: '', returned: null}
|
||||
}
|
||||
callNow (fn, returnWith) {
|
||||
console.log(' ', this.callStack(), 'CALLNOW', fn.name, returnWith ? '-> ' + returnWith.name : '')
|
||||
if (returnWith) super.next(returnWith)
|
||||
this.stack.push(this.state)
|
||||
this.state = {parser: fn, buf: '', returned: null}
|
||||
return false
|
||||
}
|
||||
return (value) {
|
||||
console.log(' ', this.callStack(), 'RETURN')
|
||||
return super.return(value)
|
||||
}
|
||||
returnNow (value) {
|
||||
console.log(' ', this.callStack(), 'RETURNNOW')
|
||||
super.return(value)
|
||||
return false
|
||||
}
|
||||
}
|
||||
module.exports = DebugParser
|
||||
@@ -0,0 +1,31 @@
|
||||
var baseFlatten = require('./_baseFlatten'),
|
||||
map = require('./map');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var INFINITY = 1 / 0;
|
||||
|
||||
/**
|
||||
* This method is like `_.flatMap` except that it recursively flattens the
|
||||
* mapped results.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.7.0
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
*
|
||||
* function duplicate(n) {
|
||||
* return [[[n, n]]];
|
||||
* }
|
||||
*
|
||||
* _.flatMapDeep([1, 2], duplicate);
|
||||
* // => [1, 1, 2, 2]
|
||||
*/
|
||||
function flatMapDeep(collection, iteratee) {
|
||||
return baseFlatten(map(collection, iteratee), INFINITY);
|
||||
}
|
||||
|
||||
module.exports = flatMapDeep;
|
||||
@@ -0,0 +1,19 @@
|
||||
import { normalizeScreens } from '../util/normalizeScreens'
|
||||
import buildMediaQuery from '../util/buildMediaQuery'
|
||||
|
||||
export default function ({ tailwindConfig: { theme } }) {
|
||||
return function (css) {
|
||||
css.walkAtRules('screen', (atRule) => {
|
||||
let screen = atRule.params
|
||||
let screens = normalizeScreens(theme.screens)
|
||||
let screenDefinition = screens.find(({ name }) => name === screen)
|
||||
|
||||
if (!screenDefinition) {
|
||||
throw atRule.error(`No \`${screen}\` screen found.`)
|
||||
}
|
||||
|
||||
atRule.name = 'media'
|
||||
atRule.params = buildMediaQuery(screenDefinition)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import {Except} from './except';
|
||||
import {Simplify} from './simplify';
|
||||
|
||||
/**
|
||||
Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly<T>`.
|
||||
|
||||
This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are mutable.
|
||||
|
||||
@example
|
||||
```
|
||||
import {Mutable} from 'type-fest';
|
||||
|
||||
type Foo = {
|
||||
readonly a: number;
|
||||
readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected.
|
||||
readonly c: boolean;
|
||||
};
|
||||
|
||||
const mutableFoo: Mutable<Foo> = {a: 1, b: ['2'], c: true};
|
||||
mutableFoo.a = 3;
|
||||
mutableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type.
|
||||
mutableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly.
|
||||
|
||||
type SomeMutable = Mutable<Foo, 'b' | 'c'>;
|
||||
// type SomeMutable = {
|
||||
// readonly a: number;
|
||||
// b: readonly string[]; // It's now mutable. The type of the property remains unaffected.
|
||||
// c: boolean; // It's now mutable.
|
||||
// }
|
||||
```
|
||||
|
||||
@category Utilities
|
||||
*/
|
||||
export type Mutable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
|
||||
Simplify<
|
||||
// Pick just the keys that are not mutable from the base type.
|
||||
Except<BaseType, Keys> &
|
||||
// Pick the keys that should be mutable from the base type and make them mutable by removing the `readonly` modifier from the key.
|
||||
{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
|
||||
>;
|
||||
@@ -0,0 +1,107 @@
|
||||
const readWasm = require("../lib/read-wasm");
|
||||
|
||||
/**
|
||||
* Provide the JIT with a nice shape / hidden class.
|
||||
*/
|
||||
function Mapping() {
|
||||
this.generatedLine = 0;
|
||||
this.generatedColumn = 0;
|
||||
this.lastGeneratedColumn = null;
|
||||
this.source = null;
|
||||
this.originalLine = null;
|
||||
this.originalColumn = null;
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
let cachedWasm = null;
|
||||
|
||||
module.exports = function wasm() {
|
||||
if (cachedWasm) {
|
||||
return cachedWasm;
|
||||
}
|
||||
|
||||
const callbackStack = [];
|
||||
|
||||
cachedWasm = readWasm().then(buffer => {
|
||||
return WebAssembly.instantiate(buffer, {
|
||||
env: {
|
||||
mapping_callback(
|
||||
generatedLine,
|
||||
generatedColumn,
|
||||
|
||||
hasLastGeneratedColumn,
|
||||
lastGeneratedColumn,
|
||||
|
||||
hasOriginal,
|
||||
source,
|
||||
originalLine,
|
||||
originalColumn,
|
||||
|
||||
hasName,
|
||||
name
|
||||
) {
|
||||
const mapping = new Mapping();
|
||||
// JS uses 1-based line numbers, wasm uses 0-based.
|
||||
mapping.generatedLine = generatedLine + 1;
|
||||
mapping.generatedColumn = generatedColumn;
|
||||
|
||||
if (hasLastGeneratedColumn) {
|
||||
// JS uses inclusive last generated column, wasm uses exclusive.
|
||||
mapping.lastGeneratedColumn = lastGeneratedColumn - 1;
|
||||
}
|
||||
|
||||
if (hasOriginal) {
|
||||
mapping.source = source;
|
||||
// JS uses 1-based line numbers, wasm uses 0-based.
|
||||
mapping.originalLine = originalLine + 1;
|
||||
mapping.originalColumn = originalColumn;
|
||||
|
||||
if (hasName) {
|
||||
mapping.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
callbackStack[callbackStack.length - 1](mapping);
|
||||
},
|
||||
|
||||
start_all_generated_locations_for() { console.time("all_generated_locations_for"); },
|
||||
end_all_generated_locations_for() { console.timeEnd("all_generated_locations_for"); },
|
||||
|
||||
start_compute_column_spans() { console.time("compute_column_spans"); },
|
||||
end_compute_column_spans() { console.timeEnd("compute_column_spans"); },
|
||||
|
||||
start_generated_location_for() { console.time("generated_location_for"); },
|
||||
end_generated_location_for() { console.timeEnd("generated_location_for"); },
|
||||
|
||||
start_original_location_for() { console.time("original_location_for"); },
|
||||
end_original_location_for() { console.timeEnd("original_location_for"); },
|
||||
|
||||
start_parse_mappings() { console.time("parse_mappings"); },
|
||||
end_parse_mappings() { console.timeEnd("parse_mappings"); },
|
||||
|
||||
start_sort_by_generated_location() { console.time("sort_by_generated_location"); },
|
||||
end_sort_by_generated_location() { console.timeEnd("sort_by_generated_location"); },
|
||||
|
||||
start_sort_by_original_location() { console.time("sort_by_original_location"); },
|
||||
end_sort_by_original_location() { console.timeEnd("sort_by_original_location"); },
|
||||
}
|
||||
});
|
||||
}).then(Wasm => {
|
||||
return {
|
||||
exports: Wasm.instance.exports,
|
||||
withMappingCallback: (mappingCallback, f) => {
|
||||
callbackStack.push(mappingCallback);
|
||||
try {
|
||||
f();
|
||||
} finally {
|
||||
callbackStack.pop();
|
||||
}
|
||||
}
|
||||
};
|
||||
}).then(null, e => {
|
||||
cachedWasm = null;
|
||||
throw e;
|
||||
});
|
||||
|
||||
return cachedWasm;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import { isFunction } from './isFunction';
|
||||
|
||||
export function isAsyncIterable<T>(obj: any): obj is AsyncIterable<T> {
|
||||
return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"debug","version":"4.3.4","files":{"LICENSE":{"checkedAt":1678883669472,"integrity":"sha512-NInsN4NAPaqJnsW9idjSOnOGqyzqYkPMzLI9LNemnHNfKFLWamw1cdIqe/ckgjFzyMEVxOSbkSAzFjgUXj3AWA==","mode":420,"size":1139},"src/browser.js":{"checkedAt":1678883669472,"integrity":"sha512-aQXtXyHAOruHIjK4NWzUDvOo0JXiuUQElWP4ewBqTUgNe09bWABfXVJlq4oI/w44Yf40LaBg5bc+RUcjkdPUew==","mode":420,"size":6010},"src/common.js":{"checkedAt":1678883669472,"integrity":"sha512-V3XUybgj3JUUSIoo8r/LqZChPe/fxZkuH/7JFcpebsK6h73bHLf0t3I0WhS0BB+Yp097zJ2b4qM3HjACwzu+vA==","mode":420,"size":6289},"src/index.js":{"checkedAt":1678883669472,"integrity":"sha512-T6qHTZ2GL/ySFSh0LE8f6KmyKjWHYPbpP87xOFI1dTKagBzpZZ7Y6WsCtz5YGz6Z2Rlz4imBs1j/teQxA6U2wg==","mode":420,"size":314},"src/node.js":{"checkedAt":1678883669472,"integrity":"sha512-MBe0cXEY9W+sEG3KoEauzzzGPDfmT0mDjlN5oTWDwpPznsWs5I+y2r6savSpZ/liGYEnM+rW82w/XI0TLXlZAA==","mode":420,"size":4685},"package.json":{"checkedAt":1678883669472,"integrity":"sha512-oBfSGh7LFZBlvDK5SzjeA7OMEESLhfiL/hSYsUQyCITWEqhoudsZLWrPBB+I2kFflT2d2FQe4p5AU+JGPdVHkQ==","mode":420,"size":1419},"README.md":{"checkedAt":1678883669473,"integrity":"sha512-3YIi4u2YcgxM6QGNDEZDGclGgiTZAuYcK0HJeKaA653AHSCU2FE4aPplP3qbI1rZ+aom5tEqI5nVx+Q4TwqjgQ==","mode":420,"size":22496}}}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
const utils = require('./utils');
|
||||
|
||||
module.exports = (ast, options = {}) => {
|
||||
let stringify = (node, parent = {}) => {
|
||||
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
||||
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
||||
let output = '';
|
||||
|
||||
if (node.value) {
|
||||
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
||||
return '\\' + node.value;
|
||||
}
|
||||
return node.value;
|
||||
}
|
||||
|
||||
if (node.value) {
|
||||
return node.value;
|
||||
}
|
||||
|
||||
if (node.nodes) {
|
||||
for (let child of node.nodes) {
|
||||
output += stringify(child);
|
||||
}
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
return stringify(ast);
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"joinAllInternals.js","sourceRoot":"","sources":["../../../../src/internal/operators/joinAllInternals.ts"],"names":[],"mappings":";;;AAEA,6CAA4C;AAC5C,6DAA4D;AAC5D,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AAYpC,SAAgB,gBAAgB,CAAO,MAAwD,EAAE,OAA+B;IAC9H,OAAO,WAAI,CAGT,iBAAO,EAAgE,EAEvE,mBAAQ,CAAC,UAAC,OAAO,IAAK,OAAA,MAAM,CAAC,OAAO,CAAC,EAAf,CAAe,CAAC,EAEtC,OAAO,CAAC,CAAC,CAAC,mCAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,mBAAgB,CACxD,CAAC;AACJ,CAAC;AAVD,4CAUC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getPropertyByPath.js","names":["getPropertyByPath","source","path","Object","prototype","hasOwnProperty","call","parsedPath","split","reduce","previous","key","undefined"],"sources":["../src/getPropertyByPath.ts"],"sourcesContent":["// Resolves property names or property paths defined with period-delimited\n// strings or arrays of strings. Property names that are found on the source\n// object are used directly (even if they include a period).\n// Nested property names that include periods, within a path, are only\n// understood in array paths.\nfunction getPropertyByPath(\n source: { [key: string]: unknown },\n path: string | Array<string>,\n): unknown {\n if (\n typeof path === 'string' &&\n Object.prototype.hasOwnProperty.call(source, path)\n ) {\n return source[path];\n }\n\n const parsedPath = typeof path === 'string' ? path.split('.') : path;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return parsedPath.reduce((previous: any, key): unknown => {\n if (previous === undefined) {\n return previous;\n }\n return previous[key];\n }, source);\n}\n\nexport { getPropertyByPath };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,CACEC,MADF,EAEEC,IAFF,EAGW;EACT,IACE,OAAOA,IAAP,KAAgB,QAAhB,IACAC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCL,MAArC,EAA6CC,IAA7C,CAFF,EAGE;IACA,OAAOD,MAAM,CAACC,IAAD,CAAb;EACD;;EAED,MAAMK,UAAU,GAAG,OAAOL,IAAP,KAAgB,QAAhB,GAA2BA,IAAI,CAACM,KAAL,CAAW,GAAX,CAA3B,GAA6CN,IAAhE,CARS,CAST;;EACA,OAAOK,UAAU,CAACE,MAAX,CAAkB,CAACC,QAAD,EAAgBC,GAAhB,KAAiC;IACxD,IAAID,QAAQ,KAAKE,SAAjB,EAA4B;MAC1B,OAAOF,QAAP;IACD;;IACD,OAAOA,QAAQ,CAACC,GAAD,CAAf;EACD,CALM,EAKJV,MALI,CAAP;AAMD"}
|
||||
@@ -0,0 +1,40 @@
|
||||
var mergeIntoShorthands = require('./merge-into-shorthands');
|
||||
var overrideProperties = require('./override-properties');
|
||||
var populateComponents = require('./populate-components');
|
||||
|
||||
var restoreWithComponents = require('../restore-with-components');
|
||||
|
||||
var wrapForOptimizing = require('../../wrap-for-optimizing').all;
|
||||
var removeUnused = require('../../remove-unused');
|
||||
var restoreFromOptimizing = require('../../restore-from-optimizing');
|
||||
|
||||
var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
|
||||
|
||||
function optimizeProperties(properties, withOverriding, withMerging, context) {
|
||||
var levelOptions = context.options.level[OptimizationLevel.Two];
|
||||
var _properties = wrapForOptimizing(properties, false, levelOptions.skipProperties);
|
||||
var _property;
|
||||
var i, l;
|
||||
|
||||
populateComponents(_properties, context.validator, context.warnings);
|
||||
|
||||
for (i = 0, l = _properties.length; i < l; i++) {
|
||||
_property = _properties[i];
|
||||
if (_property.block) {
|
||||
optimizeProperties(_property.value[0][1], withOverriding, withMerging, context);
|
||||
}
|
||||
}
|
||||
|
||||
if (withMerging && levelOptions.mergeIntoShorthands) {
|
||||
mergeIntoShorthands(_properties, context.validator);
|
||||
}
|
||||
|
||||
if (withOverriding && levelOptions.overrideProperties) {
|
||||
overrideProperties(_properties, withMerging, context.options.compatibility, context.validator);
|
||||
}
|
||||
|
||||
restoreFromOptimizing(_properties, restoreWithComponents);
|
||||
removeUnused(_properties);
|
||||
}
|
||||
|
||||
module.exports = optimizeProperties;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"110":0.11064,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 3.5 3.6"},D:{"109":1.46045,"110":0.11064,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 111 112 113"},F:{_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},B:{"90":0.22866,"92":0.22866,"109":0.11064,"110":1.12853,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108"},E:{"4":0,_:"0 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.5 15.6 16.0 16.4","15.1":22.40829,"15.2-15.3":27.8149,"15.4":1.46045,"16.1":0.11064,"16.2":1.12853,"16.3":0.67859},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0,"11.0-11.2":0,"11.3-11.4":0,"12.0-12.1":0,"12.2-12.5":0,"13.0-13.1":0,"13.2":0,"13.3":0,"13.4-13.7":0,"14.0-14.4":0,"14.5-14.8":0,"15.0-15.1":1.34775,"15.2-15.3":1.796,"15.4":1.45906,"15.5":0,"15.6":0,"16.0":1.01081,"16.1":3.25506,"16.2":1.01081,"16.3":5.16388,"16.4":0},P:{"4":0.1133,"20":0.78283,"5.0-5.4":0.09172,"6.2-6.4":0.09172,"7.2-7.4":0.0824,"8.2":0.01016,"9.2":0.0103,"10.1":0.01019,"11.1-11.2":0.0412,"12.0":0.07134,"13.0":0.34105,"14.0":0.0515,"15.0":0.0309,"16.0":0.0927,"17.0":0.0824,"18.0":0.1339,"19.0":0.45139},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},N:{"10":0.03712,"11":0.07423},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0},H:{"0":0},L:{"0":10.40678},R:{_:"0"},M:{"0":0},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,32 @@
|
||||
# os-tmpdir [](https://travis-ci.org/sindresorhus/os-tmpdir)
|
||||
|
||||
> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com)
|
||||
|
||||
Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save os-tmpdir
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const osTmpdir = require('os-tmpdir');
|
||||
|
||||
osTmpdir();
|
||||
//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
// var modulo = require('./modulo');
|
||||
var $floor = Math.floor;
|
||||
|
||||
// http://262.ecma-international.org/5.1/#sec-5.2
|
||||
|
||||
module.exports = function floor(x) {
|
||||
// return x - modulo(x, 1);
|
||||
return $floor(x);
|
||||
};
|
||||
@@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sha224 = exports.sha256 = void 0;
|
||||
const _sha2_js_1 = require("./_sha2.js");
|
||||
const utils_js_1 = require("./utils.js");
|
||||
// Choice: a ? b : c
|
||||
const Chi = (a, b, c) => (a & b) ^ (~a & c);
|
||||
// Majority function, true if any two inpust is true
|
||||
const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);
|
||||
// Round constants:
|
||||
// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)
|
||||
// prettier-ignore
|
||||
const SHA256_K = new Uint32Array([
|
||||
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
||||
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
||||
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
||||
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
||||
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
||||
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
||||
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
||||
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
||||
]);
|
||||
// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):
|
||||
// prettier-ignore
|
||||
const IV = new Uint32Array([
|
||||
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
|
||||
]);
|
||||
// Temporary buffer, not used to store anything between runs
|
||||
// Named this way because it matches specification.
|
||||
const SHA256_W = new Uint32Array(64);
|
||||
class SHA256 extends _sha2_js_1.SHA2 {
|
||||
constructor() {
|
||||
super(64, 32, 8, false);
|
||||
// We cannot use array here since array allows indexing by variable
|
||||
// which means optimizer/compiler cannot use registers.
|
||||
this.A = IV[0] | 0;
|
||||
this.B = IV[1] | 0;
|
||||
this.C = IV[2] | 0;
|
||||
this.D = IV[3] | 0;
|
||||
this.E = IV[4] | 0;
|
||||
this.F = IV[5] | 0;
|
||||
this.G = IV[6] | 0;
|
||||
this.H = IV[7] | 0;
|
||||
}
|
||||
get() {
|
||||
const { A, B, C, D, E, F, G, H } = this;
|
||||
return [A, B, C, D, E, F, G, H];
|
||||
}
|
||||
// prettier-ignore
|
||||
set(A, B, C, D, E, F, G, H) {
|
||||
this.A = A | 0;
|
||||
this.B = B | 0;
|
||||
this.C = C | 0;
|
||||
this.D = D | 0;
|
||||
this.E = E | 0;
|
||||
this.F = F | 0;
|
||||
this.G = G | 0;
|
||||
this.H = H | 0;
|
||||
}
|
||||
process(view, offset) {
|
||||
// Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array
|
||||
for (let i = 0; i < 16; i++, offset += 4)
|
||||
SHA256_W[i] = view.getUint32(offset, false);
|
||||
for (let i = 16; i < 64; i++) {
|
||||
const W15 = SHA256_W[i - 15];
|
||||
const W2 = SHA256_W[i - 2];
|
||||
const s0 = (0, utils_js_1.rotr)(W15, 7) ^ (0, utils_js_1.rotr)(W15, 18) ^ (W15 >>> 3);
|
||||
const s1 = (0, utils_js_1.rotr)(W2, 17) ^ (0, utils_js_1.rotr)(W2, 19) ^ (W2 >>> 10);
|
||||
SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;
|
||||
}
|
||||
// Compression function main loop, 64 rounds
|
||||
let { A, B, C, D, E, F, G, H } = this;
|
||||
for (let i = 0; i < 64; i++) {
|
||||
const sigma1 = (0, utils_js_1.rotr)(E, 6) ^ (0, utils_js_1.rotr)(E, 11) ^ (0, utils_js_1.rotr)(E, 25);
|
||||
const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
|
||||
const sigma0 = (0, utils_js_1.rotr)(A, 2) ^ (0, utils_js_1.rotr)(A, 13) ^ (0, utils_js_1.rotr)(A, 22);
|
||||
const T2 = (sigma0 + Maj(A, B, C)) | 0;
|
||||
H = G;
|
||||
G = F;
|
||||
F = E;
|
||||
E = (D + T1) | 0;
|
||||
D = C;
|
||||
C = B;
|
||||
B = A;
|
||||
A = (T1 + T2) | 0;
|
||||
}
|
||||
// Add the compressed chunk to the current hash value
|
||||
A = (A + this.A) | 0;
|
||||
B = (B + this.B) | 0;
|
||||
C = (C + this.C) | 0;
|
||||
D = (D + this.D) | 0;
|
||||
E = (E + this.E) | 0;
|
||||
F = (F + this.F) | 0;
|
||||
G = (G + this.G) | 0;
|
||||
H = (H + this.H) | 0;
|
||||
this.set(A, B, C, D, E, F, G, H);
|
||||
}
|
||||
roundClean() {
|
||||
SHA256_W.fill(0);
|
||||
}
|
||||
destroy() {
|
||||
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
||||
this.buffer.fill(0);
|
||||
}
|
||||
}
|
||||
// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf
|
||||
class SHA224 extends SHA256 {
|
||||
constructor() {
|
||||
super();
|
||||
this.A = 0xc1059ed8 | 0;
|
||||
this.B = 0x367cd507 | 0;
|
||||
this.C = 0x3070dd17 | 0;
|
||||
this.D = 0xf70e5939 | 0;
|
||||
this.E = 0xffc00b31 | 0;
|
||||
this.F = 0x68581511 | 0;
|
||||
this.G = 0x64f98fa7 | 0;
|
||||
this.H = 0xbefa4fa4 | 0;
|
||||
this.outputLen = 28;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* SHA2-256 hash function
|
||||
* @param message - data that would be hashed
|
||||
*/
|
||||
exports.sha256 = (0, utils_js_1.wrapConstructor)(() => new SHA256());
|
||||
exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA224());
|
||||
//# sourceMappingURL=sha256.js.map
|
||||
@@ -0,0 +1,82 @@
|
||||
1.1.5 / 2021-10-01
|
||||
=================
|
||||
* [Deps] update `es-abstract`
|
||||
* [meta] use `prepublishOnly` script for npm 7+
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `tape`
|
||||
* [actions] update workflows
|
||||
* [actions] use `node/install` instead of `node/run`; use `codecov` action
|
||||
|
||||
1.1.4 / 2021-02-22
|
||||
=================
|
||||
* [readme] remove travis badge
|
||||
* [meta] remove audit-level
|
||||
* [meta] gitignore coverage output
|
||||
* [meta] do not publish github action workflow files
|
||||
* [Deps] update `call-bind`, `es-abstract`, `functions-have-names`
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-strict-mode`, `tape`
|
||||
* [Tests] increase coverage
|
||||
* [actions] update workflows
|
||||
|
||||
1.1.3 / 2020-11-27
|
||||
=================
|
||||
* [Deps] update `es-abstract`, `functions-have-names`; use `call-bind` where applicable
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `make-arrow-function`, `make-generator-function`; add `aud`, `make-async-function`
|
||||
* [actions] add "Allow Edits" workflow
|
||||
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
|
||||
* [Tests] migrate tests to Github Actions
|
||||
* [Tests] run `nyc` on all tests
|
||||
* [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner
|
||||
* [Tests] only audit prod deps
|
||||
|
||||
1.1.2 / 2019-12-14
|
||||
=================
|
||||
* [Refactor] use `es-abstract`
|
||||
* [Deps] update `functions-have-names`
|
||||
* [meta] add `funding` field
|
||||
* [meta] fix repo capitalization
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
|
||||
* [Tests] use shared travis-ci configs
|
||||
* [actions] add automatic rebasing / merge commit blocking
|
||||
|
||||
1.1.1 / 2019-07-24
|
||||
=================
|
||||
* [Refactor] use `functions-have-names`
|
||||
* [meta] clean up package.json scripts
|
||||
* [meta] update links
|
||||
* [meta] create FUNDING.yml
|
||||
* [Deps] update `is-callable`, `define-properties`
|
||||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `covert`
|
||||
* [Tests] use `eccheck` over `editorconfig-tools`
|
||||
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
|
||||
* [Tests] up to `node` `v11.7`, `v10.15`, `v9.11`, `v8.15`, `v6.16`, `v4.9`
|
||||
* [Test] remove `jscs`
|
||||
|
||||
1.1.0 / 2017-12-31
|
||||
=================
|
||||
* [New] add `auto` entry point
|
||||
* [Deps] update `function-bind`
|
||||
* [Dev Deps] update `uglify-register`, `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `@es-shims/api`
|
||||
* [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS
|
||||
|
||||
1.0.3 / 2017-07-21
|
||||
=================
|
||||
* [Fix] be robust against function name mangling
|
||||
* [Refactor] move function name detection to separate file
|
||||
|
||||
1.0.2 / 2017-07-14
|
||||
=================
|
||||
* [Refactor] shim: Remove unnecessary `!functionsHaveNames` check
|
||||
|
||||
1.0.1 / 2017-07-11
|
||||
=================
|
||||
* [Fix] in IE 9-11, we must rely on `.call` being available (#13)
|
||||
* [Fix] ensure that `Function.prototype.name` does not erase the getter
|
||||
* [Deps] update `is-callable`
|
||||
* [Dev Deps] add `safe-publish-latest`
|
||||
* [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `@es-shims/api`
|
||||
* [Tests] up to `node` `v8.1`; `v7.10`, `v6.11`, `v4.8`; improve matrix; newer npm fails on older nodes
|
||||
* [Tests] use `Object` to avoid function name inference in node 7
|
||||
|
||||
1.0.0 / 2016-02-27
|
||||
=================
|
||||
* Initial release.
|
||||
@@ -0,0 +1,17 @@
|
||||
let Selector = require('../selector')
|
||||
|
||||
class PlaceholderShown extends Selector {
|
||||
/**
|
||||
* Return different selectors depend on prefix
|
||||
*/
|
||||
prefixed(prefix) {
|
||||
if (prefix === '-ms-') {
|
||||
return ':-ms-input-placeholder'
|
||||
}
|
||||
return `:${prefix}placeholder-shown`
|
||||
}
|
||||
}
|
||||
|
||||
PlaceholderShown.names = [':placeholder-shown']
|
||||
|
||||
module.exports = PlaceholderShown
|
||||
@@ -0,0 +1,52 @@
|
||||
define(['exports', 'module', './handlebars.runtime', './handlebars/compiler/ast', './handlebars/compiler/base', './handlebars/compiler/compiler', './handlebars/compiler/javascript-compiler', './handlebars/compiler/visitor', './handlebars/no-conflict'], function (exports, module, _handlebarsRuntime, _handlebarsCompilerAst, _handlebarsCompilerBase, _handlebarsCompilerCompiler, _handlebarsCompilerJavascriptCompiler, _handlebarsCompilerVisitor, _handlebarsNoConflict) {
|
||||
'use strict';
|
||||
|
||||
// istanbul ignore next
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _runtime = _interopRequireDefault(_handlebarsRuntime);
|
||||
|
||||
// Compiler imports
|
||||
|
||||
var _AST = _interopRequireDefault(_handlebarsCompilerAst);
|
||||
|
||||
var _JavaScriptCompiler = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
|
||||
|
||||
var _Visitor = _interopRequireDefault(_handlebarsCompilerVisitor);
|
||||
|
||||
var _noConflict = _interopRequireDefault(_handlebarsNoConflict);
|
||||
|
||||
var _create = _runtime['default'].create;
|
||||
function create() {
|
||||
var hb = _create();
|
||||
|
||||
hb.compile = function (input, options) {
|
||||
return _handlebarsCompilerCompiler.compile(input, options, hb);
|
||||
};
|
||||
hb.precompile = function (input, options) {
|
||||
return _handlebarsCompilerCompiler.precompile(input, options, hb);
|
||||
};
|
||||
|
||||
hb.AST = _AST['default'];
|
||||
hb.Compiler = _handlebarsCompilerCompiler.Compiler;
|
||||
hb.JavaScriptCompiler = _JavaScriptCompiler['default'];
|
||||
hb.Parser = _handlebarsCompilerBase.parser;
|
||||
hb.parse = _handlebarsCompilerBase.parse;
|
||||
hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
|
||||
|
||||
return hb;
|
||||
}
|
||||
|
||||
var inst = create();
|
||||
inst.create = create;
|
||||
|
||||
_noConflict['default'](inst);
|
||||
|
||||
inst.Visitor = _Visitor['default'];
|
||||
|
||||
inst['default'] = inst;
|
||||
|
||||
module.exports = inst;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oYW5kbGViYXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlQSxNQUFJLE9BQU8sR0FBRyxvQkFBUSxNQUFNLENBQUM7QUFDN0IsV0FBUyxNQUFNLEdBQUc7QUFDaEIsUUFBSSxFQUFFLEdBQUcsT0FBTyxFQUFFLENBQUM7O0FBRW5CLE1BQUUsQ0FBQyxPQUFPLEdBQUcsVUFBUyxLQUFLLEVBQUUsT0FBTyxFQUFFO0FBQ3BDLGFBQU8sNEJBWFEsT0FBTyxDQVdQLEtBQUssRUFBRSxPQUFPLEVBQUUsRUFBRSxDQUFDLENBQUM7S0FDcEMsQ0FBQztBQUNGLE1BQUUsQ0FBQyxVQUFVLEdBQUcsVUFBUyxLQUFLLEVBQUUsT0FBTyxFQUFFO0FBQ3ZDLGFBQU8sNEJBZGlCLFVBQVUsQ0FjaEIsS0FBSyxFQUFFLE9BQU8sRUFBRSxFQUFFLENBQUMsQ0FBQztLQUN2QyxDQUFDOztBQUVGLE1BQUUsQ0FBQyxHQUFHLGtCQUFNLENBQUM7QUFDYixNQUFFLENBQUMsUUFBUSwrQkFsQkosUUFBUSxBQWtCTyxDQUFDO0FBQ3ZCLE1BQUUsQ0FBQyxrQkFBa0IsaUNBQXFCLENBQUM7QUFDM0MsTUFBRSxDQUFDLE1BQU0sMkJBeEJULE1BQU0sQUF3QlksQ0FBQztBQUNuQixNQUFFLENBQUMsS0FBSywyQkF4QlIsS0FBSyxBQXdCVyxDQUFDO0FBQ2pCLE1BQUUsQ0FBQyxzQkFBc0IsMkJBeEJ6QixzQkFBc0IsQUF3QjRCLENBQUM7O0FBRW5ELFdBQU8sRUFBRSxDQUFDO0dBQ1g7O0FBRUQsTUFBSSxJQUFJLEdBQUcsTUFBTSxFQUFFLENBQUM7QUFDcEIsTUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7O0FBRXJCLHlCQUFXLElBQUksQ0FBQyxDQUFDOztBQUVqQixNQUFJLENBQUMsT0FBTyxzQkFBVSxDQUFDOztBQUV2QixNQUFJLENBQUMsU0FBUyxDQUFDLEdBQUcsSUFBSSxDQUFDOzttQkFFUixJQUFJIiwiZmlsZSI6ImhhbmRsZWJhcnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgcnVudGltZSBmcm9tICcuL2hhbmRsZWJhcnMucnVudGltZSc7XG5cbi8vIENvbXBpbGVyIGltcG9ydHNcbmltcG9ydCBBU1QgZnJvbSAnLi9oYW5kbGViYXJzL2NvbXBpbGVyL2FzdCc7XG5pbXBvcnQge1xuICBwYXJzZXIgYXMgUGFyc2VyLFxuICBwYXJzZSxcbiAgcGFyc2VXaXRob3V0UHJvY2Vzc2luZ1xufSBmcm9tICcuL2hhbmRsZWJhcnMvY29tcGlsZXIvYmFzZSc7XG5pbXBvcnQgeyBDb21waWxlciwgY29tcGlsZSwgcHJlY29tcGlsZSB9IGZyb20gJy4vaGFuZGxlYmFycy9jb21waWxlci9jb21waWxlcic7XG5pbXBvcnQgSmF2YVNjcmlwdENvbXBpbGVyIGZyb20gJy4vaGFuZGxlYmFycy9jb21waWxlci9qYXZhc2NyaXB0LWNvbXBpbGVyJztcbmltcG9ydCBWaXNpdG9yIGZyb20gJy4vaGFuZGxlYmFycy9jb21waWxlci92aXNpdG9yJztcblxuaW1wb3J0IG5vQ29uZmxpY3QgZnJvbSAnLi9oYW5kbGViYXJzL25vLWNvbmZsaWN0JztcblxubGV0IF9jcmVhdGUgPSBydW50aW1lLmNyZWF0ZTtcbmZ1bmN0aW9uIGNyZWF0ZSgpIHtcbiAgbGV0IGhiID0gX2NyZWF0ZSgpO1xuXG4gIGhiLmNvbXBpbGUgPSBmdW5jdGlvbihpbnB1dCwgb3B0aW9ucykge1xuICAgIHJldHVybiBjb21waWxlKGlucHV0LCBvcHRpb25zLCBoYik7XG4gIH07XG4gIGhiLnByZWNvbXBpbGUgPSBmdW5jdGlvbihpbnB1dCwgb3B0aW9ucykge1xuICAgIHJldHVybiBwcmVjb21waWxlKGlucHV0LCBvcHRpb25zLCBoYik7XG4gIH07XG5cbiAgaGIuQVNUID0gQVNUO1xuICBoYi5Db21waWxlciA9IENvbXBpbGVyO1xuICBoYi5KYXZhU2NyaXB0Q29tcGlsZXIgPSBKYXZhU2NyaXB0Q29tcGlsZXI7XG4gIGhiLlBhcnNlciA9IFBhcnNlcjtcbiAgaGIucGFyc2UgPSBwYXJzZTtcbiAgaGIucGFyc2VXaXRob3V0UHJvY2Vzc2luZyA9IHBhcnNlV2l0aG91dFByb2Nlc3Npbmc7XG5cbiAgcmV0dXJuIGhiO1xufVxuXG5sZXQgaW5zdCA9IGNyZWF0ZSgpO1xuaW5zdC5jcmVhdGUgPSBjcmVhdGU7XG5cbm5vQ29uZmxpY3QoaW5zdCk7XG5cbmluc3QuVmlzaXRvciA9IFZpc2l0b3I7XG5cbmluc3RbJ2RlZmF1bHQnXSA9IGluc3Q7XG5cbmV4cG9ydCBkZWZhdWx0IGluc3Q7XG4iXX0=
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,24 @@
|
||||
import util from 'node:util';
|
||||
import Shell from '../../lib/shell.js';
|
||||
|
||||
const debug = util.debug('release-it:shell-stub');
|
||||
|
||||
class ShellStub extends Shell {
|
||||
exec(command) {
|
||||
if (/^(npm (ping|publish|show)|git fetch)/.test(command)) {
|
||||
debug(command);
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (/^npm whoami/.test(command)) {
|
||||
debug(command);
|
||||
return Promise.resolve('john');
|
||||
}
|
||||
if (/^npm access/.test(command)) {
|
||||
debug(command);
|
||||
return Promise.resolve(JSON.stringify({ john: ['write'] }));
|
||||
}
|
||||
return super.exec(...arguments);
|
||||
}
|
||||
}
|
||||
|
||||
export default ShellStub;
|
||||
@@ -0,0 +1,82 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
|
||||
var IsStringPrefix = require('./IsStringPrefix');
|
||||
var StringToBigInt = require('./StringToBigInt');
|
||||
var ToNumeric = require('./ToNumeric');
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
var Type = require('./Type');
|
||||
|
||||
var BigIntLessThan = require('./BigInt/lessThan');
|
||||
var NumberLessThan = require('./Number/lessThan');
|
||||
|
||||
// https://262.ecma-international.org/9.0/#sec-abstract-relational-comparison
|
||||
|
||||
// eslint-disable-next-line max-statements, max-lines-per-function
|
||||
module.exports = function AbstractRelationalComparison(x, y, LeftFirst) {
|
||||
if (Type(LeftFirst) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
|
||||
}
|
||||
var px;
|
||||
var py;
|
||||
if (LeftFirst) {
|
||||
px = ToPrimitive(x, $Number);
|
||||
py = ToPrimitive(y, $Number);
|
||||
} else {
|
||||
py = ToPrimitive(y, $Number);
|
||||
px = ToPrimitive(x, $Number);
|
||||
}
|
||||
if (Type(px) === 'String' && Type(py) === 'String') {
|
||||
if (IsStringPrefix(py, px)) {
|
||||
return false;
|
||||
}
|
||||
if (IsStringPrefix(px, py)) {
|
||||
return true;
|
||||
}
|
||||
return px < py; // both strings, neither a prefix of the other. shortcut for steps 3 c-f
|
||||
}
|
||||
|
||||
var pxType = Type(px);
|
||||
var pyType = Type(py);
|
||||
var nx;
|
||||
var ny;
|
||||
if (pxType === 'BigInt' && pyType === 'String') {
|
||||
ny = StringToBigInt(py);
|
||||
if ($isNaN(ny)) {
|
||||
return void undefined;
|
||||
}
|
||||
return BigIntLessThan(px, ny);
|
||||
}
|
||||
if (pxType === 'String' && pyType === 'BigInt') {
|
||||
nx = StringToBigInt(px);
|
||||
if ($isNaN(nx)) {
|
||||
return void undefined;
|
||||
}
|
||||
return BigIntLessThan(nx, py);
|
||||
}
|
||||
|
||||
nx = ToNumeric(px);
|
||||
ny = ToNumeric(py);
|
||||
var nxType = Type(nx);
|
||||
if (nxType === Type(ny)) {
|
||||
return nxType === 'Number' ? NumberLessThan(nx, ny) : BigIntLessThan(nx, ny);
|
||||
}
|
||||
|
||||
if ($isNaN(nx) || $isNaN(ny)) {
|
||||
return void undefined;
|
||||
}
|
||||
if (nx === -Infinity || ny === Infinity) {
|
||||
return true;
|
||||
}
|
||||
if (nx === Infinity || ny === -Infinity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return nx < ny; // by now, these are both nonzero, finite, and not equal
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var str = "razdwatrzy";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof str.endsWith !== "function") return false;
|
||||
return str.endsWith("trzy") === true && str.endsWith("raz") === false;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(Number, "isFinite", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Scheduler } from '../Scheduler';
|
||||
import { TestMessage } from './TestMessage';
|
||||
import { SubscriptionLog } from './SubscriptionLog';
|
||||
import { SubscriptionLoggable } from './SubscriptionLoggable';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
export declare class ColdObservable<T> extends Observable<T> implements SubscriptionLoggable {
|
||||
messages: TestMessage[];
|
||||
subscriptions: SubscriptionLog[];
|
||||
scheduler: Scheduler;
|
||||
logSubscribedFrame: () => number;
|
||||
logUnsubscribedFrame: (index: number) => void;
|
||||
constructor(messages: TestMessage[], scheduler: Scheduler);
|
||||
scheduleMessages(subscriber: Subscriber<any>): void;
|
||||
}
|
||||
//# sourceMappingURL=ColdObservable.d.ts.map
|
||||
@@ -0,0 +1,2 @@
|
||||
declare const isYarnGlobal: () => boolean;
|
||||
export default isYarnGlobal;
|
||||
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
"name": "omit",
|
||||
"regExp": /^\*omit\*/,
|
||||
"processSafe":true,
|
||||
"parserFunc": function parser_omit() {}
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"arg","version":"5.0.2","files":{"LICENSE.md":{"checkedAt":1678883670500,"integrity":"sha512-n6B787HtuCwOi+8qSGBW3N2rNIfd5A//qMGUhosy1v2e10AQi7d7oGh0IbWs1xXxGCncFPuGBJFQDrMYxWgZnw==","mode":420,"size":1079},"package.json":{"checkedAt":1678883672843,"integrity":"sha512-tVEblBwWH7TXTP+6G0HQthaL0racAr2f8FrJYZxRQuj+1TA94YOi29z4b46u86KxFzp+nT07KaimGHEThuJxbQ==","mode":420,"size":589},"index.js":{"checkedAt":1678883672843,"integrity":"sha512-vm9o6uBFBAsDHcTTuV+QwznVGyCbwNx1BLAsaunflRtUgWgQS9C9zAvo8Y/I+gaqfAOXr4jKmBSw16xtNTUZTA==","mode":420,"size":4464},"README.md":{"checkedAt":1678883672843,"integrity":"sha512-BNBBgBNM/tp6nKYrlK26Pbm+LiQfEpILBru7nRWV2hBwATYf2IQlxZ14OZRIM4vUCnW0gqVmHxQMA21qwBlacg==","mode":420,"size":6642},"index.d.ts":{"checkedAt":1678883672844,"integrity":"sha512-POnlunPXT39W2aF/Yn4uWIqBJ0sUWIRNl5imj3JaXny+SjmM3xyXRITGWXHccrKD67ZHAMYLPBbK8F4uHm+x0Q==","mode":420,"size":891}}}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"name": "web-streams-polyfill",
|
||||
"version": "3.2.1",
|
||||
"description": "Web Streams, based on the WHATWG spec reference implementation",
|
||||
"main": "dist/polyfill",
|
||||
"browser": "dist/polyfill.min.js",
|
||||
"module": "dist/polyfill.mjs",
|
||||
"types": "dist/types/polyfill.d.ts",
|
||||
"typesVersions": {
|
||||
">=3.6": {
|
||||
"dist/types/*": [
|
||||
"dist/types/ts3.6/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run test:types && npm run test:unit && npm run test:wpt",
|
||||
"test:wpt": "node --expose_gc ./test/run-web-platform-tests.js",
|
||||
"pretest:wpt": "git submodule update --init --recursive",
|
||||
"test:types": "tsc -p ./test/types/tsconfig.json",
|
||||
"test:unit": "jasmine --config=test/unit/jasmine.json",
|
||||
"lint": "eslint \"src/**/*.ts\"",
|
||||
"build": "npm run build:bundle && npm run build:types",
|
||||
"build:bundle": "rollup -c",
|
||||
"build:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run && node ./build/downlevel-dts.js",
|
||||
"accept:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run --local && node ./build/downlevel-dts.js",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"es6",
|
||||
"es2018",
|
||||
"ponyfill"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/MattiasBuelens/web-streams-polyfill.git"
|
||||
},
|
||||
"keywords": [
|
||||
"streams",
|
||||
"whatwg",
|
||||
"polyfill"
|
||||
],
|
||||
"author": "Mattias Buelens <mattias@buelens.com>",
|
||||
"contributors": [
|
||||
"Diwank Singh <diwank.singh@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/MattiasBuelens/web-streams-polyfill/issues"
|
||||
},
|
||||
"homepage": "https://github.com/MattiasBuelens/web-streams-polyfill#readme",
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.13.4",
|
||||
"@rollup/plugin-inject": "^4.0.2",
|
||||
"@rollup/plugin-replace": "^2.4.2",
|
||||
"@rollup/plugin-strip": "^2.0.0",
|
||||
"@rollup/plugin-typescript": "^8.2.1",
|
||||
"@types/node": "^14.14.37",
|
||||
"@typescript-eslint/eslint-plugin": "^4.21.0",
|
||||
"@typescript-eslint/parser": "^4.21.0",
|
||||
"@ungap/promise-all-settled": "^1.1.2",
|
||||
"eslint": "^7.23.0",
|
||||
"jasmine": "^3.7.0",
|
||||
"micromatch": "^4.0.2",
|
||||
"rollup": "^2.44.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"ts-morph": "^10.0.2",
|
||||
"tslib": "^2.2.0",
|
||||
"typescript": "^4.2.4",
|
||||
"wpt-runner": "^3.2.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var isArguments = require("es5-ext/function/is-arguments")
|
||||
, isValue = require("es5-ext/object/is-value")
|
||||
, isString = require("es5-ext/string/is-string");
|
||||
|
||||
var iteratorSymbol = require("es6-symbol").iterator
|
||||
, isArray = Array.isArray;
|
||||
|
||||
module.exports = function (value) {
|
||||
if (!isValue(value)) return false;
|
||||
if (isArray(value)) return true;
|
||||
if (isString(value)) return true;
|
||||
if (isArguments(value)) return true;
|
||||
return typeof value[iteratorSymbol] === "function";
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"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","2":"C"},C:{"1":"3 4 5 6 7 8 9 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","2":"0 1 2 DC tB I v J D E F A B C K L G M N O w g x y z EC FC"},D:{"1":"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","2":"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"},E:{"1":"A B C K L G LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F HC zB IC JC KC"},F:{"1":"4 5 6 7 8 9 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","2":"0 1 2 3 F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"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:"CSS unset value"};
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isHalfWidth;
|
||||
exports.halfWidth = void 0;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
|
||||
exports.halfWidth = halfWidth;
|
||||
|
||||
function isHalfWidth(str) {
|
||||
(0, _assertString.default)(str);
|
||||
return halfWidth.test(str);
|
||||
}
|
||||
@@ -0,0 +1,653 @@
|
||||
/**
|
||||
* The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
|
||||
*
|
||||
* To use the promise-based APIs:
|
||||
*
|
||||
* ```js
|
||||
* import * as readline from 'node:readline/promises';
|
||||
* ```
|
||||
*
|
||||
* To use the callback and sync APIs:
|
||||
*
|
||||
* ```js
|
||||
* import * as readline from 'node:readline';
|
||||
* ```
|
||||
*
|
||||
* The following simple example illustrates the basic use of the `readline` module.
|
||||
*
|
||||
* ```js
|
||||
* import * as readline from 'node:readline/promises';
|
||||
* import { stdin as input, stdout as output } from 'node:process';
|
||||
*
|
||||
* const rl = readline.createInterface({ input, output });
|
||||
*
|
||||
* const answer = await rl.question('What do you think of Node.js? ');
|
||||
*
|
||||
* console.log(`Thank you for your valuable feedback: ${answer}`);
|
||||
*
|
||||
* rl.close();
|
||||
* ```
|
||||
*
|
||||
* Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
|
||||
* received on the `input` stream.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js)
|
||||
*/
|
||||
declare module 'readline' {
|
||||
import { Abortable, EventEmitter } from 'node:events';
|
||||
import * as promises from 'node:readline/promises';
|
||||
|
||||
export { promises };
|
||||
export interface Key {
|
||||
sequence?: string | undefined;
|
||||
name?: string | undefined;
|
||||
ctrl?: boolean | undefined;
|
||||
meta?: boolean | undefined;
|
||||
shift?: boolean | undefined;
|
||||
}
|
||||
/**
|
||||
* Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a
|
||||
* single `input` `Readable` stream and a single `output` `Writable` stream.
|
||||
* The `output` stream is used to print prompts for user input that arrives on,
|
||||
* and is read from, the `input` stream.
|
||||
* @since v0.1.104
|
||||
*/
|
||||
export class Interface extends EventEmitter {
|
||||
readonly terminal: boolean;
|
||||
/**
|
||||
* The current input data being processed by node.
|
||||
*
|
||||
* This can be used when collecting input from a TTY stream to retrieve the
|
||||
* current value that has been processed thus far, prior to the `line` event
|
||||
* being emitted. Once the `line` event has been emitted, this property will
|
||||
* be an empty string.
|
||||
*
|
||||
* Be aware that modifying the value during the instance runtime may have
|
||||
* unintended consequences if `rl.cursor` is not also controlled.
|
||||
*
|
||||
* **If not using a TTY stream for input, use the `'line'` event.**
|
||||
*
|
||||
* One possible use case would be as follows:
|
||||
*
|
||||
* ```js
|
||||
* const values = ['lorem ipsum', 'dolor sit amet'];
|
||||
* const rl = readline.createInterface(process.stdin);
|
||||
* const showResults = debounce(() => {
|
||||
* console.log(
|
||||
* '\n',
|
||||
* values.filter((val) => val.startsWith(rl.line)).join(' ')
|
||||
* );
|
||||
* }, 300);
|
||||
* process.stdin.on('keypress', (c, k) => {
|
||||
* showResults();
|
||||
* });
|
||||
* ```
|
||||
* @since v0.1.98
|
||||
*/
|
||||
readonly line: string;
|
||||
/**
|
||||
* The cursor position relative to `rl.line`.
|
||||
*
|
||||
* This will track where the current cursor lands in the input string, when
|
||||
* reading input from a TTY stream. The position of cursor determines the
|
||||
* portion of the input string that will be modified as input is processed,
|
||||
* as well as the column where the terminal caret will be rendered.
|
||||
* @since v0.1.98
|
||||
*/
|
||||
readonly cursor: number;
|
||||
/**
|
||||
* NOTE: According to the documentation:
|
||||
*
|
||||
* > Instances of the `readline.Interface` class are constructed using the
|
||||
* > `readline.createInterface()` method.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
|
||||
*/
|
||||
protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
|
||||
/**
|
||||
* NOTE: According to the documentation:
|
||||
*
|
||||
* > Instances of the `readline.Interface` class are constructed using the
|
||||
* > `readline.createInterface()` method.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
|
||||
*/
|
||||
protected constructor(options: ReadLineOptions);
|
||||
/**
|
||||
* The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
|
||||
* @since v15.3.0
|
||||
* @return the current prompt string
|
||||
*/
|
||||
getPrompt(): string;
|
||||
/**
|
||||
* The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called.
|
||||
* @since v0.1.98
|
||||
*/
|
||||
setPrompt(prompt: string): void;
|
||||
/**
|
||||
* The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new
|
||||
* location at which to provide input.
|
||||
*
|
||||
* When called, `rl.prompt()` will resume the `input` stream if it has been
|
||||
* paused.
|
||||
*
|
||||
* If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written.
|
||||
* @since v0.1.98
|
||||
* @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`.
|
||||
*/
|
||||
prompt(preserveCursor?: boolean): void;
|
||||
/**
|
||||
* The `rl.question()` method displays the `query` by writing it to the `output`,
|
||||
* waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument.
|
||||
*
|
||||
* When called, `rl.question()` will resume the `input` stream if it has been
|
||||
* paused.
|
||||
*
|
||||
* If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written.
|
||||
*
|
||||
* The `callback` function passed to `rl.question()` does not follow the typical
|
||||
* pattern of accepting an `Error` object or `null` as the first argument.
|
||||
* The `callback` is called with the provided answer as the only argument.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* ```js
|
||||
* rl.question('What is your favorite food? ', (answer) => {
|
||||
* console.log(`Oh, so your favorite food is ${answer}`);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Using an `AbortController` to cancel a question.
|
||||
*
|
||||
* ```js
|
||||
* const ac = new AbortController();
|
||||
* const signal = ac.signal;
|
||||
*
|
||||
* rl.question('What is your favorite food? ', { signal }, (answer) => {
|
||||
* console.log(`Oh, so your favorite food is ${answer}`);
|
||||
* });
|
||||
*
|
||||
* signal.addEventListener('abort', () => {
|
||||
* console.log('The food question timed out');
|
||||
* }, { once: true });
|
||||
*
|
||||
* setTimeout(() => ac.abort(), 10000);
|
||||
* ```
|
||||
*
|
||||
* If this method is invoked as it's util.promisify()ed version, it returns a
|
||||
* Promise that fulfills with the answer. If the question is canceled using
|
||||
* an `AbortController` it will reject with an `AbortError`.
|
||||
*
|
||||
* ```js
|
||||
* const util = require('util');
|
||||
* const question = util.promisify(rl.question).bind(rl);
|
||||
*
|
||||
* async function questionExample() {
|
||||
* try {
|
||||
* const answer = await question('What is you favorite food? ');
|
||||
* console.log(`Oh, so your favorite food is ${answer}`);
|
||||
* } catch (err) {
|
||||
* console.error('Question rejected', err);
|
||||
* }
|
||||
* }
|
||||
* questionExample();
|
||||
* ```
|
||||
* @since v0.3.3
|
||||
* @param query A statement or query to write to `output`, prepended to the prompt.
|
||||
* @param callback A callback function that is invoked with the user's input in response to the `query`.
|
||||
*/
|
||||
question(query: string, callback: (answer: string) => void): void;
|
||||
question(query: string, options: Abortable, callback: (answer: string) => void): void;
|
||||
/**
|
||||
* The `rl.pause()` method pauses the `input` stream, allowing it to be resumed
|
||||
* later if necessary.
|
||||
*
|
||||
* Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance.
|
||||
* @since v0.3.4
|
||||
*/
|
||||
pause(): this;
|
||||
/**
|
||||
* The `rl.resume()` method resumes the `input` stream if it has been paused.
|
||||
* @since v0.3.4
|
||||
*/
|
||||
resume(): this;
|
||||
/**
|
||||
* The `rl.close()` method closes the `readline.Interface` instance and
|
||||
* relinquishes control over the `input` and `output` streams. When called,
|
||||
* the `'close'` event will be emitted.
|
||||
*
|
||||
* Calling `rl.close()` does not immediately stop other events (including `'line'`)
|
||||
* from being emitted by the `readline.Interface` instance.
|
||||
* @since v0.1.98
|
||||
*/
|
||||
close(): void;
|
||||
/**
|
||||
* The `rl.write()` method will write either `data` or a key sequence identified
|
||||
* by `key` to the `output`. The `key` argument is supported only if `output` is
|
||||
* a `TTY` text terminal. See `TTY keybindings` for a list of key
|
||||
* combinations.
|
||||
*
|
||||
* If `key` is specified, `data` is ignored.
|
||||
*
|
||||
* When called, `rl.write()` will resume the `input` stream if it has been
|
||||
* paused.
|
||||
*
|
||||
* If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written.
|
||||
*
|
||||
* ```js
|
||||
* rl.write('Delete this!');
|
||||
* // Simulate Ctrl+U to delete the line written previously
|
||||
* rl.write(null, { ctrl: true, name: 'u' });
|
||||
* ```
|
||||
*
|
||||
* The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_.
|
||||
* @since v0.1.98
|
||||
*/
|
||||
write(data: string | Buffer, key?: Key): void;
|
||||
write(data: undefined | null | string | Buffer, key: Key): void;
|
||||
/**
|
||||
* Returns the real position of the cursor in relation to the input
|
||||
* prompt + string. Long input (wrapping) strings, as well as multiple
|
||||
* line prompts are included in the calculations.
|
||||
* @since v13.5.0, v12.16.0
|
||||
*/
|
||||
getCursorPos(): CursorPos;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close
|
||||
* 2. line
|
||||
* 3. pause
|
||||
* 4. resume
|
||||
* 5. SIGCONT
|
||||
* 6. SIGINT
|
||||
* 7. SIGTSTP
|
||||
* 8. history
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: 'close', listener: () => void): this;
|
||||
addListener(event: 'line', listener: (input: string) => void): this;
|
||||
addListener(event: 'pause', listener: () => void): this;
|
||||
addListener(event: 'resume', listener: () => void): this;
|
||||
addListener(event: 'SIGCONT', listener: () => void): this;
|
||||
addListener(event: 'SIGINT', listener: () => void): this;
|
||||
addListener(event: 'SIGTSTP', listener: () => void): this;
|
||||
addListener(event: 'history', listener: (history: string[]) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: 'close'): boolean;
|
||||
emit(event: 'line', input: string): boolean;
|
||||
emit(event: 'pause'): boolean;
|
||||
emit(event: 'resume'): boolean;
|
||||
emit(event: 'SIGCONT'): boolean;
|
||||
emit(event: 'SIGINT'): boolean;
|
||||
emit(event: 'SIGTSTP'): boolean;
|
||||
emit(event: 'history', history: string[]): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: 'close', listener: () => void): this;
|
||||
on(event: 'line', listener: (input: string) => void): this;
|
||||
on(event: 'pause', listener: () => void): this;
|
||||
on(event: 'resume', listener: () => void): this;
|
||||
on(event: 'SIGCONT', listener: () => void): this;
|
||||
on(event: 'SIGINT', listener: () => void): this;
|
||||
on(event: 'SIGTSTP', listener: () => void): this;
|
||||
on(event: 'history', listener: (history: string[]) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: 'close', listener: () => void): this;
|
||||
once(event: 'line', listener: (input: string) => void): this;
|
||||
once(event: 'pause', listener: () => void): this;
|
||||
once(event: 'resume', listener: () => void): this;
|
||||
once(event: 'SIGCONT', listener: () => void): this;
|
||||
once(event: 'SIGINT', listener: () => void): this;
|
||||
once(event: 'SIGTSTP', listener: () => void): this;
|
||||
once(event: 'history', listener: (history: string[]) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: 'close', listener: () => void): this;
|
||||
prependListener(event: 'line', listener: (input: string) => void): this;
|
||||
prependListener(event: 'pause', listener: () => void): this;
|
||||
prependListener(event: 'resume', listener: () => void): this;
|
||||
prependListener(event: 'SIGCONT', listener: () => void): this;
|
||||
prependListener(event: 'SIGINT', listener: () => void): this;
|
||||
prependListener(event: 'SIGTSTP', listener: () => void): this;
|
||||
prependListener(event: 'history', listener: (history: string[]) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: 'close', listener: () => void): this;
|
||||
prependOnceListener(event: 'line', listener: (input: string) => void): this;
|
||||
prependOnceListener(event: 'pause', listener: () => void): this;
|
||||
prependOnceListener(event: 'resume', listener: () => void): this;
|
||||
prependOnceListener(event: 'SIGCONT', listener: () => void): this;
|
||||
prependOnceListener(event: 'SIGINT', listener: () => void): this;
|
||||
prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
|
||||
prependOnceListener(event: 'history', listener: (history: string[]) => void): this;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<string>;
|
||||
}
|
||||
export type ReadLine = Interface; // type forwarded for backwards compatibility
|
||||
export type Completer = (line: string) => CompleterResult;
|
||||
export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
|
||||
export type CompleterResult = [string[], string];
|
||||
export interface ReadLineOptions {
|
||||
input: NodeJS.ReadableStream;
|
||||
output?: NodeJS.WritableStream | undefined;
|
||||
completer?: Completer | AsyncCompleter | undefined;
|
||||
terminal?: boolean | undefined;
|
||||
/**
|
||||
* Initial list of history lines. This option makes sense
|
||||
* only if `terminal` is set to `true` by the user or by an internal `output`
|
||||
* check, otherwise the history caching mechanism is not initialized at all.
|
||||
* @default []
|
||||
*/
|
||||
history?: string[] | undefined;
|
||||
historySize?: number | undefined;
|
||||
prompt?: string | undefined;
|
||||
crlfDelay?: number | undefined;
|
||||
/**
|
||||
* If `true`, when a new input line added
|
||||
* to the history list duplicates an older one, this removes the older line
|
||||
* from the list.
|
||||
* @default false
|
||||
*/
|
||||
removeHistoryDuplicates?: boolean | undefined;
|
||||
escapeCodeTimeout?: number | undefined;
|
||||
tabSize?: number | undefined;
|
||||
}
|
||||
/**
|
||||
* The `readline.createInterface()` method creates a new `readline.Interface`instance.
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('readline');
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Once the `readline.Interface` instance is created, the most common case is to
|
||||
* listen for the `'line'` event:
|
||||
*
|
||||
* ```js
|
||||
* rl.on('line', (line) => {
|
||||
* console.log(`Received: ${line}`);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* If `terminal` is `true` for this instance then the `output` stream will get
|
||||
* the best compatibility if it defines an `output.columns` property and emits
|
||||
* a `'resize'` event on the `output` if or when the columns ever change
|
||||
* (`process.stdout` does this automatically when it is a TTY).
|
||||
*
|
||||
* When creating a `readline.Interface` using `stdin` as input, the program
|
||||
* will not terminate until it receives `EOF` (Ctrl+D on
|
||||
* Linux/macOS, Ctrl+Z followed by Return on
|
||||
* Windows).
|
||||
* If you want your application to exit without waiting for user input, you can `unref()` the standard input stream:
|
||||
*
|
||||
* ```js
|
||||
* process.stdin.unref();
|
||||
* ```
|
||||
* @since v0.1.98
|
||||
*/
|
||||
export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
|
||||
export function createInterface(options: ReadLineOptions): Interface;
|
||||
/**
|
||||
* The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
|
||||
*
|
||||
* Optionally, `interface` specifies a `readline.Interface` instance for which
|
||||
* autocompletion is disabled when copy-pasted input is detected.
|
||||
*
|
||||
* If the `stream` is a `TTY`, then it must be in raw mode.
|
||||
*
|
||||
* This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop
|
||||
* the `input` from emitting `'keypress'` events.
|
||||
*
|
||||
* ```js
|
||||
* readline.emitKeypressEvents(process.stdin);
|
||||
* if (process.stdin.isTTY)
|
||||
* process.stdin.setRawMode(true);
|
||||
* ```
|
||||
*
|
||||
* ## Example: Tiny CLI
|
||||
*
|
||||
* The following example illustrates the use of `readline.Interface` class to
|
||||
* implement a small command-line interface:
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('readline');
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
* prompt: 'OHAI> '
|
||||
* });
|
||||
*
|
||||
* rl.prompt();
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
* switch (line.trim()) {
|
||||
* case 'hello':
|
||||
* console.log('world!');
|
||||
* break;
|
||||
* default:
|
||||
* console.log(`Say what? I might have heard '${line.trim()}'`);
|
||||
* break;
|
||||
* }
|
||||
* rl.prompt();
|
||||
* }).on('close', () => {
|
||||
* console.log('Have a great day!');
|
||||
* process.exit(0);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ## Example: Read file stream line-by-Line
|
||||
*
|
||||
* A common use case for `readline` is to consume an input file one line at a
|
||||
* time. The easiest way to do so is leveraging the `fs.ReadStream` API as
|
||||
* well as a `for await...of` loop:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const readline = require('readline');
|
||||
*
|
||||
* async function processLineByLine() {
|
||||
* const fileStream = fs.createReadStream('input.txt');
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: fileStream,
|
||||
* crlfDelay: Infinity
|
||||
* });
|
||||
* // Note: we use the crlfDelay option to recognize all instances of CR LF
|
||||
* // ('\r\n') in input.txt as a single line break.
|
||||
*
|
||||
* for await (const line of rl) {
|
||||
* // Each line in input.txt will be successively available here as `line`.
|
||||
* console.log(`Line from file: ${line}`);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* processLineByLine();
|
||||
* ```
|
||||
*
|
||||
* Alternatively, one could use the `'line'` event:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const readline = require('readline');
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: fs.createReadStream('sample.txt'),
|
||||
* crlfDelay: Infinity
|
||||
* });
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
* console.log(`Line from file: ${line}`);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
|
||||
*
|
||||
* ```js
|
||||
* const { once } = require('events');
|
||||
* const { createReadStream } = require('fs');
|
||||
* const { createInterface } = require('readline');
|
||||
*
|
||||
* (async function processLineByLine() {
|
||||
* try {
|
||||
* const rl = createInterface({
|
||||
* input: createReadStream('big-file.txt'),
|
||||
* crlfDelay: Infinity
|
||||
* });
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
* // Process the line.
|
||||
* });
|
||||
*
|
||||
* await once(rl, 'close');
|
||||
*
|
||||
* console.log('File processed.');
|
||||
* } catch (err) {
|
||||
* console.error(err);
|
||||
* }
|
||||
* })();
|
||||
* ```
|
||||
* @since v0.7.7
|
||||
*/
|
||||
export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
|
||||
export type Direction = -1 | 0 | 1;
|
||||
export interface CursorPos {
|
||||
rows: number;
|
||||
cols: number;
|
||||
}
|
||||
/**
|
||||
* The `readline.clearLine()` method clears current line of given `TTY` stream
|
||||
* in a specified direction identified by `dir`.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
||||
*/
|
||||
export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
|
||||
/**
|
||||
* The `readline.clearScreenDown()` method clears the given `TTY` stream from
|
||||
* the current position of the cursor down.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
||||
*/
|
||||
export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
|
||||
/**
|
||||
* The `readline.cursorTo()` method moves cursor to the specified position in a
|
||||
* given `TTY` `stream`.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
||||
*/
|
||||
export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
||||
/**
|
||||
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
|
||||
* position in a given `TTY` `stream`.
|
||||
*
|
||||
* ## Example: Tiny CLI
|
||||
*
|
||||
* The following example illustrates the use of `readline.Interface` class to
|
||||
* implement a small command-line interface:
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('readline');
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
* prompt: 'OHAI> '
|
||||
* });
|
||||
*
|
||||
* rl.prompt();
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
* switch (line.trim()) {
|
||||
* case 'hello':
|
||||
* console.log('world!');
|
||||
* break;
|
||||
* default:
|
||||
* console.log(`Say what? I might have heard '${line.trim()}'`);
|
||||
* break;
|
||||
* }
|
||||
* rl.prompt();
|
||||
* }).on('close', () => {
|
||||
* console.log('Have a great day!');
|
||||
* process.exit(0);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ## Example: Read file stream line-by-Line
|
||||
*
|
||||
* A common use case for `readline` is to consume an input file one line at a
|
||||
* time. The easiest way to do so is leveraging the `fs.ReadStream` API as
|
||||
* well as a `for await...of` loop:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const readline = require('readline');
|
||||
*
|
||||
* async function processLineByLine() {
|
||||
* const fileStream = fs.createReadStream('input.txt');
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: fileStream,
|
||||
* crlfDelay: Infinity
|
||||
* });
|
||||
* // Note: we use the crlfDelay option to recognize all instances of CR LF
|
||||
* // ('\r\n') in input.txt as a single line break.
|
||||
*
|
||||
* for await (const line of rl) {
|
||||
* // Each line in input.txt will be successively available here as `line`.
|
||||
* console.log(`Line from file: ${line}`);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* processLineByLine();
|
||||
* ```
|
||||
*
|
||||
* Alternatively, one could use the `'line'` event:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('fs');
|
||||
* const readline = require('readline');
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: fs.createReadStream('sample.txt'),
|
||||
* crlfDelay: Infinity
|
||||
* });
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
* console.log(`Line from file: ${line}`);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
|
||||
*
|
||||
* ```js
|
||||
* const { once } = require('events');
|
||||
* const { createReadStream } = require('fs');
|
||||
* const { createInterface } = require('readline');
|
||||
*
|
||||
* (async function processLineByLine() {
|
||||
* try {
|
||||
* const rl = createInterface({
|
||||
* input: createReadStream('big-file.txt'),
|
||||
* crlfDelay: Infinity
|
||||
* });
|
||||
*
|
||||
* rl.on('line', (line) => {
|
||||
* // Process the line.
|
||||
* });
|
||||
*
|
||||
* await once(rl, 'close');
|
||||
*
|
||||
* console.log('File processed.');
|
||||
* } catch (err) {
|
||||
* console.error(err);
|
||||
* }
|
||||
* })();
|
||||
* ```
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
||||
*/
|
||||
export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
|
||||
}
|
||||
declare module 'node:readline' {
|
||||
export * from 'readline';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _node = _interopRequireDefault(require("./node"));
|
||||
|
||||
var _types = require("./types");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
var Comment = /*#__PURE__*/function (_Node) {
|
||||
_inheritsLoose(Comment, _Node);
|
||||
|
||||
function Comment(opts) {
|
||||
var _this;
|
||||
|
||||
_this = _Node.call(this, opts) || this;
|
||||
_this.type = _types.COMMENT;
|
||||
return _this;
|
||||
}
|
||||
|
||||
return Comment;
|
||||
}(_node["default"]);
|
||||
|
||||
exports["default"] = Comment;
|
||||
module.exports = exports.default;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AAErC,MAAM,CAAC,MAAM,MAAM,GAA8B;IAC/C,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,SAAS;CACf,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"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","2":"C K L G M","130":"N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB 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 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","578":"nB oB pB P Q R wB S T U"},D:{"1":"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","2":"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"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F 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"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC","4":"9B","260":"eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"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:{"2":"AD BD"}},B:5,C:"Add to home screen (A2HS)"};
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[28603] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
”¢£¤„¦§Ø©Ŗ«¬®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E A B CC","16":"F"},B:{"2":"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:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB 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","16":"I v"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A 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","16":"B C"},E:{"2":"I J HC zB IC","16":"v D E F A B C K L G JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F 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 AC TC rB","16":"qB"},G:{"2":"zB UC BC VC WC","16":"E 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:{"2":"oC"},I:{"2":"tB I f pC qC sC BC tC uC","16":"rC"},J:{"2":"A","16":"D"},K:{"2":"A B C h qB AC rB"},L:{"2":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"2":"vC"},P:{"2":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"2":"1B"},R:{"2":"9C"},S:{"2":"AD BD"}},B:7,C:"Test feature - updated"};
|
||||
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isIPRange;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var _isIP = _interopRequireDefault(require("./isIP"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var subnetMaybe = /^\d{1,3}$/;
|
||||
var v4Subnet = 32;
|
||||
var v6Subnet = 128;
|
||||
|
||||
function isIPRange(str) {
|
||||
var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||
(0, _assertString.default)(str);
|
||||
var parts = str.split('/'); // parts[0] -> ip, parts[1] -> subnet
|
||||
|
||||
if (parts.length !== 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!subnetMaybe.test(parts[1])) {
|
||||
return false;
|
||||
} // Disallow preceding 0 i.e. 01, 02, ...
|
||||
|
||||
|
||||
if (parts[1].length > 1 && parts[1].startsWith('0')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var isValidIP = (0, _isIP.default)(parts[0], version);
|
||||
|
||||
if (!isValidIP) {
|
||||
return false;
|
||||
} // Define valid subnet according to IP's version
|
||||
|
||||
|
||||
var expectedSubnet = null;
|
||||
|
||||
switch (String(version)) {
|
||||
case '4':
|
||||
expectedSubnet = v4Subnet;
|
||||
break;
|
||||
|
||||
case '6':
|
||||
expectedSubnet = v6Subnet;
|
||||
break;
|
||||
|
||||
default:
|
||||
expectedSubnet = (0, _isIP.default)(parts[0], '6') ? v6Subnet : v4Subnet;
|
||||
}
|
||||
|
||||
return parts[1] <= expectedSubnet && parts[1] >= 0;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
var ensurePlainFunction = require("type/plain-function/ensure")
|
||||
, isThenable = require("type/thenable/is")
|
||||
, ensureThenable = require("type/thenable/ensure");
|
||||
|
||||
var resolveCallback = function (callback, next) {
|
||||
var callbackResult = callback();
|
||||
if (!isThenable(callbackResult)) return next();
|
||||
return callbackResult.then(next);
|
||||
};
|
||||
|
||||
module.exports = function (callback) {
|
||||
ensureThenable(this);
|
||||
ensurePlainFunction(callback);
|
||||
return this.then(
|
||||
function (result) {
|
||||
return resolveCallback(callback, function () { return result; });
|
||||
},
|
||||
function (error) {
|
||||
return resolveCallback(callback, function () { throw error; });
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import { createErrorClass } from './createErrorClass';
|
||||
|
||||
export interface ObjectUnsubscribedError extends Error {}
|
||||
|
||||
export interface ObjectUnsubscribedErrorCtor {
|
||||
/**
|
||||
* @deprecated Internal implementation detail. Do not construct error instances.
|
||||
* Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269
|
||||
*/
|
||||
new (): ObjectUnsubscribedError;
|
||||
}
|
||||
|
||||
/**
|
||||
* An error thrown when an action is invalid because the object has been
|
||||
* unsubscribed.
|
||||
*
|
||||
* @see {@link Subject}
|
||||
* @see {@link BehaviorSubject}
|
||||
*
|
||||
* @class ObjectUnsubscribedError
|
||||
*/
|
||||
export const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(
|
||||
(_super) =>
|
||||
function ObjectUnsubscribedErrorImpl(this: any) {
|
||||
_super(this);
|
||||
this.name = 'ObjectUnsubscribedError';
|
||||
this.message = 'object unsubscribed';
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = value => {
|
||||
const type = typeof value;
|
||||
return value !== null && (type === 'object' || type === 'function');
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"distinctUntilKeyChanged.js","sourceRoot":"","sources":["../../../../src/internal/operators/distinctUntilKeyChanged.ts"],"names":[],"mappings":";;;AAAA,+DAA8D;AAoE9D,SAAgB,uBAAuB,CAAuB,GAAM,EAAE,OAAuC;IAC3G,OAAO,2CAAoB,CAAC,UAAC,CAAI,EAAE,CAAI,IAAK,OAAA,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAArD,CAAqD,CAAC,CAAC;AACrG,CAAC;AAFD,0DAEC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pipe.js","sourceRoot":"","sources":["../../../../src/internal/util/pipe.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AA6EtC,SAAgB,IAAI;IAAC,aAAsC;SAAtC,UAAsC,EAAtC,qBAAsC,EAAtC,IAAsC;QAAtC,wBAAsC;;IACzD,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAFD,oBAEC;AAGD,SAAgB,aAAa,CAAO,GAA+B;IACjE,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,mBAAmC,CAAC;KAC5C;IAED,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;KACf;IAED,OAAO,SAAS,KAAK,CAAC,KAAQ;QAC5B,OAAO,GAAG,CAAC,MAAM,CAAC,UAAC,IAAS,EAAE,EAAuB,IAAK,OAAA,EAAE,CAAC,IAAI,CAAC,EAAR,CAAQ,EAAE,KAAY,CAAC,CAAC;IACpF,CAAC,CAAC;AACJ,CAAC;AAZD,sCAYC"}
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.takeUntil = void 0;
|
||||
var lift_1 = require("../util/lift");
|
||||
var OperatorSubscriber_1 = require("./OperatorSubscriber");
|
||||
var innerFrom_1 = require("../observable/innerFrom");
|
||||
var noop_1 = require("../util/noop");
|
||||
function takeUntil(notifier) {
|
||||
return lift_1.operate(function (source, subscriber) {
|
||||
innerFrom_1.innerFrom(notifier).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function () { return subscriber.complete(); }, noop_1.noop));
|
||||
!subscriber.closed && source.subscribe(subscriber);
|
||||
});
|
||||
}
|
||||
exports.takeUntil = takeUntil;
|
||||
//# sourceMappingURL=takeUntil.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.skipUntil = void 0;
|
||||
var lift_1 = require("../util/lift");
|
||||
var OperatorSubscriber_1 = require("./OperatorSubscriber");
|
||||
var innerFrom_1 = require("../observable/innerFrom");
|
||||
var noop_1 = require("../util/noop");
|
||||
function skipUntil(notifier) {
|
||||
return lift_1.operate(function (source, subscriber) {
|
||||
var taking = false;
|
||||
var skipSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function () {
|
||||
skipSubscriber === null || skipSubscriber === void 0 ? void 0 : skipSubscriber.unsubscribe();
|
||||
taking = true;
|
||||
}, noop_1.noop);
|
||||
innerFrom_1.innerFrom(notifier).subscribe(skipSubscriber);
|
||||
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) { return taking && subscriber.next(value); }));
|
||||
});
|
||||
}
|
||||
exports.skipUntil = skipUntil;
|
||||
//# sourceMappingURL=skipUntil.js.map
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('differenceBy', require('../differenceBy'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,336 @@
|
||||
# auto-changelog
|
||||
|
||||
Command line tool for generating a changelog from git tags and commit history. Used by [Modernizr](https://modernizr.com), [Netlify](https://netlify.com), [Neutrino](https://neutrinojs.org) and [Velocity.js](http://velocityjs.org).
|
||||
|
||||
[](https://www.npmjs.com/package/auto-changelog)
|
||||
[](https://travis-ci.org/CookPete/auto-changelog)
|
||||
[](https://codecov.io/gh/CookPete/auto-changelog)
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
npm install -g auto-changelog
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
Simply run `auto-changelog` in the root folder of a git repository. `git log` is run behind the scenes in order to parse the commit history.
|
||||
|
||||
```bash
|
||||
Usage: auto-changelog [options]
|
||||
|
||||
Options:
|
||||
|
||||
-o, --output [file] # output file, default: CHANGELOG.md
|
||||
-c, --config [file] # config file location, default: .auto-changelog
|
||||
-t, --template [template] # specify template to use [compact, keepachangelog, json], default: compact
|
||||
-r, --remote [remote] # specify git remote to use for links, default: origin
|
||||
-p, --package # use version from package.json as latest release
|
||||
-v, --latest-version [version] # use specified version as latest release
|
||||
-u, --unreleased # include section for unreleased changes
|
||||
-l, --commit-limit [count] # number of commits to display per release, default: 3
|
||||
-b, --backfill-limit [count] # number of commits to backfill empty releases with, default: 3
|
||||
--commit-url [url] # override url for commits, use {id} for commit id
|
||||
--issue-url [url] # override url for issues, use {id} for issue id
|
||||
--merge-url [url] # override url for merges, use {id} for merge id
|
||||
--compare-url [url] # override url for compares, use {from} and {to} for tags
|
||||
--issue-pattern [regex] # override regex pattern for issues in commit messages
|
||||
--breaking-pattern [regex] # regex pattern for breaking change commits
|
||||
--merge-pattern [regex] # add custom regex pattern for merge commits
|
||||
--ignore-commit-pattern [regex] # pattern to ignore when parsing commits
|
||||
--tag-pattern [regex] # override regex pattern for version tags
|
||||
--tag-prefix [prefix] # prefix used in version tags, default: v
|
||||
--starting-version [tag] # specify earliest version to include in changelog
|
||||
--starting-date [yyyy-mm-dd] # specify earliest date to include in changelog
|
||||
--ending-version [tag] # specify latest version to include in changelog
|
||||
--sort-commits [property] # sort commits by property [relevance, date, date-desc, subject, subject-desc], default: relevance
|
||||
--release-summary # display tagged commit message body as release summary
|
||||
--unreleased-only # only output unreleased changes
|
||||
--hide-empty-releases # hide empty releases
|
||||
--hide-credit # hide auto-changelog credit
|
||||
--handlebars-setup [file] # handlebars setup file
|
||||
--append-git-log [string] # string to append to git log command
|
||||
--append-git-tag [string] # string to append to git tag command
|
||||
--prepend # prepend changelog to output file
|
||||
--stdout # output changelog to stdout
|
||||
-V, --version # output the version number
|
||||
-h, --help # output usage information
|
||||
|
||||
|
||||
# Write log to CHANGELOG.md in current directory
|
||||
auto-changelog
|
||||
|
||||
# Write log to HISTORY.md using keepachangelog template
|
||||
auto-changelog --output HISTORY.md --template keepachangelog
|
||||
|
||||
# Disable the commit limit, rendering all commits for every release
|
||||
auto-changelog --commit-limit false
|
||||
```
|
||||
|
||||
### Requirements
|
||||
|
||||
`auto-changelog` is designed to be as flexible as possible, providing a clear changelog for any project. There are only two absolute requirements:
|
||||
|
||||
- You should be using git `1.7.2` or later
|
||||
- All versions should be tagged using [semver](https://semver.org) tag names – this happens by default when using [`npm version`](https://docs.npmjs.com/cli/version)
|
||||
|
||||
There are some less strict requirements to improve your changelog:
|
||||
|
||||
- [Close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords)
|
||||
- Merge pull requests using the standard merge commit message for your platform
|
||||
|
||||
### What you might do if you’re clever
|
||||
|
||||
Install `auto-changelog` to dev dependencies:
|
||||
|
||||
```bash
|
||||
npm install auto-changelog --save-dev
|
||||
# or
|
||||
yarn add auto-changelog --dev
|
||||
```
|
||||
|
||||
Add `auto-changelog -p && git add CHANGELOG.md` to the `version` scripts in your `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-awesome-package",
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"auto-changelog": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"version": "auto-changelog -p && git add CHANGELOG.md"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Using `-p` or `--package` uses the `version` from `package.json` as the latest release, so that all commits between the previous release and now become part of that release. Essentially anything that would normally be parsed as `Unreleased` will now come under the `version` from `package.json`
|
||||
|
||||
Now every time you run [`npm version`](https://docs.npmjs.com/cli/version), the changelog will automatically update and be part of the version commit.
|
||||
|
||||
### Advanced Usage
|
||||
|
||||
#### URL Overrides
|
||||
|
||||
Links to commits, issues, pull requests and version diffs are automatically generated based on your remote URL. GitHub, GitLab, BitBucket and Azure DevOps are all supported. If you have an unusual remote or need to override one of the link formats, use `--commit-url`, `--issue-url` or `--merge-url` with an `{id}` token. For custom version diffs, use `--compare-url` with `{from}` and `{to}` tokens.
|
||||
|
||||
```bash
|
||||
# Link all issues to redmine
|
||||
auto-changelog --issue-url https://www.redmine.org/issues/{id}
|
||||
|
||||
# Link to custom diff page
|
||||
auto-changelog --compare-url https://example.com/repo/compare/{from}...{to}
|
||||
```
|
||||
|
||||
#### Add to an existing changelog
|
||||
|
||||
If you’d like to keep an existing changelog below your generated one, just add `<!-- auto-changelog-above -->` to your current changelog. The generated changelog will be added above this token, and anything below will remain.
|
||||
|
||||
#### Configuration
|
||||
|
||||
You can set any option in `package.json` under the `auto-changelog` key, using camelCase options.
|
||||
|
||||
```js
|
||||
{
|
||||
"name": "my-awesome-package",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
// ...
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "HISTORY.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": true,
|
||||
"commitLimit": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can also store config options in an `.auto-changelog` file in your project root:
|
||||
|
||||
```js
|
||||
{
|
||||
"output": "HISTORY.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": true,
|
||||
"commitLimit": false
|
||||
}
|
||||
```
|
||||
|
||||
Note that any options set in `package.json` will take precedence over any set in `.auto-changelog`.
|
||||
|
||||
#### Tag prefixes
|
||||
|
||||
Use `--tag-prefix [prefix]` if you prefix your version tags with a certain string:
|
||||
|
||||
```bash
|
||||
# When all versions are tagged like my-package/1.2.3
|
||||
auto-changelog --tag-prefix my-package/
|
||||
```
|
||||
|
||||
#### Tag patterns
|
||||
|
||||
By default, `auto-changelog` looks for valid semver tags to build a list of releases. If you are using another format (or want to include all tags), use `--tag-pattern [regex]`:
|
||||
|
||||
```bash
|
||||
# When all versions are tagged like build-12345
|
||||
auto-changelog --tag-pattern build-\d+
|
||||
|
||||
# Include any tag as a release
|
||||
auto-changelog --tag-pattern .+
|
||||
```
|
||||
|
||||
#### Breaking changes
|
||||
|
||||
If you use a common pattern in your commit messages for breaking changes, use `--breaking-pattern` to highlight those commits as breaking changes in your changelog. Breaking change commits will always be listed as part of a release, regardless of any `--commit-limit` set.
|
||||
|
||||
```bash
|
||||
auto-changelog --breaking-pattern "BREAKING CHANGE:"
|
||||
```
|
||||
|
||||
#### Custom issue patterns
|
||||
|
||||
By default, `auto-changelog` will parse [GitHub-style issue fixes](https://help.github.com/articles/closing-issues-using-keywords/) in your commit messages. If you use Jira or an alternative pattern in your commits to reference issues, you can pass in a custom regular expression to `--issue-pattern` along with `--issue-url`:
|
||||
|
||||
```bash
|
||||
# Parse Jira-style issues in your commit messages, like PROJECT-418
|
||||
auto-changelog --issue-pattern [A-Z]+-\d+ --issue-url https://issues.apache.org/jira/browse/{id}
|
||||
```
|
||||
|
||||
Or, in your `package.json`:
|
||||
|
||||
```js
|
||||
{
|
||||
"name": "my-awesome-package",
|
||||
"auto-changelog": {
|
||||
"issueUrl": "https://issues.apache.org/jira/browse/{id}",
|
||||
"issuePattern": "[A-Z]+-\d+"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you use a certain pattern before or after the issue number, like `fixes {id}`, just use a capturing group:
|
||||
|
||||
```bash
|
||||
# "This commit fixes ISSUE-123" will now parse ISSUE-123 as an issue fix
|
||||
auto-changelog --issue-pattern "[Ff]ixes ([A-Z]+-\d+)"
|
||||
```
|
||||
|
||||
#### Custom templates
|
||||
|
||||
If you aren’t happy with the default templates or want to tweak something, you can point to a [handlebars](https://handlebarsjs.com) template in your local repo. Check out the [existing templates](templates) to see what is possible.
|
||||
|
||||
Save `changelog-template.hbs` somewhere in your repo:
|
||||
|
||||
```hbs
|
||||
### Changelog
|
||||
My custom changelog template. Don’t worry about indentation here; it is automatically removed from the output.
|
||||
|
||||
{{#each releases}}
|
||||
Every release has a {{title}} and a {{href}} you can use to link to the commit diff.
|
||||
It also has an {{isoDate}} and a {{niceDate}} you might want to use.
|
||||
{{#each merges}}
|
||||
- A merge has a {{message}}, an {{id}} and a {{href}} to the PR.
|
||||
{{/each}}
|
||||
{{#each fixes}}
|
||||
- Each fix has a {{commit}} with a {{commit.subject}}, an {{id}} and a {{href}} to the fixed issue.
|
||||
{{/each}}
|
||||
{{#each commits}}
|
||||
- Commits have a {{shorthash}}, a {{subject}} and a {{href}}, amongst other things.
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
```
|
||||
|
||||
Then just use `--template` to point to your template:
|
||||
|
||||
```bash
|
||||
auto-changelog --template changelog-template.hbs
|
||||
```
|
||||
|
||||
You can also point to an external template by passing in a URL:
|
||||
|
||||
```bash
|
||||
auto-changelog --template https://example.com/templates/compact.hbs
|
||||
```
|
||||
|
||||
To see exactly what data is passed in to the templates, you can generate a JSON version of the changelog:
|
||||
|
||||
```bash
|
||||
auto-changelog --template json --output changelog-data.json
|
||||
```
|
||||
|
||||
#### `commit-list` helper
|
||||
|
||||
Use `{{#commit-list}}` to render a list of commits depending on certain patterns in the commit messages:
|
||||
|
||||
```hbs
|
||||
{{#each releases}}
|
||||
### [{{title}}]({{href}})
|
||||
|
||||
{{! List commits with `Breaking change: ` somewhere in the message }}
|
||||
{{#commit-list commits heading='### Breaking Changes' message='Breaking change: '}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}})
|
||||
{{/commit-list}}
|
||||
|
||||
{{! List commits that add new features, but not those already listed above }}
|
||||
{{#commit-list commits heading='### New Features' message='feat: ' exclude='Breaking change: '}}
|
||||
- {{subject}} [`{{shorthash}}`]({{href}})
|
||||
{{/commit-list}}
|
||||
{{/each}}
|
||||
```
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ----------- |
|
||||
| `heading` | A heading for the list, only renders if at least one commit matches |
|
||||
| `message` | A regex pattern to match against the entire commit message |
|
||||
| `subject` | A regex pattern to match against the commit subject only |
|
||||
| `exclude` | A regex pattern to exclude from the list – useful for avoiding listing commits more than once |
|
||||
|
||||
#### Replacing text
|
||||
|
||||
To insert links or other markup to PR titles and commit messages that appear in the log, use the `replaceText` option in your `package.json`:
|
||||
|
||||
```js
|
||||
{
|
||||
"name": "my-awesome-package",
|
||||
"auto-changelog": {
|
||||
"replaceText": {
|
||||
"(ABC-\\d+)": "[`$1`](https://issues.apache.org/jira/browse/$1)"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Here, any time a pattern like `ABC-123` appears in your log, it will be replaced with a link to the relevant issue in Jira. Each pattern is applied using `string.replace(new RegExp(key, 'g'), value)`.
|
||||
|
||||
#### Handlebars setup file
|
||||
|
||||
The `--handlebars-setup` options allows you to point to a file to add custom Handlebars helpers, for use in custom templates using `--template`. Paths are relative to the directory in which you run `auto-changelog`.
|
||||
|
||||
```js
|
||||
auto-changelog --handlebars-setup setup.js --template custom-template.hbs
|
||||
|
||||
// setup.js
|
||||
module.exports = function (Handlebars) {
|
||||
Handlebars.registerHelper('custom', function (context, options) {
|
||||
return 'custom helpers!'
|
||||
})
|
||||
}
|
||||
|
||||
// custom-template.hbs
|
||||
Now you can use {{custom}}
|
||||
```
|
||||
|
||||
### FAQ
|
||||
|
||||
#### What’s a changelog?
|
||||
|
||||
See [keepachangelog.com](https://keepachangelog.com).
|
||||
|
||||
#### What does this do?
|
||||
|
||||
The command parses your git commit history and generates a changelog based on tagged versions, merged pull requests and closed issues. See a simple example in [this very repo](CHANGELOG.md).
|
||||
|
||||
#### Why do I need it?
|
||||
|
||||
Because keeping a changelog can be tedious and difficult to get right. If you don’t have the patience for a hand-crafted, bespoke changelog then this makes keeping one rather easy. It also can be [automated if you’re feeling extra lazy](#what-you-might-do-if-youre-clever).
|
||||
@@ -0,0 +1,48 @@
|
||||
var test = require('tape');
|
||||
var ErrorWithCause = require('error-cause/Error');
|
||||
|
||||
var inspect = require('../');
|
||||
|
||||
test('type error', function (t) {
|
||||
t.plan(1);
|
||||
var aerr = new TypeError();
|
||||
aerr.foo = 555;
|
||||
aerr.bar = [1, 2, 3];
|
||||
|
||||
var berr = new TypeError('tuv');
|
||||
berr.baz = 555;
|
||||
|
||||
var cerr = new SyntaxError();
|
||||
cerr.message = 'whoa';
|
||||
cerr['a-b'] = 5;
|
||||
|
||||
var withCause = new ErrorWithCause('foo', { cause: 'bar' });
|
||||
var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' });
|
||||
withCausePlus.foo = 'bar';
|
||||
var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined });
|
||||
var withEnumerableCause = new Error('foo');
|
||||
withEnumerableCause.cause = 'bar';
|
||||
|
||||
var obj = [
|
||||
new TypeError(),
|
||||
new TypeError('xxx'),
|
||||
aerr,
|
||||
berr,
|
||||
cerr,
|
||||
withCause,
|
||||
withCausePlus,
|
||||
withUndefinedCause,
|
||||
withEnumerableCause
|
||||
];
|
||||
t.equal(inspect(obj), '[ ' + [
|
||||
'[TypeError]',
|
||||
'[TypeError: xxx]',
|
||||
'{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }',
|
||||
'{ [TypeError: tuv] baz: 555 }',
|
||||
'{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }',
|
||||
'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }',
|
||||
'{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }',
|
||||
'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }',
|
||||
'{ [Error: foo] cause: \'bar\' }'
|
||||
].join(', ') + ' ]');
|
||||
});
|
||||
@@ -0,0 +1,246 @@
|
||||
JS-YAML - YAML 1.2 parser / writer for JavaScript
|
||||
=================================================
|
||||
|
||||
[](https://github.com/nodeca/js-yaml/actions)
|
||||
[](https://www.npmjs.org/package/js-yaml)
|
||||
|
||||
__[Online Demo](http://nodeca.github.com/js-yaml/)__
|
||||
|
||||
|
||||
This is an implementation of [YAML](http://yaml.org/), a human-friendly data
|
||||
serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
|
||||
completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
### YAML module for node.js
|
||||
|
||||
```
|
||||
npm install js-yaml
|
||||
```
|
||||
|
||||
|
||||
### CLI executable
|
||||
|
||||
If you want to inspect your YAML files from CLI, install js-yaml globally:
|
||||
|
||||
```
|
||||
npm install -g js-yaml
|
||||
```
|
||||
|
||||
#### Usage
|
||||
|
||||
```
|
||||
usage: js-yaml [-h] [-v] [-c] [-t] file
|
||||
|
||||
Positional arguments:
|
||||
file File with YAML document(s)
|
||||
|
||||
Optional arguments:
|
||||
-h, --help Show this help message and exit.
|
||||
-v, --version Show program's version number and exit.
|
||||
-c, --compact Display errors in compact mode
|
||||
-t, --trace Show stack trace on error
|
||||
```
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
Here we cover the most 'useful' methods. If you need advanced details (creating
|
||||
your own tags), see [examples](https://github.com/nodeca/js-yaml/tree/master/examples)
|
||||
for more info.
|
||||
|
||||
``` javascript
|
||||
const yaml = require('js-yaml');
|
||||
const fs = require('fs');
|
||||
|
||||
// Get document, or throw exception on error
|
||||
try {
|
||||
const doc = yaml.load(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
|
||||
console.log(doc);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### load (string [ , options ])
|
||||
|
||||
Parses `string` as single YAML document. Returns either a
|
||||
plain object, a string, a number, `null` or `undefined`, or throws `YAMLException` on error. By default, does
|
||||
not support regexps, functions and undefined.
|
||||
|
||||
options:
|
||||
|
||||
- `filename` _(default: null)_ - string to be used as a file path in
|
||||
error/warning messages.
|
||||
- `onWarning` _(default: null)_ - function to call on warning messages.
|
||||
Loader will call this function with an instance of `YAMLException` for each warning.
|
||||
- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use.
|
||||
- `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
|
||||
http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
- `JSON_SCHEMA` - all JSON-supported types:
|
||||
http://www.yaml.org/spec/1.2/spec.html#id2803231
|
||||
- `CORE_SCHEMA` - same as `JSON_SCHEMA`:
|
||||
http://www.yaml.org/spec/1.2/spec.html#id2804923
|
||||
- `DEFAULT_SCHEMA` - all supported YAML types.
|
||||
- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
|
||||
|
||||
NOTE: This function **does not** understand multi-document sources, it throws
|
||||
exception on those.
|
||||
|
||||
NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
|
||||
So, the JSON schema is not as strictly defined in the YAML specification.
|
||||
It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
|
||||
The core schema also has no such restrictions. It allows binary notation for integers.
|
||||
|
||||
|
||||
### loadAll (string [, iterator] [, options ])
|
||||
|
||||
Same as `load()`, but understands multi-document sources. Applies
|
||||
`iterator` to each document if specified, or returns array of documents.
|
||||
|
||||
``` javascript
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
yaml.loadAll(data, function (doc) {
|
||||
console.log(doc);
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
### dump (object [ , options ])
|
||||
|
||||
Serializes `object` as a YAML document. Uses `DEFAULT_SCHEMA`, so it will
|
||||
throw an exception if you try to dump regexps or functions. However, you can
|
||||
disable exceptions by setting the `skipInvalid` option to `true`.
|
||||
|
||||
options:
|
||||
|
||||
- `indent` _(default: 2)_ - indentation width to use (in spaces).
|
||||
- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements
|
||||
- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
|
||||
in the safe schema) and skip pairs and single values with such types.
|
||||
- `flowLevel` _(default: -1)_ - specifies level of nesting, when to switch from
|
||||
block to flow style for collections. -1 means block style everwhere
|
||||
- `styles` - "tag" => "style" map. Each tag may have own set of styles.
|
||||
- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use.
|
||||
- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
|
||||
function, use the function to sort the keys.
|
||||
- `lineWidth` _(default: `80`)_ - set max line width. Set `-1` for unlimited width.
|
||||
- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references
|
||||
- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older
|
||||
yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1
|
||||
- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded.
|
||||
- `quotingType` _(`'` or `"`, default: `'`)_ - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters.
|
||||
- `forceQuotes` _(default: `false`)_ - if `true`, all non-key strings will be quoted even if they normally don't need to.
|
||||
- `replacer` - callback `function (key, value)` called recursively on each key/value in source object (see `replacer` docs for `JSON.stringify`).
|
||||
|
||||
The following table show availlable styles (e.g. "canonical",
|
||||
"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
|
||||
output is shown on the right side after `=>` (default setting) or `->`:
|
||||
|
||||
``` none
|
||||
!!null
|
||||
"canonical" -> "~"
|
||||
"lowercase" => "null"
|
||||
"uppercase" -> "NULL"
|
||||
"camelcase" -> "Null"
|
||||
|
||||
!!int
|
||||
"binary" -> "0b1", "0b101010", "0b1110001111010"
|
||||
"octal" -> "0o1", "0o52", "0o16172"
|
||||
"decimal" => "1", "42", "7290"
|
||||
"hexadecimal" -> "0x1", "0x2A", "0x1C7A"
|
||||
|
||||
!!bool
|
||||
"lowercase" => "true", "false"
|
||||
"uppercase" -> "TRUE", "FALSE"
|
||||
"camelcase" -> "True", "False"
|
||||
|
||||
!!float
|
||||
"lowercase" => ".nan", '.inf'
|
||||
"uppercase" -> ".NAN", '.INF'
|
||||
"camelcase" -> ".NaN", '.Inf'
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` javascript
|
||||
dump(object, {
|
||||
'styles': {
|
||||
'!!null': 'canonical' // dump null as ~
|
||||
},
|
||||
'sortKeys': true // sort object keys
|
||||
});
|
||||
```
|
||||
|
||||
Supported YAML types
|
||||
--------------------
|
||||
|
||||
The list of standard YAML tags and corresponding JavaScript types. See also
|
||||
[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and
|
||||
[YAML types repository](http://yaml.org/type/).
|
||||
|
||||
```
|
||||
!!null '' # null
|
||||
!!bool 'yes' # bool
|
||||
!!int '3...' # number
|
||||
!!float '3.14...' # number
|
||||
!!binary '...base64...' # buffer
|
||||
!!timestamp 'YYYY-...' # date
|
||||
!!omap [ ... ] # array of key-value pairs
|
||||
!!pairs [ ... ] # array or array pairs
|
||||
!!set { ... } # array of objects with given keys and null values
|
||||
!!str '...' # string
|
||||
!!seq [ ... ] # array
|
||||
!!map { ... } # object
|
||||
```
|
||||
|
||||
**JavaScript-specific tags**
|
||||
|
||||
See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for
|
||||
extra types.
|
||||
|
||||
|
||||
Caveats
|
||||
-------
|
||||
|
||||
Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
|
||||
or arrays as keys, and stringifies (by calling `toString()` method) them at the
|
||||
moment of adding them.
|
||||
|
||||
``` yaml
|
||||
---
|
||||
? [ foo, bar ]
|
||||
: - baz
|
||||
? { foo: bar }
|
||||
: - baz
|
||||
- baz
|
||||
```
|
||||
|
||||
``` javascript
|
||||
{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] }
|
||||
```
|
||||
|
||||
Also, reading of properties on implicit block mapping keys is not supported yet.
|
||||
So, the following YAML document cannot be loaded.
|
||||
|
||||
``` yaml
|
||||
&anchor foo:
|
||||
foo: bar
|
||||
*anchor: duplicate key
|
||||
baz: bat
|
||||
*anchor: duplicate key
|
||||
```
|
||||
|
||||
|
||||
js-yaml for enterprise
|
||||
----------------------
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
Reference in New Issue
Block a user