new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import { Octokit } from "@octokit/core";
|
||||
import { EndpointsDefaultsAndDecorations } from "./types";
|
||||
import { RestEndpointMethods } from "./generated/method-types";
|
||||
export declare function endpointsToMethods(octokit: Octokit, endpointsMap: EndpointsDefaultsAndDecorations): RestEndpointMethods;
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var callable = require("../../object/valid-callable")
|
||||
, apply = Function.prototype.apply;
|
||||
|
||||
module.exports = function (/* …args*/) {
|
||||
var fn = callable(this), args = arguments;
|
||||
|
||||
return function () { return apply.call(fn, this, args); };
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
var baseClamp = require('./_baseClamp'),
|
||||
toInteger = require('./toInteger');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
/**
|
||||
* Converts `value` to a safe integer. A safe integer can be compared and
|
||||
* represented correctly.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @example
|
||||
*
|
||||
* _.toSafeInteger(3.2);
|
||||
* // => 3
|
||||
*
|
||||
* _.toSafeInteger(Number.MIN_VALUE);
|
||||
* // => 0
|
||||
*
|
||||
* _.toSafeInteger(Infinity);
|
||||
* // => 9007199254740991
|
||||
*
|
||||
* _.toSafeInteger('3.2');
|
||||
* // => 3
|
||||
*/
|
||||
function toSafeInteger(value) {
|
||||
return value
|
||||
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
|
||||
: (value === 0 ? value : 0);
|
||||
}
|
||||
|
||||
module.exports = toSafeInteger;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"exhaust.js","sourceRoot":"","sources":["../../../../src/internal/operators/exhaust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC"}
|
||||
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var toPrimitive = require('es-to-primitive/es2015');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-toprimitive
|
||||
|
||||
module.exports = function ToPrimitive(input) {
|
||||
if (arguments.length > 1) {
|
||||
return toPrimitive(input, arguments[1]);
|
||||
}
|
||||
return toPrimitive(input);
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('assignIn', require('../assignIn'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var resolveSeq = require('./resolveSeq-d03cb037.js');
|
||||
var Schema = require('./Schema-88e323a7.js');
|
||||
require('./PlainValue-ec8e588e.js');
|
||||
require('./warnings-1000a372.js');
|
||||
|
||||
|
||||
|
||||
exports.Alias = resolveSeq.Alias;
|
||||
exports.Collection = resolveSeq.Collection;
|
||||
exports.Merge = resolveSeq.Merge;
|
||||
exports.Node = resolveSeq.Node;
|
||||
exports.Pair = resolveSeq.Pair;
|
||||
exports.Scalar = resolveSeq.Scalar;
|
||||
exports.YAMLMap = resolveSeq.YAMLMap;
|
||||
exports.YAMLSeq = resolveSeq.YAMLSeq;
|
||||
exports.binaryOptions = resolveSeq.binaryOptions;
|
||||
exports.boolOptions = resolveSeq.boolOptions;
|
||||
exports.intOptions = resolveSeq.intOptions;
|
||||
exports.nullOptions = resolveSeq.nullOptions;
|
||||
exports.strOptions = resolveSeq.strOptions;
|
||||
exports.Schema = Schema.Schema;
|
||||
@@ -0,0 +1,11 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function map(project, thisArg) {
|
||||
return operate(function (source, subscriber) {
|
||||
var index = 0;
|
||||
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
||||
subscriber.next(project.call(thisArg, value, index++));
|
||||
}));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=map.js.map
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line.
|
||||
|
||||
@example
|
||||
```
|
||||
import shebangRegex = require('shebang-regex');
|
||||
|
||||
const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
|
||||
|
||||
shebangRegex.test(string);
|
||||
//=> true
|
||||
|
||||
shebangRegex.exec(string)[0];
|
||||
//=> '#!/usr/bin/env node'
|
||||
|
||||
shebangRegex.exec(string)[1];
|
||||
//=> '/usr/bin/env node'
|
||||
```
|
||||
*/
|
||||
declare const shebangRegex: RegExp;
|
||||
|
||||
export = shebangRegex;
|
||||
@@ -0,0 +1,340 @@
|
||||
import {isIP} from 'node:net';
|
||||
|
||||
/**
|
||||
* @external URL
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL|URL}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @module utils/referrer
|
||||
* @private
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#strip-url|Referrer Policy §8.4. Strip url for use as a referrer}
|
||||
* @param {string} URL
|
||||
* @param {boolean} [originOnly=false]
|
||||
*/
|
||||
export function stripURLForUseAsAReferrer(url, originOnly = false) {
|
||||
// 1. If url is null, return no referrer.
|
||||
if (url == null) { // eslint-disable-line no-eq-null, eqeqeq
|
||||
return 'no-referrer';
|
||||
}
|
||||
|
||||
url = new URL(url);
|
||||
|
||||
// 2. If url's scheme is a local scheme, then return no referrer.
|
||||
if (/^(about|blob|data):$/.test(url.protocol)) {
|
||||
return 'no-referrer';
|
||||
}
|
||||
|
||||
// 3. Set url's username to the empty string.
|
||||
url.username = '';
|
||||
|
||||
// 4. Set url's password to null.
|
||||
// Note: `null` appears to be a mistake as this actually results in the password being `"null"`.
|
||||
url.password = '';
|
||||
|
||||
// 5. Set url's fragment to null.
|
||||
// Note: `null` appears to be a mistake as this actually results in the fragment being `"#null"`.
|
||||
url.hash = '';
|
||||
|
||||
// 6. If the origin-only flag is true, then:
|
||||
if (originOnly) {
|
||||
// 6.1. Set url's path to null.
|
||||
// Note: `null` appears to be a mistake as this actually results in the path being `"/null"`.
|
||||
url.pathname = '';
|
||||
|
||||
// 6.2. Set url's query to null.
|
||||
// Note: `null` appears to be a mistake as this actually results in the query being `"?null"`.
|
||||
url.search = '';
|
||||
}
|
||||
|
||||
// 7. Return url.
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy|enum ReferrerPolicy}
|
||||
*/
|
||||
export const ReferrerPolicy = new Set([
|
||||
'',
|
||||
'no-referrer',
|
||||
'no-referrer-when-downgrade',
|
||||
'same-origin',
|
||||
'origin',
|
||||
'strict-origin',
|
||||
'origin-when-cross-origin',
|
||||
'strict-origin-when-cross-origin',
|
||||
'unsafe-url'
|
||||
]);
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#default-referrer-policy|default referrer policy}
|
||||
*/
|
||||
export const DEFAULT_REFERRER_POLICY = 'strict-origin-when-cross-origin';
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#referrer-policies|Referrer Policy §3. Referrer Policies}
|
||||
* @param {string} referrerPolicy
|
||||
* @returns {string} referrerPolicy
|
||||
*/
|
||||
export function validateReferrerPolicy(referrerPolicy) {
|
||||
if (!ReferrerPolicy.has(referrerPolicy)) {
|
||||
throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);
|
||||
}
|
||||
|
||||
return referrerPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy|Referrer Policy §3.2. Is origin potentially trustworthy?}
|
||||
* @param {external:URL} url
|
||||
* @returns `true`: "Potentially Trustworthy", `false`: "Not Trustworthy"
|
||||
*/
|
||||
export function isOriginPotentiallyTrustworthy(url) {
|
||||
// 1. If origin is an opaque origin, return "Not Trustworthy".
|
||||
// Not applicable
|
||||
|
||||
// 2. Assert: origin is a tuple origin.
|
||||
// Not for implementations
|
||||
|
||||
// 3. If origin's scheme is either "https" or "wss", return "Potentially Trustworthy".
|
||||
if (/^(http|ws)s:$/.test(url.protocol)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 4. If origin's host component matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return "Potentially Trustworthy".
|
||||
const hostIp = url.host.replace(/(^\[)|(]$)/g, '');
|
||||
const hostIPVersion = isIP(hostIp);
|
||||
|
||||
if (hostIPVersion === 4 && /^127\./.test(hostIp)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 5. If origin's host component is "localhost" or falls within ".localhost", and the user agent conforms to the name resolution rules in [let-localhost-be-localhost], return "Potentially Trustworthy".
|
||||
// We are returning FALSE here because we cannot ensure conformance to
|
||||
// let-localhost-be-loalhost (https://tools.ietf.org/html/draft-west-let-localhost-be-localhost)
|
||||
if (url.host === 'localhost' || url.host.endsWith('.localhost')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 6. If origin's scheme component is file, return "Potentially Trustworthy".
|
||||
if (url.protocol === 'file:') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 7. If origin's scheme component is one which the user agent considers to be authenticated, return "Potentially Trustworthy".
|
||||
// Not supported
|
||||
|
||||
// 8. If origin has been configured as a trustworthy origin, return "Potentially Trustworthy".
|
||||
// Not supported
|
||||
|
||||
// 9. Return "Not Trustworthy".
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy|Referrer Policy §3.3. Is url potentially trustworthy?}
|
||||
* @param {external:URL} url
|
||||
* @returns `true`: "Potentially Trustworthy", `false`: "Not Trustworthy"
|
||||
*/
|
||||
export function isUrlPotentiallyTrustworthy(url) {
|
||||
// 1. If url is "about:blank" or "about:srcdoc", return "Potentially Trustworthy".
|
||||
if (/^about:(blank|srcdoc)$/.test(url)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2. If url's scheme is "data", return "Potentially Trustworthy".
|
||||
if (url.protocol === 'data:') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Note: The origin of blob: and filesystem: URLs is the origin of the context in which they were
|
||||
// created. Therefore, blobs created in a trustworthy origin will themselves be potentially
|
||||
// trustworthy.
|
||||
if (/^(blob|filesystem):$/.test(url.protocol)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 3. Return the result of executing §3.2 Is origin potentially trustworthy? on url's origin.
|
||||
return isOriginPotentiallyTrustworthy(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifies the referrerURL to enforce any extra security policy considerations.
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}, step 7
|
||||
* @callback module:utils/referrer~referrerURLCallback
|
||||
* @param {external:URL} referrerURL
|
||||
* @returns {external:URL} modified referrerURL
|
||||
*/
|
||||
|
||||
/**
|
||||
* Modifies the referrerOrigin to enforce any extra security policy considerations.
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}, step 7
|
||||
* @callback module:utils/referrer~referrerOriginCallback
|
||||
* @param {external:URL} referrerOrigin
|
||||
* @returns {external:URL} modified referrerOrigin
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer|Referrer Policy §8.3. Determine request's Referrer}
|
||||
* @param {Request} request
|
||||
* @param {object} o
|
||||
* @param {module:utils/referrer~referrerURLCallback} o.referrerURLCallback
|
||||
* @param {module:utils/referrer~referrerOriginCallback} o.referrerOriginCallback
|
||||
* @returns {external:URL} Request's referrer
|
||||
*/
|
||||
export function determineRequestsReferrer(request, {referrerURLCallback, referrerOriginCallback} = {}) {
|
||||
// There are 2 notes in the specification about invalid pre-conditions. We return null, here, for
|
||||
// these cases:
|
||||
// > Note: If request's referrer is "no-referrer", Fetch will not call into this algorithm.
|
||||
// > Note: If request's referrer policy is the empty string, Fetch will not call into this
|
||||
// > algorithm.
|
||||
if (request.referrer === 'no-referrer' || request.referrerPolicy === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 1. Let policy be request's associated referrer policy.
|
||||
const policy = request.referrerPolicy;
|
||||
|
||||
// 2. Let environment be request's client.
|
||||
// not applicable to node.js
|
||||
|
||||
// 3. Switch on request's referrer:
|
||||
if (request.referrer === 'about:client') {
|
||||
return 'no-referrer';
|
||||
}
|
||||
|
||||
// "a URL": Let referrerSource be request's referrer.
|
||||
const referrerSource = request.referrer;
|
||||
|
||||
// 4. Let request's referrerURL be the result of stripping referrerSource for use as a referrer.
|
||||
let referrerURL = stripURLForUseAsAReferrer(referrerSource);
|
||||
|
||||
// 5. Let referrerOrigin be the result of stripping referrerSource for use as a referrer, with the
|
||||
// origin-only flag set to true.
|
||||
let referrerOrigin = stripURLForUseAsAReferrer(referrerSource, true);
|
||||
|
||||
// 6. If the result of serializing referrerURL is a string whose length is greater than 4096, set
|
||||
// referrerURL to referrerOrigin.
|
||||
if (referrerURL.toString().length > 4096) {
|
||||
referrerURL = referrerOrigin;
|
||||
}
|
||||
|
||||
// 7. The user agent MAY alter referrerURL or referrerOrigin at this point to enforce arbitrary
|
||||
// policy considerations in the interests of minimizing data leakage. For example, the user
|
||||
// agent could strip the URL down to an origin, modify its host, replace it with an empty
|
||||
// string, etc.
|
||||
if (referrerURLCallback) {
|
||||
referrerURL = referrerURLCallback(referrerURL);
|
||||
}
|
||||
|
||||
if (referrerOriginCallback) {
|
||||
referrerOrigin = referrerOriginCallback(referrerOrigin);
|
||||
}
|
||||
|
||||
// 8.Execute the statements corresponding to the value of policy:
|
||||
const currentURL = new URL(request.url);
|
||||
|
||||
switch (policy) {
|
||||
case 'no-referrer':
|
||||
return 'no-referrer';
|
||||
|
||||
case 'origin':
|
||||
return referrerOrigin;
|
||||
|
||||
case 'unsafe-url':
|
||||
return referrerURL;
|
||||
|
||||
case 'strict-origin':
|
||||
// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a
|
||||
// potentially trustworthy URL, then return no referrer.
|
||||
if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {
|
||||
return 'no-referrer';
|
||||
}
|
||||
|
||||
// 2. Return referrerOrigin.
|
||||
return referrerOrigin.toString();
|
||||
|
||||
case 'strict-origin-when-cross-origin':
|
||||
// 1. If the origin of referrerURL and the origin of request's current URL are the same, then
|
||||
// return referrerURL.
|
||||
if (referrerURL.origin === currentURL.origin) {
|
||||
return referrerURL;
|
||||
}
|
||||
|
||||
// 2. If referrerURL is a potentially trustworthy URL and request's current URL is not a
|
||||
// potentially trustworthy URL, then return no referrer.
|
||||
if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {
|
||||
return 'no-referrer';
|
||||
}
|
||||
|
||||
// 3. Return referrerOrigin.
|
||||
return referrerOrigin;
|
||||
|
||||
case 'same-origin':
|
||||
// 1. If the origin of referrerURL and the origin of request's current URL are the same, then
|
||||
// return referrerURL.
|
||||
if (referrerURL.origin === currentURL.origin) {
|
||||
return referrerURL;
|
||||
}
|
||||
|
||||
// 2. Return no referrer.
|
||||
return 'no-referrer';
|
||||
|
||||
case 'origin-when-cross-origin':
|
||||
// 1. If the origin of referrerURL and the origin of request's current URL are the same, then
|
||||
// return referrerURL.
|
||||
if (referrerURL.origin === currentURL.origin) {
|
||||
return referrerURL;
|
||||
}
|
||||
|
||||
// Return referrerOrigin.
|
||||
return referrerOrigin;
|
||||
|
||||
case 'no-referrer-when-downgrade':
|
||||
// 1. If referrerURL is a potentially trustworthy URL and request's current URL is not a
|
||||
// potentially trustworthy URL, then return no referrer.
|
||||
if (isUrlPotentiallyTrustworthy(referrerURL) && !isUrlPotentiallyTrustworthy(currentURL)) {
|
||||
return 'no-referrer';
|
||||
}
|
||||
|
||||
// 2. Return referrerURL.
|
||||
return referrerURL;
|
||||
|
||||
default:
|
||||
throw new TypeError(`Invalid referrerPolicy: ${policy}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header|Referrer Policy §8.1. Parse a referrer policy from a Referrer-Policy header}
|
||||
* @param {Headers} headers Response headers
|
||||
* @returns {string} policy
|
||||
*/
|
||||
export function parseReferrerPolicyFromHeader(headers) {
|
||||
// 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy`
|
||||
// and response’s header list.
|
||||
const policyTokens = (headers.get('referrer-policy') || '').split(/[,\s]+/);
|
||||
|
||||
// 2. Let policy be the empty string.
|
||||
let policy = '';
|
||||
|
||||
// 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty
|
||||
// string, then set policy to token.
|
||||
// Note: This algorithm loops over multiple policy values to allow deployment of new policy
|
||||
// values with fallbacks for older user agents, as described in § 11.1 Unknown Policy Values.
|
||||
for (const token of policyTokens) {
|
||||
if (token && ReferrerPolicy.has(token)) {
|
||||
policy = token;
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Return policy.
|
||||
return policy;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
var baseSortedIndexBy = require('./_baseSortedIndexBy'),
|
||||
identity = require('./identity'),
|
||||
isSymbol = require('./isSymbol');
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295,
|
||||
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
|
||||
* performs a binary search of `array` to determine the index at which `value`
|
||||
* should be inserted into `array` in order to maintain its sort order.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The sorted array to inspect.
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {boolean} [retHighest] Specify returning the highest qualified index.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
*/
|
||||
function baseSortedIndex(array, value, retHighest) {
|
||||
var low = 0,
|
||||
high = array == null ? low : array.length;
|
||||
|
||||
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
||||
while (low < high) {
|
||||
var mid = (low + high) >>> 1,
|
||||
computed = array[mid];
|
||||
|
||||
if (computed !== null && !isSymbol(computed) &&
|
||||
(retHighest ? (computed <= value) : (computed < value))) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
high = mid;
|
||||
}
|
||||
}
|
||||
return high;
|
||||
}
|
||||
return baseSortedIndexBy(array, value, identity, retHighest);
|
||||
}
|
||||
|
||||
module.exports = baseSortedIndex;
|
||||
@@ -0,0 +1,53 @@
|
||||
import { __values } from "tslib";
|
||||
import { Subject } from '../Subject';
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
export function windowCount(windowSize, startWindowEvery) {
|
||||
if (startWindowEvery === void 0) { startWindowEvery = 0; }
|
||||
var startEvery = startWindowEvery > 0 ? startWindowEvery : windowSize;
|
||||
return operate(function (source, subscriber) {
|
||||
var windows = [new Subject()];
|
||||
var starts = [];
|
||||
var count = 0;
|
||||
subscriber.next(windows[0].asObservable());
|
||||
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var windows_1 = __values(windows), windows_1_1 = windows_1.next(); !windows_1_1.done; windows_1_1 = windows_1.next()) {
|
||||
var window_1 = windows_1_1.value;
|
||||
window_1.next(value);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (windows_1_1 && !windows_1_1.done && (_a = windows_1.return)) _a.call(windows_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
var c = count - windowSize + 1;
|
||||
if (c >= 0 && c % startEvery === 0) {
|
||||
windows.shift().complete();
|
||||
}
|
||||
if (++count % startEvery === 0) {
|
||||
var window_2 = new Subject();
|
||||
windows.push(window_2);
|
||||
subscriber.next(window_2.asObservable());
|
||||
}
|
||||
}, function () {
|
||||
while (windows.length > 0) {
|
||||
windows.shift().complete();
|
||||
}
|
||||
subscriber.complete();
|
||||
}, function (err) {
|
||||
while (windows.length > 0) {
|
||||
windows.shift().error(err);
|
||||
}
|
||||
subscriber.error(err);
|
||||
}, function () {
|
||||
starts = null;
|
||||
windows = null;
|
||||
}));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=windowCount.js.map
|
||||
@@ -0,0 +1,38 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
||||
/**
|
||||
* Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source
|
||||
* Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable
|
||||
* calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise
|
||||
* this method will resubscribe to the source Observable.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Repeat a message stream on click
|
||||
*
|
||||
* ```ts
|
||||
* import { of, fromEvent, repeatWhen } from 'rxjs';
|
||||
*
|
||||
* const source = of('Repeat message');
|
||||
* const documentClick$ = fromEvent(document, 'click');
|
||||
*
|
||||
* const result = source.pipe(repeatWhen(() => documentClick$));
|
||||
*
|
||||
* result.subscribe(data => console.log(data))
|
||||
* ```
|
||||
*
|
||||
* @see {@link repeat}
|
||||
* @see {@link retry}
|
||||
* @see {@link retryWhen}
|
||||
*
|
||||
* @param notifier Function that receives an Observable of notifications with
|
||||
* which a user can `complete` or `error`, aborting the repetition.
|
||||
* @return A function that returns an `ObservableInput` that mirrors the source
|
||||
* Observable with the exception of a `complete`.
|
||||
* @deprecated Will be removed in v9 or v10. Use {@link repeat}'s {@link RepeatConfig#delay delay} option instead.
|
||||
* Instead of `repeatWhen(() => notify$)`, use: `repeat({ delay: () => notify$ })`.
|
||||
*/
|
||||
export declare function repeatWhen<T>(notifier: (notifications: Observable<void>) => ObservableInput<any>): MonoTypeOperatorFunction<T>;
|
||||
//# sourceMappingURL=repeatWhen.d.ts.map
|
||||
@@ -0,0 +1,201 @@
|
||||
var concatMap = require('concat-map');
|
||||
var balanced = require('balanced-match');
|
||||
|
||||
module.exports = expandTop;
|
||||
|
||||
var escSlash = '\0SLASH'+Math.random()+'\0';
|
||||
var escOpen = '\0OPEN'+Math.random()+'\0';
|
||||
var escClose = '\0CLOSE'+Math.random()+'\0';
|
||||
var escComma = '\0COMMA'+Math.random()+'\0';
|
||||
var escPeriod = '\0PERIOD'+Math.random()+'\0';
|
||||
|
||||
function numeric(str) {
|
||||
return parseInt(str, 10) == str
|
||||
? parseInt(str, 10)
|
||||
: str.charCodeAt(0);
|
||||
}
|
||||
|
||||
function escapeBraces(str) {
|
||||
return str.split('\\\\').join(escSlash)
|
||||
.split('\\{').join(escOpen)
|
||||
.split('\\}').join(escClose)
|
||||
.split('\\,').join(escComma)
|
||||
.split('\\.').join(escPeriod);
|
||||
}
|
||||
|
||||
function unescapeBraces(str) {
|
||||
return str.split(escSlash).join('\\')
|
||||
.split(escOpen).join('{')
|
||||
.split(escClose).join('}')
|
||||
.split(escComma).join(',')
|
||||
.split(escPeriod).join('.');
|
||||
}
|
||||
|
||||
|
||||
// Basically just str.split(","), but handling cases
|
||||
// where we have nested braced sections, which should be
|
||||
// treated as individual members, like {a,{b,c},d}
|
||||
function parseCommaParts(str) {
|
||||
if (!str)
|
||||
return [''];
|
||||
|
||||
var parts = [];
|
||||
var m = balanced('{', '}', str);
|
||||
|
||||
if (!m)
|
||||
return str.split(',');
|
||||
|
||||
var pre = m.pre;
|
||||
var body = m.body;
|
||||
var post = m.post;
|
||||
var p = pre.split(',');
|
||||
|
||||
p[p.length-1] += '{' + body + '}';
|
||||
var postParts = parseCommaParts(post);
|
||||
if (post.length) {
|
||||
p[p.length-1] += postParts.shift();
|
||||
p.push.apply(p, postParts);
|
||||
}
|
||||
|
||||
parts.push.apply(parts, p);
|
||||
|
||||
return parts;
|
||||
}
|
||||
|
||||
function expandTop(str) {
|
||||
if (!str)
|
||||
return [];
|
||||
|
||||
// I don't know why Bash 4.3 does this, but it does.
|
||||
// Anything starting with {} will have the first two bytes preserved
|
||||
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||
// but a{},b}c will be expanded to [a}c,abc].
|
||||
// One could argue that this is a bug in Bash, but since the goal of
|
||||
// this module is to match Bash's rules, we escape a leading {}
|
||||
if (str.substr(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.substr(2);
|
||||
}
|
||||
|
||||
return expand(escapeBraces(str), true).map(unescapeBraces);
|
||||
}
|
||||
|
||||
function identity(e) {
|
||||
return e;
|
||||
}
|
||||
|
||||
function embrace(str) {
|
||||
return '{' + str + '}';
|
||||
}
|
||||
function isPadded(el) {
|
||||
return /^-?0\d/.test(el);
|
||||
}
|
||||
|
||||
function lte(i, y) {
|
||||
return i <= y;
|
||||
}
|
||||
function gte(i, y) {
|
||||
return i >= y;
|
||||
}
|
||||
|
||||
function expand(str, isTop) {
|
||||
var expansions = [];
|
||||
|
||||
var m = balanced('{', '}', str);
|
||||
if (!m || /\$$/.test(m.pre)) return [str];
|
||||
|
||||
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isSequence = isNumericSequence || isAlphaSequence;
|
||||
var isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,.*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
return expand(str);
|
||||
}
|
||||
return [str];
|
||||
}
|
||||
|
||||
var n;
|
||||
if (isSequence) {
|
||||
n = m.body.split(/\.\./);
|
||||
} else {
|
||||
n = parseCommaParts(m.body);
|
||||
if (n.length === 1) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand(n[0], false).map(embrace);
|
||||
if (n.length === 1) {
|
||||
var post = m.post.length
|
||||
? expand(m.post, false)
|
||||
: [''];
|
||||
return post.map(function(p) {
|
||||
return m.pre + n[0] + p;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// at this point, n is the parts, and we know it's not a comma set
|
||||
// with a single entry.
|
||||
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
var pre = m.pre;
|
||||
var post = m.post.length
|
||||
? expand(m.post, false)
|
||||
: [''];
|
||||
|
||||
var N;
|
||||
|
||||
if (isSequence) {
|
||||
var x = numeric(n[0]);
|
||||
var y = numeric(n[1]);
|
||||
var width = Math.max(n[0].length, n[1].length)
|
||||
var incr = n.length == 3
|
||||
? Math.abs(numeric(n[2]))
|
||||
: 1;
|
||||
var test = lte;
|
||||
var reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
var pad = n.some(isPadded);
|
||||
|
||||
N = [];
|
||||
|
||||
for (var i = x; test(i, y); i += incr) {
|
||||
var c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\')
|
||||
c = '';
|
||||
} else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
var need = width - c.length;
|
||||
if (need > 0) {
|
||||
var z = new Array(need + 1).join('0');
|
||||
if (i < 0)
|
||||
c = '-' + z + c.slice(1);
|
||||
else
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
} else {
|
||||
N = concatMap(n, function(el) { return expand(el, false) });
|
||||
}
|
||||
|
||||
for (var j = 0; j < N.length; j++) {
|
||||
for (var k = 0; k < post.length; k++) {
|
||||
var expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion)
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
|
||||
return expansions;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scheduleArray.js","sourceRoot":"","sources":["../../../../src/internal/scheduled/scheduleArray.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAG3C,SAAgB,aAAa,CAAI,KAAmB,EAAE,SAAwB;IAC5E,OAAO,IAAI,uBAAU,CAAI,UAAC,UAAU;QAElC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEV,OAAO,SAAS,CAAC,QAAQ,CAAC;YACxB,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,EAAE;gBAGtB,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvB;iBAAM;gBAGL,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAI5B,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;oBACtB,IAAI,CAAC,QAAQ,EAAE,CAAC;iBACjB;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAvBD,sCAuBC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,IAAI,CACZ,OAAqB,EACrB,IAAY;IAEZ,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAM,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAA8B,CAAC;IACtE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACpB,OAAO,CAAC,CAAC;AACV,CAAC;AAED,WAAU,IAAI;IAWb,SAAgB,MAAM,CACrB,OAAqB,EACrB,IAAY;QAEZ,IAAI,CAAC,GAA+B,IAAI,CAAC;QACzC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC5C,SAAS,MAAM;gBACd,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,SAAS,OAAO,CAAC,GAAG,IAAW;gBAC9B,MAAM,EAAE,CAAC;gBACT,OAAO,CAAC,IAAS,CAAC,CAAC;YACpB,CAAC;YACD,SAAS,OAAO,CAAC,GAAU;gBAC1B,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YACD,CAAC,GAAG,MAAM,CAAC;YACX,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC,CAA8B,CAAC;QAChC,IAAI,CAAC,CAAC,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;SACzD;QACD,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACV,CAAC;IA5Be,WAAM,SA4BrB,CAAA;AACF,CAAC,EAxCS,IAAI,KAAJ,IAAI,QAwCb;AAED,iBAAS,IAAI,CAAC"}
|
||||
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimAssign() {
|
||||
var polyfill = getPolyfill();
|
||||
define(
|
||||
Object,
|
||||
{ assign: polyfill },
|
||||
{ assign: function () { return Object.assign !== polyfill; } }
|
||||
);
|
||||
return polyfill;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import Wrapper from './shared/Wrapper';
|
||||
import Renderer from '../Renderer';
|
||||
import Block from '../Block';
|
||||
import Head from '../../nodes/Head';
|
||||
import FragmentWrapper from './Fragment';
|
||||
import { Identifier } from 'estree';
|
||||
export default class HeadWrapper extends Wrapper {
|
||||
fragment: FragmentWrapper;
|
||||
node: Head;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Head, strip_whitespace: boolean, next_sibling: Wrapper);
|
||||
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.79.1
|
||||
Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
|
||||
Released under the MIT License.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
require('path');
|
||||
require('process');
|
||||
require('url');
|
||||
const loadConfigFile_js = require('./shared/loadConfigFile.js');
|
||||
require('./shared/rollup.js');
|
||||
require('./shared/mergeOptions.js');
|
||||
require('tty');
|
||||
require('perf_hooks');
|
||||
require('crypto');
|
||||
require('fs');
|
||||
require('events');
|
||||
|
||||
|
||||
|
||||
module.exports = loadConfigFile_js.loadAndParseConfigFile;
|
||||
//# sourceMappingURL=loadConfigFile.js.map
|
||||
@@ -0,0 +1,9 @@
|
||||
import Dispatcher from '../../util/dispatcher';
|
||||
export declare abstract class BaseActions<ACTIONS> {
|
||||
private readonly dispatcher;
|
||||
constructor(dispatcher: Dispatcher<any>);
|
||||
protected dispatch<K extends keyof ACTIONS>(
|
||||
type: K,
|
||||
payload: ACTIONS[K],
|
||||
): void;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? Array.prototype.splice : require("./shim");
|
||||
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $replace = callBound('String.prototype.replace');
|
||||
|
||||
var safeRegexTester = require('safe-regex-test');
|
||||
|
||||
var isNonDecimal = safeRegexTester(/^0[ob]|^[+-]0x/);
|
||||
|
||||
// http://262.ecma-international.org/5.1/#sec-9.3
|
||||
|
||||
module.exports = function ToNumber(value) {
|
||||
var prim = ToPrimitive(value, Number);
|
||||
if (typeof prim !== 'string') {
|
||||
return +prim; // eslint-disable-line no-implicit-coercion
|
||||
}
|
||||
|
||||
var trimmed = $replace(
|
||||
prim,
|
||||
// eslint-disable-next-line no-control-regex
|
||||
/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,
|
||||
''
|
||||
);
|
||||
if (isNonDecimal(trimmed)) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
return +trimmed; // eslint-disable-line no-implicit-coercion
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sequenceEqual.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/sequenceEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,EAC7B,UAAU,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAA2B,GACtD,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,CA2D9B"}
|
||||
@@ -0,0 +1,74 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
export function indentRecursive(node, indent = 0) {
|
||||
node.each &&
|
||||
node.each((child, i) => {
|
||||
if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes('\n')) {
|
||||
child.raws.before = `\n${node.type !== 'rule' && i > 0 ? '\n' : ''}${' '.repeat(indent)}`
|
||||
}
|
||||
child.raws.after = `\n${' '.repeat(indent)}`
|
||||
indentRecursive(child, indent + 1)
|
||||
})
|
||||
}
|
||||
|
||||
export function formatNodes(root) {
|
||||
indentRecursive(root)
|
||||
if (root.first) {
|
||||
root.first.raws.before = ''
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When rapidly saving files atomically a couple of situations can happen:
|
||||
* - The file is missing since the external program has deleted it by the time we've gotten around to reading it from the earlier save.
|
||||
* - The file is being written to by the external program by the time we're going to read it and is thus treated as busy because a lock is held.
|
||||
*
|
||||
* To work around this we retry reading the file a handful of times with a delay between each attempt
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {number} tries
|
||||
* @returns {Promise<string | undefined>}
|
||||
* @throws {Error} If the file is still missing or busy after the specified number of tries
|
||||
*/
|
||||
export async function readFileWithRetries(path, tries = 5) {
|
||||
for (let n = 0; n <= tries; n++) {
|
||||
try {
|
||||
return await fs.promises.readFile(path, 'utf8')
|
||||
} catch (err) {
|
||||
if (n !== tries) {
|
||||
if (err.code === 'ENOENT' || err.code === 'EBUSY') {
|
||||
await new Promise((resolve) => setTimeout(resolve, 10))
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
throw err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function drainStdin() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let result = ''
|
||||
process.stdin.on('data', (chunk) => {
|
||||
result += chunk
|
||||
})
|
||||
process.stdin.on('end', () => resolve(result))
|
||||
process.stdin.on('error', (err) => reject(err))
|
||||
})
|
||||
}
|
||||
|
||||
export async function outputFile(file, newContents) {
|
||||
try {
|
||||
let currentContents = await fs.promises.readFile(file, 'utf8')
|
||||
if (currentContents === newContents) {
|
||||
return // Skip writing the file
|
||||
}
|
||||
} catch {}
|
||||
|
||||
// Write the file
|
||||
await fs.promises.mkdir(path.dirname(file), { recursive: true })
|
||||
await fs.promises.writeFile(file, newContents, 'utf8')
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"take.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAKpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAuBlE"}
|
||||
@@ -0,0 +1,85 @@
|
||||
import process from 'node:process';
|
||||
import readline from 'node:readline';
|
||||
import {BufferListStream} from 'bl';
|
||||
|
||||
const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code
|
||||
|
||||
export class StdinDiscarder {
|
||||
#requests = 0;
|
||||
#mutedStream = new BufferListStream();
|
||||
#ourEmit;
|
||||
#rl;
|
||||
|
||||
constructor() {
|
||||
this.#mutedStream.pipe(process.stdout);
|
||||
|
||||
const self = this; // eslint-disable-line unicorn/no-this-assignment
|
||||
this.#ourEmit = function (event, data, ...args) {
|
||||
const {stdin} = process;
|
||||
if (self.#requests > 0 || stdin.emit === self.#ourEmit) {
|
||||
if (event === 'keypress') { // Fixes readline behavior
|
||||
return;
|
||||
}
|
||||
|
||||
if (event === 'data' && data.includes(ASCII_ETX_CODE)) {
|
||||
process.emit('SIGINT');
|
||||
}
|
||||
|
||||
Reflect.apply(self.#ourEmit, this, [event, data, ...args]);
|
||||
} else {
|
||||
Reflect.apply(process.stdin.emit, this, [event, data, ...args]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
start() {
|
||||
this.#requests++;
|
||||
|
||||
if (this.#requests === 1) {
|
||||
this._realStart();
|
||||
}
|
||||
}
|
||||
|
||||
stop() {
|
||||
if (this.#requests <= 0) {
|
||||
throw new Error('`stop` called more times than `start`');
|
||||
}
|
||||
|
||||
this.#requests--;
|
||||
|
||||
if (this.#requests === 0) {
|
||||
this._realStop();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Use private methods when targeting Node.js 14.
|
||||
_realStart() {
|
||||
// No known way to make it work reliably on Windows
|
||||
if (process.platform === 'win32') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.#rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: this.#mutedStream,
|
||||
});
|
||||
|
||||
this.#rl.on('SIGINT', () => {
|
||||
if (process.listenerCount('SIGINT') === 0) {
|
||||
process.emit('SIGINT');
|
||||
} else {
|
||||
this.#rl.close();
|
||||
process.kill(process.pid, 'SIGINT');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_realStop() {
|
||||
if (process.platform === 'win32') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.#rl.close();
|
||||
this.#rl = undefined;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
isSticky: require("./is-sticky"),
|
||||
isUnicode: require("./is-unicode"),
|
||||
match: require("./match"),
|
||||
replace: require("./replace"),
|
||||
search: require("./search"),
|
||||
split: require("./split")
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isIn;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var _toString = _interopRequireDefault(require("./util/toString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function isIn(str, options) {
|
||||
(0, _assertString.default)(str);
|
||||
var i;
|
||||
|
||||
if (Object.prototype.toString.call(options) === '[object Array]') {
|
||||
var array = [];
|
||||
|
||||
for (i in options) {
|
||||
// https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
|
||||
// istanbul ignore else
|
||||
if ({}.hasOwnProperty.call(options, i)) {
|
||||
array[i] = (0, _toString.default)(options[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return array.indexOf(str) >= 0;
|
||||
} else if (_typeof(options) === 'object') {
|
||||
return options.hasOwnProperty(str);
|
||||
} else if (options && typeof options.indexOf === 'function') {
|
||||
return options.indexOf(str) >= 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').applyEach;
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
var isPrototype = require("../prototype/is");
|
||||
|
||||
module.exports = function (value) {
|
||||
if (typeof value !== "function") return false;
|
||||
|
||||
if (!hasOwnProperty.call(value, "length")) return false;
|
||||
|
||||
try {
|
||||
if (typeof value.length !== "number") return false;
|
||||
if (typeof value.call !== "function") return false;
|
||||
if (typeof value.apply !== "function") return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !isPrototype(value);
|
||||
};
|
||||
@@ -0,0 +1,79 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { SchedulerLike } from '../types';
|
||||
|
||||
/**
|
||||
* A simple Observable that emits no items to the Observer and immediately
|
||||
* emits a complete notification.
|
||||
*
|
||||
* <span class="informal">Just emits 'complete', and nothing else.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* A simple Observable that only emits the complete notification. It can be used
|
||||
* for composing with other Observables, such as in a {@link mergeMap}.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Log complete notification
|
||||
*
|
||||
* ```ts
|
||||
* import { EMPTY } from 'rxjs';
|
||||
*
|
||||
* EMPTY.subscribe({
|
||||
* next: () => console.log('Next'),
|
||||
* complete: () => console.log('Complete!')
|
||||
* });
|
||||
*
|
||||
* // Outputs
|
||||
* // Complete!
|
||||
* ```
|
||||
*
|
||||
* Emit the number 7, then complete
|
||||
*
|
||||
* ```ts
|
||||
* import { EMPTY, startWith } from 'rxjs';
|
||||
*
|
||||
* const result = EMPTY.pipe(startWith(7));
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Outputs
|
||||
* // 7
|
||||
* ```
|
||||
*
|
||||
* Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'`
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, mergeMap, of, EMPTY } from 'rxjs';
|
||||
*
|
||||
* const interval$ = interval(1000);
|
||||
* const result = interval$.pipe(
|
||||
* mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : EMPTY),
|
||||
* );
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results in the following to the console:
|
||||
* // x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...)
|
||||
* // x will occur every 1000ms
|
||||
* // if x % 2 is equal to 1, print a, b, c (each on its own)
|
||||
* // if x % 2 is not equal to 1, nothing will be output
|
||||
* ```
|
||||
*
|
||||
* @see {@link Observable}
|
||||
* @see {@link NEVER}
|
||||
* @see {@link of}
|
||||
* @see {@link throwError}
|
||||
*/
|
||||
export const EMPTY = new Observable<never>((subscriber) => subscriber.complete());
|
||||
|
||||
/**
|
||||
* @param scheduler A {@link SchedulerLike} to use for scheduling
|
||||
* the emission of the complete notification.
|
||||
* @deprecated Replaced with the {@link EMPTY} constant or {@link scheduled} (e.g. `scheduled([], scheduler)`). Will be removed in v8.
|
||||
*/
|
||||
export function empty(scheduler?: SchedulerLike) {
|
||||
return scheduler ? emptyScheduled(scheduler) : EMPTY;
|
||||
}
|
||||
|
||||
function emptyScheduled(scheduler: SchedulerLike) {
|
||||
return new Observable<never>((subscriber) => scheduler.schedule(() => subscriber.complete()));
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AnimationFrameScheduler = void 0;
|
||||
var AsyncScheduler_1 = require("./AsyncScheduler");
|
||||
var AnimationFrameScheduler = (function (_super) {
|
||||
__extends(AnimationFrameScheduler, _super);
|
||||
function AnimationFrameScheduler() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
AnimationFrameScheduler.prototype.flush = function (action) {
|
||||
this._active = true;
|
||||
var flushId = this._scheduled;
|
||||
this._scheduled = undefined;
|
||||
var actions = this.actions;
|
||||
var error;
|
||||
action = action || actions.shift();
|
||||
do {
|
||||
if ((error = action.execute(action.state, action.delay))) {
|
||||
break;
|
||||
}
|
||||
} while ((action = actions[0]) && action.id === flushId && actions.shift());
|
||||
this._active = false;
|
||||
if (error) {
|
||||
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
return AnimationFrameScheduler;
|
||||
}(AsyncScheduler_1.AsyncScheduler));
|
||||
exports.AnimationFrameScheduler = AnimationFrameScheduler;
|
||||
//# sourceMappingURL=AnimationFrameScheduler.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"of.js","sourceRoot":"","sources":["../../../../src/internal/observable/of.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA4E9B,MAAM,UAAU,EAAE,CAAI,GAAG,IAA8B;IACrD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,CAAC,IAAW,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
export declare const test: string;
|
||||
@@ -0,0 +1,154 @@
|
||||
{
|
||||
"name": "got",
|
||||
"version": "12.6.0",
|
||||
"description": "Human-friendly and powerful HTTP request library for Node.js",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/got",
|
||||
"funding": "https://github.com/sindresorhus/got?sponsor=1",
|
||||
"type": "module",
|
||||
"exports": "./dist/source/index.js",
|
||||
"types": "./dist/source/index.d.ts",
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && tsc --noEmit && ava",
|
||||
"release": "np",
|
||||
"build": "del-cli dist && tsc",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"files": [
|
||||
"dist/source"
|
||||
],
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"http2",
|
||||
"get",
|
||||
"got",
|
||||
"url",
|
||||
"uri",
|
||||
"request",
|
||||
"simple",
|
||||
"curl",
|
||||
"wget",
|
||||
"fetch",
|
||||
"net",
|
||||
"network",
|
||||
"gzip",
|
||||
"brotli",
|
||||
"requests",
|
||||
"human-friendly",
|
||||
"axios",
|
||||
"superagent",
|
||||
"node-fetch",
|
||||
"ky"
|
||||
],
|
||||
"dependencies": {
|
||||
"@sindresorhus/is": "^5.2.0",
|
||||
"@szmarczak/http-timer": "^5.0.1",
|
||||
"cacheable-lookup": "^7.0.0",
|
||||
"cacheable-request": "^10.2.8",
|
||||
"decompress-response": "^6.0.0",
|
||||
"form-data-encoder": "^2.1.2",
|
||||
"get-stream": "^6.0.1",
|
||||
"http2-wrapper": "^2.1.10",
|
||||
"lowercase-keys": "^3.0.0",
|
||||
"p-cancelable": "^3.0.0",
|
||||
"responselike": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@hapi/bourne": "^3.0.0",
|
||||
"@sindresorhus/tsconfig": "^3.0.1",
|
||||
"@sinonjs/fake-timers": "^10.0.2",
|
||||
"@types/benchmark": "^2.1.2",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/node": "^18.14.5",
|
||||
"@types/pem": "^1.9.6",
|
||||
"@types/pify": "^5.0.1",
|
||||
"@types/readable-stream": "^2.3.13",
|
||||
"@types/request": "^2.48.8",
|
||||
"@types/sinon": "^10.0.11",
|
||||
"@types/sinonjs__fake-timers": "^8.1.1",
|
||||
"@types/tough-cookie": "^4.0.1",
|
||||
"ava": "^5.2.0",
|
||||
"axios": "^0.27.2",
|
||||
"benchmark": "^2.1.4",
|
||||
"bluebird": "^3.7.2",
|
||||
"body-parser": "^1.20.2",
|
||||
"create-cert": "^1.0.6",
|
||||
"create-test-server": "^3.0.1",
|
||||
"del-cli": "^5.0.0",
|
||||
"delay": "^5.0.0",
|
||||
"express": "^4.17.3",
|
||||
"form-data": "^4.0.0",
|
||||
"formdata-node": "^5.0.0",
|
||||
"nock": "^13.3.0",
|
||||
"node-fetch": "^3.2.3",
|
||||
"np": "^7.6.0",
|
||||
"nyc": "^15.1.0",
|
||||
"p-event": "^5.0.1",
|
||||
"pem": "^1.14.6",
|
||||
"pify": "^6.0.0",
|
||||
"readable-stream": "^4.2.0",
|
||||
"request": "^2.88.2",
|
||||
"sinon": "^15.0.1",
|
||||
"slow-stream": "0.0.4",
|
||||
"tempy": "^3.0.0",
|
||||
"then-busboy": "^5.2.1",
|
||||
"tough-cookie": "4.1.2",
|
||||
"ts-node": "^10.8.2",
|
||||
"type-fest": "^3.6.1",
|
||||
"typescript": "~4.9.5",
|
||||
"xo": "^0.53.1"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"ava": {
|
||||
"files": [
|
||||
"test/*"
|
||||
],
|
||||
"timeout": "1m",
|
||||
"extensions": {
|
||||
"ts": "module"
|
||||
},
|
||||
"nodeArguments": [
|
||||
"--loader=ts-node/esm"
|
||||
]
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
"text",
|
||||
"html",
|
||||
"lcov"
|
||||
],
|
||||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/test/**"
|
||||
]
|
||||
},
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"documentation/examples/*"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"n/no-deprecated-api": "off",
|
||||
"n/prefer-global/url": "off",
|
||||
"n/prefer-global/url-search-params": "off",
|
||||
"@typescript-eslint/no-implicit-any-catch": "off",
|
||||
"unicorn/prefer-node-protocol": "off",
|
||||
"ava/assertion-arguments": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/await-thenable": "off",
|
||||
"@typescript-eslint/no-redundant-type-constituents": "off",
|
||||
"no-lone-blocks": "off",
|
||||
"unicorn/no-await-expression-member": "off"
|
||||
}
|
||||
},
|
||||
"runkitExampleFilename": "./documentation/examples/runkit-example.js"
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.transformer = void 0;
|
||||
const postcss_1 = __importDefault(require("postcss"));
|
||||
const globalifySelector_1 = require("../modules/globalifySelector");
|
||||
const selectorPattern = /:global(?!\()/;
|
||||
const globalifyRulePlugin = (root) => {
|
||||
root.walkRules(selectorPattern, (rule) => {
|
||||
const modifiedSelectors = rule.selectors
|
||||
.filter((selector) => selector !== ':global')
|
||||
.map((selector) => {
|
||||
const [beginning, ...rest] = selector.split(selectorPattern);
|
||||
if (rest.length === 0)
|
||||
return beginning;
|
||||
return [beginning, ...rest.map(globalifySelector_1.globalifySelector)]
|
||||
.map((str) => str.trim())
|
||||
.join(' ')
|
||||
.trim();
|
||||
});
|
||||
if (modifiedSelectors.length === 0) {
|
||||
rule.remove();
|
||||
return;
|
||||
}
|
||||
rule.replaceWith(rule.clone({
|
||||
selectors: modifiedSelectors,
|
||||
}));
|
||||
});
|
||||
};
|
||||
const globalAttrPlugin = (root) => {
|
||||
root.walkAtRules(/keyframes$/, (atrule) => {
|
||||
if (!atrule.params.startsWith('-global-')) {
|
||||
atrule.replaceWith(atrule.clone({
|
||||
params: `-global-${atrule.params}`,
|
||||
}));
|
||||
}
|
||||
});
|
||||
root.walkRules((rule) => {
|
||||
var _a, _b;
|
||||
// we use endsWith for checking @keyframes and prefixed @-{prefix}-keyframes
|
||||
if ((_b = (_a = rule === null || rule === void 0 ? void 0 : rule.parent) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.endsWith('keyframes')) {
|
||||
return;
|
||||
}
|
||||
rule.replaceWith(rule.clone({
|
||||
selectors: rule.selectors.map(globalifySelector_1.globalifySelector),
|
||||
}));
|
||||
});
|
||||
};
|
||||
const transformer = async ({ content, filename, options, map, attributes, }) => {
|
||||
const plugins = [
|
||||
globalifyRulePlugin,
|
||||
(attributes === null || attributes === void 0 ? void 0 : attributes.global) && globalAttrPlugin,
|
||||
].filter(Boolean);
|
||||
const { css, map: newMap } = await postcss_1.default(plugins).process(content, {
|
||||
from: filename,
|
||||
map: (options === null || options === void 0 ? void 0 : options.sourceMap) ? { prev: map } : false,
|
||||
});
|
||||
return { code: css, map: newMap };
|
||||
};
|
||||
exports.transformer = transformer;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"node-fetch","version":"3.3.0","files":{"src/errors/abort-error.js":{"checkedAt":1678883671406,"integrity":"sha512-APvavdPQCsqtxgBacePDvXHsh7h9DGrJPg1Ulh05ZgD65y0Ha4LFrdtHH+UPp9SmHOp/Ck3Zy55iImZSUMQfPA==","mode":420,"size":218},"src/errors/base.js":{"checkedAt":1678883671406,"integrity":"sha512-EKKu0cS019oNt+1JqNgk4RY2UsTsMxMz5UQprxQIEnbXlhnVnyRvQRkXMaM+n/bQQ2QPQQm98o7mm/1m0aXxHw==","mode":420,"size":346},"src/body.js":{"checkedAt":1678883671406,"integrity":"sha512-u0tbqf9rAg/XWynfZxp7u2AaW3S4Wb1QdPqVfTk92SdC4ykSlcbiYqjqUEB+Dw1XW1oAs55eIdh6/1o8e3AaEg==","mode":420,"size":9850},"src/errors/fetch-error.js":{"checkedAt":1678883671406,"integrity":"sha512-9CscSVQ6h9sY2nA7oczXXQ2+SQ+md6pi+a1KAqsyH8/pPyTNa3YGrmwRwsRyeaJiabnGoe/YiV+wbpr9KMuWTg==","mode":420,"size":871},"src/utils/get-search.js":{"checkedAt":1678883671406,"integrity":"sha512-9BGsazVxPKwhbwh4MdLiEUpsDCRroPLT1GFqTLWkNCcyXYRYzkg/7gsUUo34iVmtM9D0UygAmJZ+PjYQexdoOw==","mode":420,"size":296},"src/headers.js":{"checkedAt":1678883671412,"integrity":"sha512-j814gkwUQow1qm2W03FYCnbwR4EW134ALdDNQQqFx7jN4lu1HJuGsjMlF/gMTW7qAaFLcAVD/F6fAc7o7gUhug==","mode":420,"size":6932},"src/index.js":{"checkedAt":1678883671425,"integrity":"sha512-VUA9zQlNBmNAKkfJXFsvmM4oleTnCSJ7O0Kpdljj3VhweRuyDtRAqtwIUHkR0w/DK/g2Wv6lHme4o1fgZhCrHw==","mode":420,"size":12908},"src/utils/is-redirect.js":{"checkedAt":1678883671425,"integrity":"sha512-oTIIvVXIo5xdM3BpsUs6Tf4KKmlWMWEezxHqzXlbxjEyTk8mArWYVhX0pE3LTuzoa+gpO2QUIk3l7+aOnOyjNw==","mode":420,"size":229},"src/utils/is.js":{"checkedAt":1678883671425,"integrity":"sha512-/ShOKz+F7KWgbbbeHvjupllqgvhUDSEiMAB8LgcoLd5MuC3kPKLs8TOKuSwOyPnHcRaK1483oxZIwRb9t90Akw==","mode":420,"size":2246},"src/utils/multipart-parser.js":{"checkedAt":1678883671429,"integrity":"sha512-2SDyfCPBQB4qnffBRuilU0N26EvlkmdJg85BRujOVgz+Qdb20sIwiI5tHLjdYJlB4/7SiX0rWSnnS3cNYWMq9A==","mode":420,"size":9643},"src/utils/referrer.js":{"checkedAt":1678883671429,"integrity":"sha512-BDu7IA2j9iq9fH9wGBxuWKrve6veR56mOhFuuAmf5ueEI3ZGXCVT5PtDbkQqmz8PUP7X8f65Wc+IoSIeqW2oBg==","mode":420,"size":11845},"src/response.js":{"checkedAt":1678883671434,"integrity":"sha512-ZrHiwm124pvFv+yWOs2hjInEHJxAzzave/6RM6gIgTBFEWJJJYC1OIpIjglatKpEeoHSL+lrw1SsCmvlxJ5xhg==","mode":420,"size":3433},"src/request.js":{"checkedAt":1678883671434,"integrity":"sha512-ZWeY5MmqGnCGwu+WOUwReoMBBHRIlOh4mxk44Ip2HRKWxyBQwWI5MGXeclVkYhVteGSLrm3kkYHOBf2kAKTpZA==","mode":420,"size":8706},"package.json":{"checkedAt":1678883671434,"integrity":"sha512-YQi7jERsriyHhndp5WWZxiUpZUHQc4daqC8bqAQebCawiHRpWntGkiwt+JUl5JTBI6jR6Q0p568kiDs6jP47aw==","mode":420,"size":3046},"LICENSE.md":{"checkedAt":1678883671439,"integrity":"sha512-MKFksWlqy34GpNSLCsFs1wJgbjn6lBV318SOjb3/9X4eMw7Q8zZfQPK51vdFRAcmULCGiBSc/a8kVfNTm4/SWQ==","mode":420,"size":1090},"README.md":{"checkedAt":1678883671444,"integrity":"sha512-utjQic8R6kwAG2tVa/EbAL58VCR6WijUTxs7mKSxtVi1LIAjOTVa6iRkTKlMN11dNrm7PeDNhlH8a3HrY3b1fw==","mode":420,"size":28813},"@types/index.d.ts":{"checkedAt":1678883671451,"integrity":"sha512-NgSOVhcTm2gDwb6vTkbKvrdsNZroHDhDOT4lhfI/rzhzRZu6ft8HysXM82DcyW5VVAE3uv5Jb8Mbm4n/86K3Qw==","mode":420,"size":6626}}}
|
||||
@@ -0,0 +1,955 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [],
|
||||
presets: [],
|
||||
darkMode: 'media', // or 'class'
|
||||
theme: {
|
||||
accentColor: ({ theme }) => ({
|
||||
...theme('colors'),
|
||||
auto: 'auto',
|
||||
}),
|
||||
animation: {
|
||||
none: 'none',
|
||||
spin: 'spin 1s linear infinite',
|
||||
ping: 'ping 1s cubic-bezier(0, 0, 0.2, 1) infinite',
|
||||
pulse: 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
||||
bounce: 'bounce 1s infinite',
|
||||
},
|
||||
aria: {
|
||||
checked: 'checked="true"',
|
||||
disabled: 'disabled="true"',
|
||||
expanded: 'expanded="true"',
|
||||
hidden: 'hidden="true"',
|
||||
pressed: 'pressed="true"',
|
||||
readonly: 'readonly="true"',
|
||||
required: 'required="true"',
|
||||
selected: 'selected="true"',
|
||||
},
|
||||
aspectRatio: {
|
||||
auto: 'auto',
|
||||
square: '1 / 1',
|
||||
video: '16 / 9',
|
||||
},
|
||||
backdropBlur: ({ theme }) => theme('blur'),
|
||||
backdropBrightness: ({ theme }) => theme('brightness'),
|
||||
backdropContrast: ({ theme }) => theme('contrast'),
|
||||
backdropGrayscale: ({ theme }) => theme('grayscale'),
|
||||
backdropHueRotate: ({ theme }) => theme('hueRotate'),
|
||||
backdropInvert: ({ theme }) => theme('invert'),
|
||||
backdropOpacity: ({ theme }) => theme('opacity'),
|
||||
backdropSaturate: ({ theme }) => theme('saturate'),
|
||||
backdropSepia: ({ theme }) => theme('sepia'),
|
||||
backgroundColor: ({ theme }) => theme('colors'),
|
||||
backgroundImage: {
|
||||
none: 'none',
|
||||
'gradient-to-t': 'linear-gradient(to top, var(--tw-gradient-stops))',
|
||||
'gradient-to-tr': 'linear-gradient(to top right, var(--tw-gradient-stops))',
|
||||
'gradient-to-r': 'linear-gradient(to right, var(--tw-gradient-stops))',
|
||||
'gradient-to-br': 'linear-gradient(to bottom right, var(--tw-gradient-stops))',
|
||||
'gradient-to-b': 'linear-gradient(to bottom, var(--tw-gradient-stops))',
|
||||
'gradient-to-bl': 'linear-gradient(to bottom left, var(--tw-gradient-stops))',
|
||||
'gradient-to-l': 'linear-gradient(to left, var(--tw-gradient-stops))',
|
||||
'gradient-to-tl': 'linear-gradient(to top left, var(--tw-gradient-stops))',
|
||||
},
|
||||
backgroundOpacity: ({ theme }) => theme('opacity'),
|
||||
backgroundPosition: {
|
||||
bottom: 'bottom',
|
||||
center: 'center',
|
||||
left: 'left',
|
||||
'left-bottom': 'left bottom',
|
||||
'left-top': 'left top',
|
||||
right: 'right',
|
||||
'right-bottom': 'right bottom',
|
||||
'right-top': 'right top',
|
||||
top: 'top',
|
||||
},
|
||||
backgroundSize: {
|
||||
auto: 'auto',
|
||||
cover: 'cover',
|
||||
contain: 'contain',
|
||||
},
|
||||
blur: {
|
||||
0: '0',
|
||||
none: '0',
|
||||
sm: '4px',
|
||||
DEFAULT: '8px',
|
||||
md: '12px',
|
||||
lg: '16px',
|
||||
xl: '24px',
|
||||
'2xl': '40px',
|
||||
'3xl': '64px',
|
||||
},
|
||||
borderColor: ({ theme }) => ({
|
||||
...theme('colors'),
|
||||
DEFAULT: theme('colors.gray.200', 'currentColor'),
|
||||
}),
|
||||
borderOpacity: ({ theme }) => theme('opacity'),
|
||||
borderRadius: {
|
||||
none: '0px',
|
||||
sm: '0.125rem',
|
||||
DEFAULT: '0.25rem',
|
||||
md: '0.375rem',
|
||||
lg: '0.5rem',
|
||||
xl: '0.75rem',
|
||||
'2xl': '1rem',
|
||||
'3xl': '1.5rem',
|
||||
full: '9999px',
|
||||
},
|
||||
borderSpacing: ({ theme }) => ({
|
||||
...theme('spacing'),
|
||||
}),
|
||||
borderWidth: {
|
||||
DEFAULT: '1px',
|
||||
0: '0px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
boxShadow: {
|
||||
sm: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
|
||||
DEFAULT: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
|
||||
md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
|
||||
lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
|
||||
xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
|
||||
'2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
|
||||
inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
|
||||
none: 'none',
|
||||
},
|
||||
boxShadowColor: ({ theme }) => theme('colors'),
|
||||
brightness: {
|
||||
0: '0',
|
||||
50: '.5',
|
||||
75: '.75',
|
||||
90: '.9',
|
||||
95: '.95',
|
||||
100: '1',
|
||||
105: '1.05',
|
||||
110: '1.1',
|
||||
125: '1.25',
|
||||
150: '1.5',
|
||||
200: '2',
|
||||
},
|
||||
caretColor: ({ theme }) => theme('colors'),
|
||||
colors: ({ colors }) => ({
|
||||
inherit: colors.inherit,
|
||||
current: colors.current,
|
||||
transparent: colors.transparent,
|
||||
black: colors.black,
|
||||
white: colors.white,
|
||||
slate: colors.slate,
|
||||
gray: colors.gray,
|
||||
zinc: colors.zinc,
|
||||
neutral: colors.neutral,
|
||||
stone: colors.stone,
|
||||
red: colors.red,
|
||||
orange: colors.orange,
|
||||
amber: colors.amber,
|
||||
yellow: colors.yellow,
|
||||
lime: colors.lime,
|
||||
green: colors.green,
|
||||
emerald: colors.emerald,
|
||||
teal: colors.teal,
|
||||
cyan: colors.cyan,
|
||||
sky: colors.sky,
|
||||
blue: colors.blue,
|
||||
indigo: colors.indigo,
|
||||
violet: colors.violet,
|
||||
purple: colors.purple,
|
||||
fuchsia: colors.fuchsia,
|
||||
pink: colors.pink,
|
||||
rose: colors.rose,
|
||||
}),
|
||||
columns: {
|
||||
auto: 'auto',
|
||||
1: '1',
|
||||
2: '2',
|
||||
3: '3',
|
||||
4: '4',
|
||||
5: '5',
|
||||
6: '6',
|
||||
7: '7',
|
||||
8: '8',
|
||||
9: '9',
|
||||
10: '10',
|
||||
11: '11',
|
||||
12: '12',
|
||||
'3xs': '16rem',
|
||||
'2xs': '18rem',
|
||||
xs: '20rem',
|
||||
sm: '24rem',
|
||||
md: '28rem',
|
||||
lg: '32rem',
|
||||
xl: '36rem',
|
||||
'2xl': '42rem',
|
||||
'3xl': '48rem',
|
||||
'4xl': '56rem',
|
||||
'5xl': '64rem',
|
||||
'6xl': '72rem',
|
||||
'7xl': '80rem',
|
||||
},
|
||||
container: {},
|
||||
content: {
|
||||
none: 'none',
|
||||
},
|
||||
contrast: {
|
||||
0: '0',
|
||||
50: '.5',
|
||||
75: '.75',
|
||||
100: '1',
|
||||
125: '1.25',
|
||||
150: '1.5',
|
||||
200: '2',
|
||||
},
|
||||
cursor: {
|
||||
auto: 'auto',
|
||||
default: 'default',
|
||||
pointer: 'pointer',
|
||||
wait: 'wait',
|
||||
text: 'text',
|
||||
move: 'move',
|
||||
help: 'help',
|
||||
'not-allowed': 'not-allowed',
|
||||
none: 'none',
|
||||
'context-menu': 'context-menu',
|
||||
progress: 'progress',
|
||||
cell: 'cell',
|
||||
crosshair: 'crosshair',
|
||||
'vertical-text': 'vertical-text',
|
||||
alias: 'alias',
|
||||
copy: 'copy',
|
||||
'no-drop': 'no-drop',
|
||||
grab: 'grab',
|
||||
grabbing: 'grabbing',
|
||||
'all-scroll': 'all-scroll',
|
||||
'col-resize': 'col-resize',
|
||||
'row-resize': 'row-resize',
|
||||
'n-resize': 'n-resize',
|
||||
'e-resize': 'e-resize',
|
||||
's-resize': 's-resize',
|
||||
'w-resize': 'w-resize',
|
||||
'ne-resize': 'ne-resize',
|
||||
'nw-resize': 'nw-resize',
|
||||
'se-resize': 'se-resize',
|
||||
'sw-resize': 'sw-resize',
|
||||
'ew-resize': 'ew-resize',
|
||||
'ns-resize': 'ns-resize',
|
||||
'nesw-resize': 'nesw-resize',
|
||||
'nwse-resize': 'nwse-resize',
|
||||
'zoom-in': 'zoom-in',
|
||||
'zoom-out': 'zoom-out',
|
||||
},
|
||||
divideColor: ({ theme }) => theme('borderColor'),
|
||||
divideOpacity: ({ theme }) => theme('borderOpacity'),
|
||||
divideWidth: ({ theme }) => theme('borderWidth'),
|
||||
dropShadow: {
|
||||
sm: '0 1px 1px rgb(0 0 0 / 0.05)',
|
||||
DEFAULT: ['0 1px 2px rgb(0 0 0 / 0.1)', '0 1px 1px rgb(0 0 0 / 0.06)'],
|
||||
md: ['0 4px 3px rgb(0 0 0 / 0.07)', '0 2px 2px rgb(0 0 0 / 0.06)'],
|
||||
lg: ['0 10px 8px rgb(0 0 0 / 0.04)', '0 4px 3px rgb(0 0 0 / 0.1)'],
|
||||
xl: ['0 20px 13px rgb(0 0 0 / 0.03)', '0 8px 5px rgb(0 0 0 / 0.08)'],
|
||||
'2xl': '0 25px 25px rgb(0 0 0 / 0.15)',
|
||||
none: '0 0 #0000',
|
||||
},
|
||||
fill: ({ theme }) => ({
|
||||
none: 'none',
|
||||
...theme('colors'),
|
||||
}),
|
||||
flex: {
|
||||
1: '1 1 0%',
|
||||
auto: '1 1 auto',
|
||||
initial: '0 1 auto',
|
||||
none: 'none',
|
||||
},
|
||||
flexBasis: ({ theme }) => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
'1/2': '50%',
|
||||
'1/3': '33.333333%',
|
||||
'2/3': '66.666667%',
|
||||
'1/4': '25%',
|
||||
'2/4': '50%',
|
||||
'3/4': '75%',
|
||||
'1/5': '20%',
|
||||
'2/5': '40%',
|
||||
'3/5': '60%',
|
||||
'4/5': '80%',
|
||||
'1/6': '16.666667%',
|
||||
'2/6': '33.333333%',
|
||||
'3/6': '50%',
|
||||
'4/6': '66.666667%',
|
||||
'5/6': '83.333333%',
|
||||
'1/12': '8.333333%',
|
||||
'2/12': '16.666667%',
|
||||
'3/12': '25%',
|
||||
'4/12': '33.333333%',
|
||||
'5/12': '41.666667%',
|
||||
'6/12': '50%',
|
||||
'7/12': '58.333333%',
|
||||
'8/12': '66.666667%',
|
||||
'9/12': '75%',
|
||||
'10/12': '83.333333%',
|
||||
'11/12': '91.666667%',
|
||||
full: '100%',
|
||||
}),
|
||||
flexGrow: {
|
||||
0: '0',
|
||||
DEFAULT: '1',
|
||||
},
|
||||
flexShrink: {
|
||||
0: '0',
|
||||
DEFAULT: '1',
|
||||
},
|
||||
fontFamily: {
|
||||
sans: [
|
||||
'ui-sans-serif',
|
||||
'system-ui',
|
||||
'-apple-system',
|
||||
'BlinkMacSystemFont',
|
||||
'"Segoe UI"',
|
||||
'Roboto',
|
||||
'"Helvetica Neue"',
|
||||
'Arial',
|
||||
'"Noto Sans"',
|
||||
'sans-serif',
|
||||
'"Apple Color Emoji"',
|
||||
'"Segoe UI Emoji"',
|
||||
'"Segoe UI Symbol"',
|
||||
'"Noto Color Emoji"',
|
||||
],
|
||||
serif: ['ui-serif', 'Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'],
|
||||
mono: [
|
||||
'ui-monospace',
|
||||
'SFMono-Regular',
|
||||
'Menlo',
|
||||
'Monaco',
|
||||
'Consolas',
|
||||
'"Liberation Mono"',
|
||||
'"Courier New"',
|
||||
'monospace',
|
||||
],
|
||||
},
|
||||
fontSize: {
|
||||
xs: ['0.75rem', { lineHeight: '1rem' }],
|
||||
sm: ['0.875rem', { lineHeight: '1.25rem' }],
|
||||
base: ['1rem', { lineHeight: '1.5rem' }],
|
||||
lg: ['1.125rem', { lineHeight: '1.75rem' }],
|
||||
xl: ['1.25rem', { lineHeight: '1.75rem' }],
|
||||
'2xl': ['1.5rem', { lineHeight: '2rem' }],
|
||||
'3xl': ['1.875rem', { lineHeight: '2.25rem' }],
|
||||
'4xl': ['2.25rem', { lineHeight: '2.5rem' }],
|
||||
'5xl': ['3rem', { lineHeight: '1' }],
|
||||
'6xl': ['3.75rem', { lineHeight: '1' }],
|
||||
'7xl': ['4.5rem', { lineHeight: '1' }],
|
||||
'8xl': ['6rem', { lineHeight: '1' }],
|
||||
'9xl': ['8rem', { lineHeight: '1' }],
|
||||
},
|
||||
fontWeight: {
|
||||
thin: '100',
|
||||
extralight: '200',
|
||||
light: '300',
|
||||
normal: '400',
|
||||
medium: '500',
|
||||
semibold: '600',
|
||||
bold: '700',
|
||||
extrabold: '800',
|
||||
black: '900',
|
||||
},
|
||||
gap: ({ theme }) => theme('spacing'),
|
||||
gradientColorStops: ({ theme }) => theme('colors'),
|
||||
grayscale: {
|
||||
0: '0',
|
||||
DEFAULT: '100%',
|
||||
},
|
||||
gridAutoColumns: {
|
||||
auto: 'auto',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fr: 'minmax(0, 1fr)',
|
||||
},
|
||||
gridAutoRows: {
|
||||
auto: 'auto',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fr: 'minmax(0, 1fr)',
|
||||
},
|
||||
gridColumn: {
|
||||
auto: 'auto',
|
||||
'span-1': 'span 1 / span 1',
|
||||
'span-2': 'span 2 / span 2',
|
||||
'span-3': 'span 3 / span 3',
|
||||
'span-4': 'span 4 / span 4',
|
||||
'span-5': 'span 5 / span 5',
|
||||
'span-6': 'span 6 / span 6',
|
||||
'span-7': 'span 7 / span 7',
|
||||
'span-8': 'span 8 / span 8',
|
||||
'span-9': 'span 9 / span 9',
|
||||
'span-10': 'span 10 / span 10',
|
||||
'span-11': 'span 11 / span 11',
|
||||
'span-12': 'span 12 / span 12',
|
||||
'span-full': '1 / -1',
|
||||
},
|
||||
gridColumnEnd: {
|
||||
auto: 'auto',
|
||||
1: '1',
|
||||
2: '2',
|
||||
3: '3',
|
||||
4: '4',
|
||||
5: '5',
|
||||
6: '6',
|
||||
7: '7',
|
||||
8: '8',
|
||||
9: '9',
|
||||
10: '10',
|
||||
11: '11',
|
||||
12: '12',
|
||||
13: '13',
|
||||
},
|
||||
gridColumnStart: {
|
||||
auto: 'auto',
|
||||
1: '1',
|
||||
2: '2',
|
||||
3: '3',
|
||||
4: '4',
|
||||
5: '5',
|
||||
6: '6',
|
||||
7: '7',
|
||||
8: '8',
|
||||
9: '9',
|
||||
10: '10',
|
||||
11: '11',
|
||||
12: '12',
|
||||
13: '13',
|
||||
},
|
||||
gridRow: {
|
||||
auto: 'auto',
|
||||
'span-1': 'span 1 / span 1',
|
||||
'span-2': 'span 2 / span 2',
|
||||
'span-3': 'span 3 / span 3',
|
||||
'span-4': 'span 4 / span 4',
|
||||
'span-5': 'span 5 / span 5',
|
||||
'span-6': 'span 6 / span 6',
|
||||
'span-full': '1 / -1',
|
||||
},
|
||||
gridRowEnd: {
|
||||
auto: 'auto',
|
||||
1: '1',
|
||||
2: '2',
|
||||
3: '3',
|
||||
4: '4',
|
||||
5: '5',
|
||||
6: '6',
|
||||
7: '7',
|
||||
},
|
||||
gridRowStart: {
|
||||
auto: 'auto',
|
||||
1: '1',
|
||||
2: '2',
|
||||
3: '3',
|
||||
4: '4',
|
||||
5: '5',
|
||||
6: '6',
|
||||
7: '7',
|
||||
},
|
||||
gridTemplateColumns: {
|
||||
none: 'none',
|
||||
1: 'repeat(1, minmax(0, 1fr))',
|
||||
2: 'repeat(2, minmax(0, 1fr))',
|
||||
3: 'repeat(3, minmax(0, 1fr))',
|
||||
4: 'repeat(4, minmax(0, 1fr))',
|
||||
5: 'repeat(5, minmax(0, 1fr))',
|
||||
6: 'repeat(6, minmax(0, 1fr))',
|
||||
7: 'repeat(7, minmax(0, 1fr))',
|
||||
8: 'repeat(8, minmax(0, 1fr))',
|
||||
9: 'repeat(9, minmax(0, 1fr))',
|
||||
10: 'repeat(10, minmax(0, 1fr))',
|
||||
11: 'repeat(11, minmax(0, 1fr))',
|
||||
12: 'repeat(12, minmax(0, 1fr))',
|
||||
},
|
||||
gridTemplateRows: {
|
||||
none: 'none',
|
||||
1: 'repeat(1, minmax(0, 1fr))',
|
||||
2: 'repeat(2, minmax(0, 1fr))',
|
||||
3: 'repeat(3, minmax(0, 1fr))',
|
||||
4: 'repeat(4, minmax(0, 1fr))',
|
||||
5: 'repeat(5, minmax(0, 1fr))',
|
||||
6: 'repeat(6, minmax(0, 1fr))',
|
||||
},
|
||||
height: ({ theme }) => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
'1/2': '50%',
|
||||
'1/3': '33.333333%',
|
||||
'2/3': '66.666667%',
|
||||
'1/4': '25%',
|
||||
'2/4': '50%',
|
||||
'3/4': '75%',
|
||||
'1/5': '20%',
|
||||
'2/5': '40%',
|
||||
'3/5': '60%',
|
||||
'4/5': '80%',
|
||||
'1/6': '16.666667%',
|
||||
'2/6': '33.333333%',
|
||||
'3/6': '50%',
|
||||
'4/6': '66.666667%',
|
||||
'5/6': '83.333333%',
|
||||
full: '100%',
|
||||
screen: '100vh',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fit: 'fit-content',
|
||||
}),
|
||||
hueRotate: {
|
||||
0: '0deg',
|
||||
15: '15deg',
|
||||
30: '30deg',
|
||||
60: '60deg',
|
||||
90: '90deg',
|
||||
180: '180deg',
|
||||
},
|
||||
inset: ({ theme }) => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
'1/2': '50%',
|
||||
'1/3': '33.333333%',
|
||||
'2/3': '66.666667%',
|
||||
'1/4': '25%',
|
||||
'2/4': '50%',
|
||||
'3/4': '75%',
|
||||
full: '100%',
|
||||
}),
|
||||
invert: {
|
||||
0: '0',
|
||||
DEFAULT: '100%',
|
||||
},
|
||||
keyframes: {
|
||||
spin: {
|
||||
to: {
|
||||
transform: 'rotate(360deg)',
|
||||
},
|
||||
},
|
||||
ping: {
|
||||
'75%, 100%': {
|
||||
transform: 'scale(2)',
|
||||
opacity: '0',
|
||||
},
|
||||
},
|
||||
pulse: {
|
||||
'50%': {
|
||||
opacity: '.5',
|
||||
},
|
||||
},
|
||||
bounce: {
|
||||
'0%, 100%': {
|
||||
transform: 'translateY(-25%)',
|
||||
animationTimingFunction: 'cubic-bezier(0.8,0,1,1)',
|
||||
},
|
||||
'50%': {
|
||||
transform: 'none',
|
||||
animationTimingFunction: 'cubic-bezier(0,0,0.2,1)',
|
||||
},
|
||||
},
|
||||
},
|
||||
letterSpacing: {
|
||||
tighter: '-0.05em',
|
||||
tight: '-0.025em',
|
||||
normal: '0em',
|
||||
wide: '0.025em',
|
||||
wider: '0.05em',
|
||||
widest: '0.1em',
|
||||
},
|
||||
lineHeight: {
|
||||
none: '1',
|
||||
tight: '1.25',
|
||||
snug: '1.375',
|
||||
normal: '1.5',
|
||||
relaxed: '1.625',
|
||||
loose: '2',
|
||||
3: '.75rem',
|
||||
4: '1rem',
|
||||
5: '1.25rem',
|
||||
6: '1.5rem',
|
||||
7: '1.75rem',
|
||||
8: '2rem',
|
||||
9: '2.25rem',
|
||||
10: '2.5rem',
|
||||
},
|
||||
listStyleType: {
|
||||
none: 'none',
|
||||
disc: 'disc',
|
||||
decimal: 'decimal',
|
||||
},
|
||||
margin: ({ theme }) => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
}),
|
||||
maxHeight: ({ theme }) => ({
|
||||
...theme('spacing'),
|
||||
none: 'none',
|
||||
full: '100%',
|
||||
screen: '100vh',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fit: 'fit-content',
|
||||
}),
|
||||
maxWidth: ({ theme, breakpoints }) => ({
|
||||
none: 'none',
|
||||
0: '0rem',
|
||||
xs: '20rem',
|
||||
sm: '24rem',
|
||||
md: '28rem',
|
||||
lg: '32rem',
|
||||
xl: '36rem',
|
||||
'2xl': '42rem',
|
||||
'3xl': '48rem',
|
||||
'4xl': '56rem',
|
||||
'5xl': '64rem',
|
||||
'6xl': '72rem',
|
||||
'7xl': '80rem',
|
||||
full: '100%',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fit: 'fit-content',
|
||||
prose: '65ch',
|
||||
...breakpoints(theme('screens')),
|
||||
}),
|
||||
minHeight: {
|
||||
0: '0px',
|
||||
full: '100%',
|
||||
screen: '100vh',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fit: 'fit-content',
|
||||
},
|
||||
minWidth: {
|
||||
0: '0px',
|
||||
full: '100%',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fit: 'fit-content',
|
||||
},
|
||||
objectPosition: {
|
||||
bottom: 'bottom',
|
||||
center: 'center',
|
||||
left: 'left',
|
||||
'left-bottom': 'left bottom',
|
||||
'left-top': 'left top',
|
||||
right: 'right',
|
||||
'right-bottom': 'right bottom',
|
||||
'right-top': 'right top',
|
||||
top: 'top',
|
||||
},
|
||||
opacity: {
|
||||
0: '0',
|
||||
5: '0.05',
|
||||
10: '0.1',
|
||||
20: '0.2',
|
||||
25: '0.25',
|
||||
30: '0.3',
|
||||
40: '0.4',
|
||||
50: '0.5',
|
||||
60: '0.6',
|
||||
70: '0.7',
|
||||
75: '0.75',
|
||||
80: '0.8',
|
||||
90: '0.9',
|
||||
95: '0.95',
|
||||
100: '1',
|
||||
},
|
||||
order: {
|
||||
first: '-9999',
|
||||
last: '9999',
|
||||
none: '0',
|
||||
1: '1',
|
||||
2: '2',
|
||||
3: '3',
|
||||
4: '4',
|
||||
5: '5',
|
||||
6: '6',
|
||||
7: '7',
|
||||
8: '8',
|
||||
9: '9',
|
||||
10: '10',
|
||||
11: '11',
|
||||
12: '12',
|
||||
},
|
||||
outlineColor: ({ theme }) => theme('colors'),
|
||||
outlineOffset: {
|
||||
0: '0px',
|
||||
1: '1px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
outlineWidth: {
|
||||
0: '0px',
|
||||
1: '1px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
padding: ({ theme }) => theme('spacing'),
|
||||
placeholderColor: ({ theme }) => theme('colors'),
|
||||
placeholderOpacity: ({ theme }) => theme('opacity'),
|
||||
ringColor: ({ theme }) => ({
|
||||
DEFAULT: theme('colors.blue.500', '#3b82f6'),
|
||||
...theme('colors'),
|
||||
}),
|
||||
ringOffsetColor: ({ theme }) => theme('colors'),
|
||||
ringOffsetWidth: {
|
||||
0: '0px',
|
||||
1: '1px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
ringOpacity: ({ theme }) => ({
|
||||
DEFAULT: '0.5',
|
||||
...theme('opacity'),
|
||||
}),
|
||||
ringWidth: {
|
||||
DEFAULT: '3px',
|
||||
0: '0px',
|
||||
1: '1px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
rotate: {
|
||||
0: '0deg',
|
||||
1: '1deg',
|
||||
2: '2deg',
|
||||
3: '3deg',
|
||||
6: '6deg',
|
||||
12: '12deg',
|
||||
45: '45deg',
|
||||
90: '90deg',
|
||||
180: '180deg',
|
||||
},
|
||||
saturate: {
|
||||
0: '0',
|
||||
50: '.5',
|
||||
100: '1',
|
||||
150: '1.5',
|
||||
200: '2',
|
||||
},
|
||||
scale: {
|
||||
0: '0',
|
||||
50: '.5',
|
||||
75: '.75',
|
||||
90: '.9',
|
||||
95: '.95',
|
||||
100: '1',
|
||||
105: '1.05',
|
||||
110: '1.1',
|
||||
125: '1.25',
|
||||
150: '1.5',
|
||||
},
|
||||
screens: {
|
||||
sm: '640px',
|
||||
md: '768px',
|
||||
lg: '1024px',
|
||||
xl: '1280px',
|
||||
'2xl': '1536px',
|
||||
},
|
||||
scrollMargin: ({ theme }) => ({
|
||||
...theme('spacing'),
|
||||
}),
|
||||
scrollPadding: ({ theme }) => theme('spacing'),
|
||||
sepia: {
|
||||
0: '0',
|
||||
DEFAULT: '100%',
|
||||
},
|
||||
skew: {
|
||||
0: '0deg',
|
||||
1: '1deg',
|
||||
2: '2deg',
|
||||
3: '3deg',
|
||||
6: '6deg',
|
||||
12: '12deg',
|
||||
},
|
||||
space: ({ theme }) => ({
|
||||
...theme('spacing'),
|
||||
}),
|
||||
spacing: {
|
||||
px: '1px',
|
||||
0: '0px',
|
||||
0.5: '0.125rem',
|
||||
1: '0.25rem',
|
||||
1.5: '0.375rem',
|
||||
2: '0.5rem',
|
||||
2.5: '0.625rem',
|
||||
3: '0.75rem',
|
||||
3.5: '0.875rem',
|
||||
4: '1rem',
|
||||
5: '1.25rem',
|
||||
6: '1.5rem',
|
||||
7: '1.75rem',
|
||||
8: '2rem',
|
||||
9: '2.25rem',
|
||||
10: '2.5rem',
|
||||
11: '2.75rem',
|
||||
12: '3rem',
|
||||
14: '3.5rem',
|
||||
16: '4rem',
|
||||
20: '5rem',
|
||||
24: '6rem',
|
||||
28: '7rem',
|
||||
32: '8rem',
|
||||
36: '9rem',
|
||||
40: '10rem',
|
||||
44: '11rem',
|
||||
48: '12rem',
|
||||
52: '13rem',
|
||||
56: '14rem',
|
||||
60: '15rem',
|
||||
64: '16rem',
|
||||
72: '18rem',
|
||||
80: '20rem',
|
||||
96: '24rem',
|
||||
},
|
||||
stroke: ({ theme }) => ({
|
||||
none: 'none',
|
||||
...theme('colors'),
|
||||
}),
|
||||
strokeWidth: {
|
||||
0: '0',
|
||||
1: '1',
|
||||
2: '2',
|
||||
},
|
||||
supports: {},
|
||||
data: {},
|
||||
textColor: ({ theme }) => theme('colors'),
|
||||
textDecorationColor: ({ theme }) => theme('colors'),
|
||||
textDecorationThickness: {
|
||||
auto: 'auto',
|
||||
'from-font': 'from-font',
|
||||
0: '0px',
|
||||
1: '1px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
textIndent: ({ theme }) => ({
|
||||
...theme('spacing'),
|
||||
}),
|
||||
textOpacity: ({ theme }) => theme('opacity'),
|
||||
textUnderlineOffset: {
|
||||
auto: 'auto',
|
||||
0: '0px',
|
||||
1: '1px',
|
||||
2: '2px',
|
||||
4: '4px',
|
||||
8: '8px',
|
||||
},
|
||||
transformOrigin: {
|
||||
center: 'center',
|
||||
top: 'top',
|
||||
'top-right': 'top right',
|
||||
right: 'right',
|
||||
'bottom-right': 'bottom right',
|
||||
bottom: 'bottom',
|
||||
'bottom-left': 'bottom left',
|
||||
left: 'left',
|
||||
'top-left': 'top left',
|
||||
},
|
||||
transitionDelay: {
|
||||
75: '75ms',
|
||||
100: '100ms',
|
||||
150: '150ms',
|
||||
200: '200ms',
|
||||
300: '300ms',
|
||||
500: '500ms',
|
||||
700: '700ms',
|
||||
1000: '1000ms',
|
||||
},
|
||||
transitionDuration: {
|
||||
DEFAULT: '150ms',
|
||||
75: '75ms',
|
||||
100: '100ms',
|
||||
150: '150ms',
|
||||
200: '200ms',
|
||||
300: '300ms',
|
||||
500: '500ms',
|
||||
700: '700ms',
|
||||
1000: '1000ms',
|
||||
},
|
||||
transitionProperty: {
|
||||
none: 'none',
|
||||
all: 'all',
|
||||
DEFAULT:
|
||||
'color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter',
|
||||
colors: 'color, background-color, border-color, text-decoration-color, fill, stroke',
|
||||
opacity: 'opacity',
|
||||
shadow: 'box-shadow',
|
||||
transform: 'transform',
|
||||
},
|
||||
transitionTimingFunction: {
|
||||
DEFAULT: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
linear: 'linear',
|
||||
in: 'cubic-bezier(0.4, 0, 1, 1)',
|
||||
out: 'cubic-bezier(0, 0, 0.2, 1)',
|
||||
'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
},
|
||||
translate: ({ theme }) => ({
|
||||
...theme('spacing'),
|
||||
'1/2': '50%',
|
||||
'1/3': '33.333333%',
|
||||
'2/3': '66.666667%',
|
||||
'1/4': '25%',
|
||||
'2/4': '50%',
|
||||
'3/4': '75%',
|
||||
full: '100%',
|
||||
}),
|
||||
width: ({ theme }) => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
'1/2': '50%',
|
||||
'1/3': '33.333333%',
|
||||
'2/3': '66.666667%',
|
||||
'1/4': '25%',
|
||||
'2/4': '50%',
|
||||
'3/4': '75%',
|
||||
'1/5': '20%',
|
||||
'2/5': '40%',
|
||||
'3/5': '60%',
|
||||
'4/5': '80%',
|
||||
'1/6': '16.666667%',
|
||||
'2/6': '33.333333%',
|
||||
'3/6': '50%',
|
||||
'4/6': '66.666667%',
|
||||
'5/6': '83.333333%',
|
||||
'1/12': '8.333333%',
|
||||
'2/12': '16.666667%',
|
||||
'3/12': '25%',
|
||||
'4/12': '33.333333%',
|
||||
'5/12': '41.666667%',
|
||||
'6/12': '50%',
|
||||
'7/12': '58.333333%',
|
||||
'8/12': '66.666667%',
|
||||
'9/12': '75%',
|
||||
'10/12': '83.333333%',
|
||||
'11/12': '91.666667%',
|
||||
full: '100%',
|
||||
screen: '100vw',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
fit: 'fit-content',
|
||||
}),
|
||||
willChange: {
|
||||
auto: 'auto',
|
||||
scroll: 'scroll-position',
|
||||
contents: 'contents',
|
||||
transform: 'transform',
|
||||
},
|
||||
zIndex: {
|
||||
auto: 'auto',
|
||||
0: '0',
|
||||
10: '10',
|
||||
20: '20',
|
||||
30: '30',
|
||||
40: '40',
|
||||
50: '50',
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
import Let from '../../../nodes/Let';
|
||||
import Block from '../../Block';
|
||||
import TemplateScope from '../../../nodes/shared/TemplateScope';
|
||||
import { BinaryExpression, Identifier } from 'estree';
|
||||
export declare function get_slot_definition(block: Block, scope: TemplateScope, lets: Let[]): {
|
||||
block: Block;
|
||||
scope: TemplateScope;
|
||||
get_context?: undefined;
|
||||
get_changes?: undefined;
|
||||
} | {
|
||||
block: Block;
|
||||
scope: TemplateScope;
|
||||
get_context: (import("estree").ClassExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrayExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrowFunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AssignmentExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AwaitExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (BinaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleCallExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").NewExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ChainExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ConditionalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").FunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (Identifier & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ImportExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").RegExpLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").BigIntLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").LogicalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MemberExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MetaProperty & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ObjectExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SequenceExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TaggedTemplateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TemplateLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ThisExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UnaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UpdateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").YieldExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
});
|
||||
get_changes: (import("estree").ClassExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrayExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ArrowFunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AssignmentExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").AwaitExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (BinaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleCallExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").NewExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ChainExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ConditionalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").FunctionExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (Identifier & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ImportExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SimpleLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").RegExpLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").BigIntLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").LogicalExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MemberExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").MetaProperty & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ObjectExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").SequenceExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TaggedTemplateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").TemplateLiteral & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").ThisExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UnaryExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").UpdateExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
}) | (import("estree").YieldExpression & {
|
||||
start: number;
|
||||
end: number;
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"which","version":"2.0.2","files":{"LICENSE":{"checkedAt":1678883670198,"integrity":"sha512-P6dI5Z+zrwxSk1MIRPqpYG2ScYNkidLIATQXd50QzBgBh/XmcEd/nsd9NB4O9k6rfc+4dsY5DwJ7xvhpoS0PRg==","mode":420,"size":765},"bin/node-which":{"checkedAt":1678883670659,"integrity":"sha512-Mio/3L3AqyJArNpUer5jbVH38hFCAEkff8ZsQ1PUPTekBS3w0y8p7egMinaNMS766O0oY59VwuWmePMGpFmG+Q==","mode":493,"size":985},"which.js":{"checkedAt":1678883670659,"integrity":"sha512-blYX/43NrNtESmH7Varn0Z3Wrd0XXcKZvSDopuG/E+4QX1PaxJAz0HdVYXFLAJOojs2ehlvbjd17t7vp75kCFA==","mode":420,"size":3163},"package.json":{"checkedAt":1678883670659,"integrity":"sha512-RUgBHR5O2fXX+15AhHaieyoZ877sWsSpu93rxwCnf/D7Fo7MSRdXahjyLSYvgmSensDBJCr3UqfPoDIepDdarQ==","mode":420,"size":1043},"CHANGELOG.md":{"checkedAt":1678883670659,"integrity":"sha512-+dlguwUAjkDGifDQwCt8RpE3hHZr16NF1VxqD1zdb4A4/PepPgGIa+XNv6dv7PrWgfoTgeTKJX3NU51RF9Ac0A==","mode":420,"size":2667},"README.md":{"checkedAt":1678883670659,"integrity":"sha512-bstLJ1NUjcBIMeqhjkYDhRT/1dcLl43xoTvZmXlHRoxS6Vg6rVxJZjjj4ycGZWjHv45AzBdvqBVUsSUvJpdDgg==","mode":420,"size":1352}}}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').ensureAsync;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
},
|
||||
|
||||
"ignorePatterns": [
|
||||
"dist",
|
||||
],
|
||||
|
||||
"rules": {
|
||||
"max-statements-per-line": [2, { "max": 2 }]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>parseObjectStyles
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
||||
const _postcssNested = /*#__PURE__*/ _interopRequireDefault(require("postcss-nested"));
|
||||
const _postcssJs = /*#__PURE__*/ _interopRequireDefault(require("postcss-js"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function parseObjectStyles(styles) {
|
||||
if (!Array.isArray(styles)) {
|
||||
return parseObjectStyles([
|
||||
styles
|
||||
]);
|
||||
}
|
||||
return styles.flatMap((style)=>{
|
||||
return (0, _postcss.default)([
|
||||
(0, _postcssNested.default)({
|
||||
bubble: [
|
||||
"screen"
|
||||
]
|
||||
})
|
||||
]).process(style, {
|
||||
parser: _postcssJs.default
|
||||
}).root.nodes;
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
# Arg
|
||||
|
||||
`arg` is an unopinionated, no-frills CLI argument parser.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install arg
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`arg()` takes either 1 or 2 arguments:
|
||||
|
||||
1. Command line specification object (see below)
|
||||
2. Parse options (_Optional_, defaults to `{permissive: false, argv: process.argv.slice(2), stopAtPositional: false}`)
|
||||
|
||||
It returns an object with any values present on the command-line (missing options are thus
|
||||
missing from the resulting object). Arg performs no validation/requirement checking - we
|
||||
leave that up to the application.
|
||||
|
||||
All parameters that aren't consumed by options (commonly referred to as "extra" parameters)
|
||||
are added to `result._`, which is _always_ an array (even if no extra parameters are passed,
|
||||
in which case an empty array is returned).
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
// `options` is an optional parameter
|
||||
const args = arg(
|
||||
spec,
|
||||
(options = { permissive: false, argv: process.argv.slice(2) })
|
||||
);
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```console
|
||||
$ node ./hello.js --verbose -vvv --port=1234 -n 'My name' foo bar --tag qux --tag=qix -- --foobar
|
||||
```
|
||||
|
||||
```javascript
|
||||
// hello.js
|
||||
const arg = require('arg');
|
||||
|
||||
const args = arg({
|
||||
// Types
|
||||
'--help': Boolean,
|
||||
'--version': Boolean,
|
||||
'--verbose': arg.COUNT, // Counts the number of times --verbose is passed
|
||||
'--port': Number, // --port <number> or --port=<number>
|
||||
'--name': String, // --name <string> or --name=<string>
|
||||
'--tag': [String], // --tag <string> or --tag=<string>
|
||||
|
||||
// Aliases
|
||||
'-v': '--verbose',
|
||||
'-n': '--name', // -n <string>; result is stored in --name
|
||||
'--label': '--name' // --label <string> or --label=<string>;
|
||||
// result is stored in --name
|
||||
});
|
||||
|
||||
console.log(args);
|
||||
/*
|
||||
{
|
||||
_: ["foo", "bar", "--foobar"],
|
||||
'--port': 1234,
|
||||
'--verbose': 4,
|
||||
'--name': "My name",
|
||||
'--tag': ["qux", "qix"]
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
The values for each key=>value pair is either a type (function or [function]) or a string (indicating an alias).
|
||||
|
||||
- In the case of a function, the string value of the argument's value is passed to it,
|
||||
and the return value is used as the ultimate value.
|
||||
|
||||
- In the case of an array, the only element _must_ be a type function. Array types indicate
|
||||
that the argument may be passed multiple times, and as such the resulting value in the returned
|
||||
object is an array with all of the values that were passed using the specified flag.
|
||||
|
||||
- In the case of a string, an alias is established. If a flag is passed that matches the _key_,
|
||||
then the _value_ is substituted in its place.
|
||||
|
||||
Type functions are passed three arguments:
|
||||
|
||||
1. The parameter value (always a string)
|
||||
2. The parameter name (e.g. `--label`)
|
||||
3. The previous value for the destination (useful for reduce-like operations or for supporting `-v` multiple times, etc.)
|
||||
|
||||
This means the built-in `String`, `Number`, and `Boolean` type constructors "just work" as type functions.
|
||||
|
||||
Note that `Boolean` and `[Boolean]` have special treatment - an option argument is _not_ consumed or passed, but instead `true` is
|
||||
returned. These options are called "flags".
|
||||
|
||||
For custom handlers that wish to behave as flags, you may pass the function through `arg.flag()`:
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = [
|
||||
'--foo',
|
||||
'bar',
|
||||
'-ff',
|
||||
'baz',
|
||||
'--foo',
|
||||
'--foo',
|
||||
'qux',
|
||||
'-fff',
|
||||
'qix'
|
||||
];
|
||||
|
||||
function myHandler(value, argName, previousValue) {
|
||||
/* `value` is always `true` */
|
||||
return 'na ' + (previousValue || 'batman!');
|
||||
}
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': arg.flag(myHandler),
|
||||
'-f': '--foo'
|
||||
},
|
||||
{
|
||||
argv
|
||||
}
|
||||
);
|
||||
|
||||
console.log(args);
|
||||
/*
|
||||
{
|
||||
_: ['bar', 'baz', 'qux', 'qix'],
|
||||
'--foo': 'na na na na na na na na batman!'
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
As well, `arg` supplies a helper argument handler called `arg.COUNT`, which equivalent to a `[Boolean]` argument's `.length`
|
||||
property - effectively counting the number of times the boolean flag, denoted by the key, is passed on the command line..
|
||||
For example, this is how you could implement `ssh`'s multiple levels of verbosity (`-vvvv` being the most verbose).
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = ['-AAAA', '-BBBB'];
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'-A': arg.COUNT,
|
||||
'-B': [Boolean]
|
||||
},
|
||||
{
|
||||
argv
|
||||
}
|
||||
);
|
||||
|
||||
console.log(args);
|
||||
/*
|
||||
{
|
||||
_: [],
|
||||
'-A': 4,
|
||||
'-B': [true, true, true, true]
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
If a second parameter is specified and is an object, it specifies parsing options to modify the behavior of `arg()`.
|
||||
|
||||
#### `argv`
|
||||
|
||||
If you have already sliced or generated a number of raw arguments to be parsed (as opposed to letting `arg`
|
||||
slice them from `process.argv`) you may specify them in the `argv` option.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': String
|
||||
},
|
||||
{
|
||||
argv: ['hello', '--foo', 'world']
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
results in:
|
||||
|
||||
```javascript
|
||||
const args = {
|
||||
_: ['hello'],
|
||||
'--foo': 'world'
|
||||
};
|
||||
```
|
||||
|
||||
#### `permissive`
|
||||
|
||||
When `permissive` set to `true`, `arg` will push any unknown arguments
|
||||
onto the "extra" argument array (`result._`) instead of throwing an error about
|
||||
an unknown flag.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = [
|
||||
'--foo',
|
||||
'hello',
|
||||
'--qux',
|
||||
'qix',
|
||||
'--bar',
|
||||
'12345',
|
||||
'hello again'
|
||||
];
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': String,
|
||||
'--bar': Number
|
||||
},
|
||||
{
|
||||
argv,
|
||||
permissive: true
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
results in:
|
||||
|
||||
```javascript
|
||||
const args = {
|
||||
_: ['--qux', 'qix', 'hello again'],
|
||||
'--foo': 'hello',
|
||||
'--bar': 12345
|
||||
};
|
||||
```
|
||||
|
||||
#### `stopAtPositional`
|
||||
|
||||
When `stopAtPositional` is set to `true`, `arg` will halt parsing at the first
|
||||
positional argument.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const arg = require('arg');
|
||||
|
||||
const argv = ['--foo', 'hello', '--bar'];
|
||||
|
||||
const args = arg(
|
||||
{
|
||||
'--foo': Boolean,
|
||||
'--bar': Boolean
|
||||
},
|
||||
{
|
||||
argv,
|
||||
stopAtPositional: true
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
results in:
|
||||
|
||||
```javascript
|
||||
const args = {
|
||||
_: ['hello', '--bar'],
|
||||
'--foo': true
|
||||
};
|
||||
```
|
||||
|
||||
### Errors
|
||||
|
||||
Some errors that `arg` throws provide a `.code` property in order to aid in recovering from user error, or to
|
||||
differentiate between user error and developer error (bug).
|
||||
|
||||
##### ARG_UNKNOWN_OPTION
|
||||
|
||||
If an unknown option (not defined in the spec object) is passed, an error with code `ARG_UNKNOWN_OPTION` will be thrown:
|
||||
|
||||
```js
|
||||
// cli.js
|
||||
try {
|
||||
require('arg')({ '--hi': String });
|
||||
} catch (err) {
|
||||
if (err.code === 'ARG_UNKNOWN_OPTION') {
|
||||
console.log(err.message);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```shell
|
||||
node cli.js --extraneous true
|
||||
Unknown or unexpected option: --extraneous
|
||||
```
|
||||
|
||||
# FAQ
|
||||
|
||||
A few questions and answers that have been asked before:
|
||||
|
||||
### How do I require an argument with `arg`?
|
||||
|
||||
Do the assertion yourself, such as:
|
||||
|
||||
```javascript
|
||||
const args = arg({ '--name': String });
|
||||
|
||||
if (!args['--name']) throw new Error('missing required argument: --name');
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
Released under the [MIT License](LICENSE.md).
|
||||
@@ -0,0 +1,85 @@
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
||||
var e, m
|
||||
var eLen = (nBytes * 8) - mLen - 1
|
||||
var eMax = (1 << eLen) - 1
|
||||
var eBias = eMax >> 1
|
||||
var nBits = -7
|
||||
var i = isLE ? (nBytes - 1) : 0
|
||||
var d = isLE ? -1 : 1
|
||||
var s = buffer[offset + i]
|
||||
|
||||
i += d
|
||||
|
||||
e = s & ((1 << (-nBits)) - 1)
|
||||
s >>= (-nBits)
|
||||
nBits += eLen
|
||||
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
|
||||
|
||||
m = e & ((1 << (-nBits)) - 1)
|
||||
e >>= (-nBits)
|
||||
nBits += mLen
|
||||
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
|
||||
|
||||
if (e === 0) {
|
||||
e = 1 - eBias
|
||||
} else if (e === eMax) {
|
||||
return m ? NaN : ((s ? -1 : 1) * Infinity)
|
||||
} else {
|
||||
m = m + Math.pow(2, mLen)
|
||||
e = e - eBias
|
||||
}
|
||||
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
|
||||
}
|
||||
|
||||
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
||||
var e, m, c
|
||||
var eLen = (nBytes * 8) - mLen - 1
|
||||
var eMax = (1 << eLen) - 1
|
||||
var eBias = eMax >> 1
|
||||
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
|
||||
var i = isLE ? 0 : (nBytes - 1)
|
||||
var d = isLE ? 1 : -1
|
||||
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
|
||||
|
||||
value = Math.abs(value)
|
||||
|
||||
if (isNaN(value) || value === Infinity) {
|
||||
m = isNaN(value) ? 1 : 0
|
||||
e = eMax
|
||||
} else {
|
||||
e = Math.floor(Math.log(value) / Math.LN2)
|
||||
if (value * (c = Math.pow(2, -e)) < 1) {
|
||||
e--
|
||||
c *= 2
|
||||
}
|
||||
if (e + eBias >= 1) {
|
||||
value += rt / c
|
||||
} else {
|
||||
value += rt * Math.pow(2, 1 - eBias)
|
||||
}
|
||||
if (value * c >= 2) {
|
||||
e++
|
||||
c /= 2
|
||||
}
|
||||
|
||||
if (e + eBias >= eMax) {
|
||||
m = 0
|
||||
e = eMax
|
||||
} else if (e + eBias >= 1) {
|
||||
m = ((value * c) - 1) * Math.pow(2, mLen)
|
||||
e = e + eBias
|
||||
} else {
|
||||
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
|
||||
e = 0
|
||||
}
|
||||
}
|
||||
|
||||
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
|
||||
|
||||
e = (e << mLen) | m
|
||||
eLen += mLen
|
||||
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
|
||||
|
||||
buffer[offset + i - d] |= s * 128
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
var DEFAULTS = {
|
||||
'*': {
|
||||
colors: {
|
||||
opacity: true // rgba / hsla
|
||||
},
|
||||
properties: {
|
||||
backgroundClipMerging: true, // background-clip to shorthand
|
||||
backgroundOriginMerging: true, // background-origin to shorthand
|
||||
backgroundSizeMerging: true, // background-size to shorthand
|
||||
colors: true, // any kind of color transformations, like `#ff00ff` to `#f0f` or `#fff` into `red`
|
||||
ieBangHack: false, // !ie suffix hacks on IE<8
|
||||
ieFilters: false, // whether to preserve `filter` and `-ms-filter` properties
|
||||
iePrefixHack: false, // underscore / asterisk prefix hacks on IE
|
||||
ieSuffixHack: false, // \9 suffix hacks on IE6-9
|
||||
merging: true, // merging properties into one
|
||||
shorterLengthUnits: false, // optimize pixel units into `pt`, `pc` or `in` units
|
||||
spaceAfterClosingBrace: true, // 'url() no-repeat' to 'url()no-repeat'
|
||||
urlQuotes: false, // whether to wrap content of `url()` into quotes or not
|
||||
zeroUnits: true // 0[unit] -> 0
|
||||
},
|
||||
selectors: {
|
||||
adjacentSpace: false, // div+ nav Android stock browser hack
|
||||
ie7Hack: false, // *+html hack
|
||||
mergeablePseudoClasses: [
|
||||
':active',
|
||||
':after',
|
||||
':before',
|
||||
':empty',
|
||||
':checked',
|
||||
':disabled',
|
||||
':empty',
|
||||
':enabled',
|
||||
':first-child',
|
||||
':first-letter',
|
||||
':first-line',
|
||||
':first-of-type',
|
||||
':focus',
|
||||
':hover',
|
||||
':lang',
|
||||
':last-child',
|
||||
':last-of-type',
|
||||
':link',
|
||||
':not',
|
||||
':nth-child',
|
||||
':nth-last-child',
|
||||
':nth-last-of-type',
|
||||
':nth-of-type',
|
||||
':only-child',
|
||||
':only-of-type',
|
||||
':root',
|
||||
':target',
|
||||
':visited'
|
||||
], // selectors with these pseudo-classes can be merged as these are universally supported
|
||||
mergeablePseudoElements: [
|
||||
'::after',
|
||||
'::before',
|
||||
'::first-letter',
|
||||
'::first-line'
|
||||
], // selectors with these pseudo-elements can be merged as these are universally supported
|
||||
mergeLimit: 8191, // number of rules that can be safely merged together
|
||||
multiplePseudoMerging: true
|
||||
},
|
||||
units: {
|
||||
ch: true,
|
||||
in: true,
|
||||
pc: true,
|
||||
pt: true,
|
||||
rem: true,
|
||||
vh: true,
|
||||
vm: true, // vm is vmin on IE9+ see https://developer.mozilla.org/en-US/docs/Web/CSS/length
|
||||
vmax: true,
|
||||
vmin: true,
|
||||
vw: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DEFAULTS.ie11 = DEFAULTS['*'];
|
||||
|
||||
DEFAULTS.ie10 = DEFAULTS['*'];
|
||||
|
||||
DEFAULTS.ie9 = merge(DEFAULTS['*'], {
|
||||
properties: {
|
||||
ieFilters: true,
|
||||
ieSuffixHack: true
|
||||
}
|
||||
});
|
||||
|
||||
DEFAULTS.ie8 = merge(DEFAULTS.ie9, {
|
||||
colors: {
|
||||
opacity: false
|
||||
},
|
||||
properties: {
|
||||
backgroundClipMerging: false,
|
||||
backgroundOriginMerging: false,
|
||||
backgroundSizeMerging: false,
|
||||
iePrefixHack: true,
|
||||
merging: false
|
||||
},
|
||||
selectors: {
|
||||
mergeablePseudoClasses: [
|
||||
':after',
|
||||
':before',
|
||||
':first-child',
|
||||
':first-letter',
|
||||
':focus',
|
||||
':hover',
|
||||
':visited'
|
||||
],
|
||||
mergeablePseudoElements: []
|
||||
},
|
||||
units: {
|
||||
ch: false,
|
||||
rem: false,
|
||||
vh: false,
|
||||
vm: false,
|
||||
vmax: false,
|
||||
vmin: false,
|
||||
vw: false
|
||||
}
|
||||
});
|
||||
|
||||
DEFAULTS.ie7 = merge(DEFAULTS.ie8, {
|
||||
properties: {
|
||||
ieBangHack: true
|
||||
},
|
||||
selectors: {
|
||||
ie7Hack: true,
|
||||
mergeablePseudoClasses: [
|
||||
':first-child',
|
||||
':first-letter',
|
||||
':hover',
|
||||
':visited'
|
||||
]
|
||||
},
|
||||
});
|
||||
|
||||
function compatibilityFrom(source) {
|
||||
return merge(DEFAULTS['*'], calculateSource(source));
|
||||
}
|
||||
|
||||
function merge(source, target) {
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
var value = source[key];
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(target, key) && typeof value === 'object' && !Array.isArray(value)) {
|
||||
target[key] = merge(value, target[key] || {});
|
||||
} else {
|
||||
target[key] = key in target ? target[key] : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function calculateSource(source) {
|
||||
if (typeof source == 'object')
|
||||
return source;
|
||||
|
||||
if (!/[,\+\-]/.test(source))
|
||||
return DEFAULTS[source] || DEFAULTS['*'];
|
||||
|
||||
var parts = source.split(',');
|
||||
var template = parts[0] in DEFAULTS ?
|
||||
DEFAULTS[parts.shift()] :
|
||||
DEFAULTS['*'];
|
||||
|
||||
source = {};
|
||||
|
||||
parts.forEach(function (part) {
|
||||
var isAdd = part[0] == '+';
|
||||
var key = part.substring(1).split('.');
|
||||
var group = key[0];
|
||||
var option = key[1];
|
||||
|
||||
source[group] = source[group] || {};
|
||||
source[group][option] = isAdd;
|
||||
});
|
||||
|
||||
return merge(template, source);
|
||||
}
|
||||
|
||||
module.exports = compatibilityFrom;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var resolveException = require("../lib/resolve-exception")
|
||||
, coerce = require("./coerce");
|
||||
|
||||
module.exports = function (value/*, options*/) {
|
||||
var coerced = coerce(value);
|
||||
if (coerced !== null) return coerced;
|
||||
return resolveException(value, "%v is not an integer", arguments[1]);
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
type ReplaceOptions = {
|
||||
all?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
Represents a string with some or all matches replaced by a replacement.
|
||||
|
||||
Use-case:
|
||||
- `snake-case-path` to `dotted.path.notation`
|
||||
- Changing date/time format: `01-08-2042` → `01/08/2042`
|
||||
- Manipulation of type properties, for example, removal of prefixes
|
||||
|
||||
@example
|
||||
```
|
||||
import {Replace} from 'type-fest';
|
||||
|
||||
declare function replace<
|
||||
Input extends string,
|
||||
Search extends string,
|
||||
Replacement extends string
|
||||
>(
|
||||
input: Input,
|
||||
search: Search,
|
||||
replacement: Replacement
|
||||
): Replace<Input, Search, Replacement>;
|
||||
|
||||
declare function replaceAll<
|
||||
Input extends string,
|
||||
Search extends string,
|
||||
Replacement extends string
|
||||
>(
|
||||
input: Input,
|
||||
search: Search,
|
||||
replacement: Replacement
|
||||
): Replace<Input, Search, Replacement, {all: true}>;
|
||||
|
||||
// The return type is the exact string literal, not just `string`.
|
||||
|
||||
replace('hello ?', '?', '🦄');
|
||||
//=> 'hello 🦄'
|
||||
|
||||
replace('hello ??', '?', '❓');
|
||||
//=> 'hello ❓?'
|
||||
|
||||
replaceAll('10:42:00', ':', '-');
|
||||
//=> '10-42-00'
|
||||
|
||||
replaceAll('__userName__', '__', '');
|
||||
//=> 'userName'
|
||||
|
||||
replaceAll('My Cool Title', ' ', '');
|
||||
//=> 'MyCoolTitle'
|
||||
```
|
||||
|
||||
@category String
|
||||
@category Template literal
|
||||
*/
|
||||
export type Replace<
|
||||
Input extends string,
|
||||
Search extends string,
|
||||
Replacement extends string,
|
||||
Options extends ReplaceOptions = {},
|
||||
> = Input extends `${infer Head}${Search}${infer Tail}`
|
||||
? Options['all'] extends true
|
||||
? `${Head}${Replacement}${Replace<Tail, Search, Replacement, Options>}`
|
||||
: `${Head}${Replacement}${Tail}`
|
||||
: Input;
|
||||
@@ -0,0 +1,40 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
export function sequenceEqual(compareTo, comparator) {
|
||||
if (comparator === void 0) { comparator = function (a, b) { return a === b; }; }
|
||||
return operate(function (source, subscriber) {
|
||||
var aState = createState();
|
||||
var bState = createState();
|
||||
var emit = function (isEqual) {
|
||||
subscriber.next(isEqual);
|
||||
subscriber.complete();
|
||||
};
|
||||
var createSubscriber = function (selfState, otherState) {
|
||||
var sequenceEqualSubscriber = createOperatorSubscriber(subscriber, function (a) {
|
||||
var buffer = otherState.buffer, complete = otherState.complete;
|
||||
if (buffer.length === 0) {
|
||||
complete ? emit(false) : selfState.buffer.push(a);
|
||||
}
|
||||
else {
|
||||
!comparator(a, buffer.shift()) && emit(false);
|
||||
}
|
||||
}, function () {
|
||||
selfState.complete = true;
|
||||
var complete = otherState.complete, buffer = otherState.buffer;
|
||||
complete && emit(buffer.length === 0);
|
||||
sequenceEqualSubscriber === null || sequenceEqualSubscriber === void 0 ? void 0 : sequenceEqualSubscriber.unsubscribe();
|
||||
});
|
||||
return sequenceEqualSubscriber;
|
||||
};
|
||||
source.subscribe(createSubscriber(aState, bState));
|
||||
innerFrom(compareTo).subscribe(createSubscriber(bState, aState));
|
||||
});
|
||||
}
|
||||
function createState() {
|
||||
return {
|
||||
buffer: [],
|
||||
complete: false,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=sequenceEqual.js.map
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(Math, "imul", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import {applyExtends as _applyExtends} from '../build/lib/utils/apply-extends.js';
|
||||
import {hideBin} from '../build/lib/utils/process-argv.js';
|
||||
import Parser from 'yargs-parser';
|
||||
import shim from '../lib/platform-shims/esm.mjs';
|
||||
|
||||
const applyExtends = (config, cwd, mergeExtends) => {
|
||||
return _applyExtends(config, cwd, mergeExtends, shim);
|
||||
};
|
||||
|
||||
export {applyExtends, hideBin, Parser};
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').concat;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"@types/sass","version":"1.43.1","files":{"LICENSE":{"checkedAt":1678883669855,"integrity":"sha512-HQaIQk9pwOcyKutyDk4o2a87WnotwYuLGYFW43emGm4FvIJFKPyg+OYaw5sTegKAKf+C5SKa1ACjzCLivbaHrQ==","mode":511,"size":1141},"README.md":{"checkedAt":1678883672794,"integrity":"sha512-0JgJGot3ZLWwb1n86mpg0dqPW9bs4bpzIOvTYJXJE5hFbOeko8KeA7RDU/LvmIzfKdnx66jA4YoIph56nuNp+g==","mode":511,"size":622},"index.d.ts":{"checkedAt":1678883672794,"integrity":"sha512-maa3keQCWy/ezMjchneah5kpxQZeh7R6w6GYRFzxhnzQvB64UcTd9j20xK90x31K7KiYSvVsDT8mRNegfuhEOw==","mode":511,"size":10275},"package.json":{"checkedAt":1678883672796,"integrity":"sha512-ScBKulu5p22IFTiCSEyEpZuBCeLhMqC9UZF1Ji0BMWWe86PVv+Iseqg66ZY/YsFtO4TUXCqjEnxpFeEcMHQPXw==","mode":511,"size":1108}}}
|
||||
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tagInfo_1 = require("../modules/tagInfo");
|
||||
const utils_1 = require("../modules/utils");
|
||||
const prepareContent_1 = require("../modules/prepareContent");
|
||||
exports.default = (options) => ({
|
||||
async style(svelteFile) {
|
||||
const { transformer } = await Promise.resolve().then(() => __importStar(require('../transformers/scss')));
|
||||
let { content, filename, attributes, lang, alias, dependencies, } = await tagInfo_1.getTagInfo(svelteFile);
|
||||
if (alias === 'sass') {
|
||||
options = {
|
||||
...options,
|
||||
stripIndent: true,
|
||||
indentedSyntax: true,
|
||||
};
|
||||
}
|
||||
content = prepareContent_1.prepareContent({ options, content });
|
||||
if (lang !== 'scss') {
|
||||
return { code: content };
|
||||
}
|
||||
const transformed = await transformer({
|
||||
content,
|
||||
filename,
|
||||
attributes,
|
||||
options,
|
||||
});
|
||||
return {
|
||||
...transformed,
|
||||
dependencies: utils_1.concat(dependencies, transformed.dependencies),
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { TimerHandle } from './timerHandle';
|
||||
declare type SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;
|
||||
declare type ClearIntervalFunction = (handle: TimerHandle) => void;
|
||||
interface IntervalProvider {
|
||||
setInterval: SetIntervalFunction;
|
||||
clearInterval: ClearIntervalFunction;
|
||||
delegate: {
|
||||
setInterval: SetIntervalFunction;
|
||||
clearInterval: ClearIntervalFunction;
|
||||
} | undefined;
|
||||
}
|
||||
export declare const intervalProvider: IntervalProvider;
|
||||
export {};
|
||||
//# sourceMappingURL=intervalProvider.d.ts.map
|
||||
Reference in New Issue
Block a user