new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
var chalk = require('chalk');
|
||||
var figures = require('figures');
|
||||
|
||||
/**
|
||||
* Separator object
|
||||
* Used to space/separate choices group
|
||||
* @constructor
|
||||
* @param {String} line Separation line content (facultative)
|
||||
*/
|
||||
|
||||
class Separator {
|
||||
constructor(line) {
|
||||
this.type = 'separator';
|
||||
this.line = chalk.dim(line || new Array(15).join(figures.line));
|
||||
}
|
||||
|
||||
/**
|
||||
* Stringify separator
|
||||
* @return {String} the separator display string
|
||||
*/
|
||||
toString() {
|
||||
return this.line;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function returning false if object is a separator
|
||||
* @param {Object} obj object to test against
|
||||
* @return {Boolean} `false` if object is a separator
|
||||
*/
|
||||
|
||||
Separator.exclude = function (obj) {
|
||||
return obj.type !== 'separator';
|
||||
};
|
||||
|
||||
module.exports = Separator;
|
||||
@@ -0,0 +1,101 @@
|
||||
import Container, { ContainerProps } from './container.js'
|
||||
|
||||
interface AtRuleRaws {
|
||||
/**
|
||||
* The space symbols before the node. It also stores `*`
|
||||
* and `_` symbols before the declaration (IE hack).
|
||||
*/
|
||||
before?: string
|
||||
|
||||
/**
|
||||
* The space symbols after the last child of the node to the end of the node.
|
||||
*/
|
||||
after?: string
|
||||
|
||||
/**
|
||||
* The space between the at-rule name and its parameters.
|
||||
*/
|
||||
afterName?: string
|
||||
|
||||
/**
|
||||
* The symbols between the last parameter and `{` for rules.
|
||||
*/
|
||||
between?: string
|
||||
|
||||
/**
|
||||
* Contains `true` if the last child has an (optional) semicolon.
|
||||
*/
|
||||
semicolon?: boolean
|
||||
|
||||
/**
|
||||
* The rule’s selector with comments.
|
||||
*/
|
||||
params?: {
|
||||
value: string
|
||||
raw: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface AtRuleProps extends ContainerProps {
|
||||
name: string
|
||||
params?: string | number
|
||||
raws?: AtRuleRaws
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an at-rule.
|
||||
*
|
||||
* ```js
|
||||
* Once (root, { AtRule }) {
|
||||
* let media = new AtRule({ name: 'media', params: 'print' })
|
||||
* media.append(…)
|
||||
* root.append(media)
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* If it’s followed in the CSS by a {} block, this node will have
|
||||
* a nodes property representing its children.
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse('@charset "UTF-8"; @media print {}')
|
||||
*
|
||||
* const charset = root.first
|
||||
* charset.type //=> 'atrule'
|
||||
* charset.nodes //=> undefined
|
||||
*
|
||||
* const media = root.last
|
||||
* media.nodes //=> []
|
||||
* ```
|
||||
*/
|
||||
export default class AtRule extends Container {
|
||||
type: 'atrule'
|
||||
raws: AtRuleRaws
|
||||
|
||||
/**
|
||||
* The at-rule’s name immediately follows the `@`.
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse('@media print {}')
|
||||
* media.name //=> 'media'
|
||||
* const media = root.first
|
||||
* ```
|
||||
*/
|
||||
name: string
|
||||
|
||||
/**
|
||||
* The at-rule’s parameters, the values that follow the at-rule’s name
|
||||
* but precede any {} block.
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse('@media print, screen {}')
|
||||
* const media = root.first
|
||||
* media.params //=> 'print, screen'
|
||||
* ```
|
||||
*/
|
||||
params: string
|
||||
|
||||
constructor(defaults?: AtRuleProps)
|
||||
clone(overrides?: Partial<AtRuleProps>): this
|
||||
cloneBefore(overrides?: Partial<AtRuleProps>): this
|
||||
cloneAfter(overrides?: Partial<AtRuleProps>): this
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ignoreElements.js","sources":["../src/operator/ignoreElements.ts"],"names":[],"mappings":";;;;;AAAA,yDAAoD"}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/publishBehavior';
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"J E F G A BC","132":"B"},B:{"132":"C K L H M N O","260":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 CC tB I u J E F G A B C K L H M N O v w x y z DC EC","516":"6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB"},D:{"1":"0 1 2 N O v w x y z","2":"I u J E F G A B C K L H M","132":"3 4 5 6 7 8 9 AB BB CB DB EB FB GB","260":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"1":"J HC IC","2":"I u GC zB","2052":"E F G A B C K L H JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB"},G:{"2":"zB TC AC","1025":"F UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"1025":"nC"},I:{"1":"tB I D oC pC qC rC AC sC tC"},J:{"1":"E A"},K:{"1":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2052":"A B"},O:{"1025":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"260":"1B"},R:{"1":"8C"},S:{"516":"9C"}},B:1,C:"autocomplete attribute: on & off values"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","2":"J E F G BC"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB I u J E F G A B C K L H M N O v w x y DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"1":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB"},G:{"1":"F UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC"},H:{"2":"nC"},I:{"1":"D AC sC tC","4":"tB I oC pC qC rC"},J:{"1":"E A"},K:{"1":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:1,C:"Range input type"};
|
||||
@@ -0,0 +1,65 @@
|
||||
import {OperatorFunction, ObservableInput} from '../types';
|
||||
import { switchMap } from './switchMap';
|
||||
import { identity } from '../util/identity';
|
||||
|
||||
export function switchAll<T>(): OperatorFunction<ObservableInput<T>, T>;
|
||||
export function switchAll<R>(): OperatorFunction<any, R>;
|
||||
|
||||
/**
|
||||
* Converts a higher-order Observable into a first-order Observable
|
||||
* producing values only from the most recent observable sequence
|
||||
*
|
||||
* <span class="informal">Flattens an Observable-of-Observables.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `switchAll` subscribes to a source that is an observable of observables, also known as a
|
||||
* "higher-order observable" (or `Observable<Observable<T>>`). It subscribes to the most recently
|
||||
* provided "inner observable" emitted by the source, unsubscribing from any previously subscribed
|
||||
* to inner observable, such that only the most recent inner observable may be subscribed to at
|
||||
* any point in time. The resulting observable returned by `switchAll` will only complete if the
|
||||
* source observable completes, *and* any currently subscribed to inner observable also has completed,
|
||||
* if there are any.
|
||||
*
|
||||
* ## Examples
|
||||
* Spawn a new interval observable for each click event, but for every new
|
||||
* click, cancel the previous interval and subscribe to the new one.
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, interval } from 'rxjs';
|
||||
* import { switchAll, map, tap } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click').pipe(tap(() => console.log('click')));
|
||||
* const source = clicks.pipe(map((ev) => interval(1000)));
|
||||
*
|
||||
* source.pipe(
|
||||
* switchAll()
|
||||
* ).subscribe(x => console.log(x));
|
||||
*
|
||||
* // Output
|
||||
* // click
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // 4
|
||||
* // ...
|
||||
* // click
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // ...
|
||||
* // click
|
||||
* // ...
|
||||
* ```
|
||||
*
|
||||
* @see {@link combineAll}
|
||||
* @see {@link concatAll}
|
||||
* @see {@link exhaust}
|
||||
* @see {@link switchMap}
|
||||
* @see {@link switchMapTo}
|
||||
* @see {@link mergeAll}
|
||||
*/
|
||||
|
||||
export function switchAll<T>(): OperatorFunction<ObservableInput<T>, T> {
|
||||
return switchMap(identity);
|
||||
}
|
||||
@@ -0,0 +1,684 @@
|
||||
(function() {
|
||||
var define, requireModule, require, requirejs;
|
||||
|
||||
(function() {
|
||||
var registry = {}, seen = {};
|
||||
|
||||
define = function(name, deps, callback) {
|
||||
registry[name] = { deps: deps, callback: callback };
|
||||
};
|
||||
|
||||
requirejs = require = requireModule = function(name) {
|
||||
requirejs._eak_seen = registry;
|
||||
|
||||
if (seen[name]) { return seen[name]; }
|
||||
seen[name] = {};
|
||||
|
||||
if (!registry[name]) {
|
||||
throw new Error("Could not find module " + name);
|
||||
}
|
||||
|
||||
var mod = registry[name],
|
||||
deps = mod.deps,
|
||||
callback = mod.callback,
|
||||
reified = [],
|
||||
exports;
|
||||
|
||||
for (var i=0, l=deps.length; i<l; i++) {
|
||||
if (deps[i] === 'exports') {
|
||||
reified.push(exports = {});
|
||||
} else {
|
||||
reified.push(requireModule(resolve(deps[i])));
|
||||
}
|
||||
}
|
||||
|
||||
var value = callback.apply(this, reified);
|
||||
return seen[name] = exports || value;
|
||||
|
||||
function resolve(child) {
|
||||
if (child.charAt(0) !== '.') { return child; }
|
||||
var parts = child.split("/");
|
||||
var parentBase = name.split("/").slice(0, -1);
|
||||
|
||||
for (var i=0, l=parts.length; i<l; i++) {
|
||||
var part = parts[i];
|
||||
|
||||
if (part === '..') { parentBase.pop(); }
|
||||
else if (part === '.') { continue; }
|
||||
else { parentBase.push(part); }
|
||||
}
|
||||
|
||||
return parentBase.join("/");
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
define("promise/all",
|
||||
["./utils","exports"],
|
||||
function(__dependency1__, __exports__) {
|
||||
"use strict";
|
||||
/* global toString */
|
||||
|
||||
var isArray = __dependency1__.isArray;
|
||||
var isFunction = __dependency1__.isFunction;
|
||||
|
||||
/**
|
||||
Returns a promise that is fulfilled when all the given promises have been
|
||||
fulfilled, or rejected if any of them become rejected. The return promise
|
||||
is fulfilled with an array that gives all the values in the order they were
|
||||
passed in the `promises` array argument.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var promise1 = RSVP.resolve(1);
|
||||
var promise2 = RSVP.resolve(2);
|
||||
var promise3 = RSVP.resolve(3);
|
||||
var promises = [ promise1, promise2, promise3 ];
|
||||
|
||||
RSVP.all(promises).then(function(array){
|
||||
// The array here would be [ 1, 2, 3 ];
|
||||
});
|
||||
```
|
||||
|
||||
If any of the `promises` given to `RSVP.all` are rejected, the first promise
|
||||
that is rejected will be given as an argument to the returned promises's
|
||||
rejection handler. For example:
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var promise1 = RSVP.resolve(1);
|
||||
var promise2 = RSVP.reject(new Error("2"));
|
||||
var promise3 = RSVP.reject(new Error("3"));
|
||||
var promises = [ promise1, promise2, promise3 ];
|
||||
|
||||
RSVP.all(promises).then(function(array){
|
||||
// Code here never runs because there are rejected promises!
|
||||
}, function(error) {
|
||||
// error.message === "2"
|
||||
});
|
||||
```
|
||||
|
||||
@method all
|
||||
@for RSVP
|
||||
@param {Array} promises
|
||||
@param {String} label
|
||||
@return {Promise} promise that is fulfilled when all `promises` have been
|
||||
fulfilled, or rejected if any of them become rejected.
|
||||
*/
|
||||
function all(promises) {
|
||||
/*jshint validthis:true */
|
||||
var Promise = this;
|
||||
|
||||
if (!isArray(promises)) {
|
||||
throw new TypeError('You must pass an array to all.');
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
var results = [], remaining = promises.length,
|
||||
promise;
|
||||
|
||||
if (remaining === 0) {
|
||||
resolve([]);
|
||||
}
|
||||
|
||||
function resolver(index) {
|
||||
return function(value) {
|
||||
resolveAll(index, value);
|
||||
};
|
||||
}
|
||||
|
||||
function resolveAll(index, value) {
|
||||
results[index] = value;
|
||||
if (--remaining === 0) {
|
||||
resolve(results);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < promises.length; i++) {
|
||||
promise = promises[i];
|
||||
|
||||
if (promise && isFunction(promise.then)) {
|
||||
promise.then(resolver(i), reject);
|
||||
} else {
|
||||
resolveAll(i, promise);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
__exports__.all = all;
|
||||
});
|
||||
define("promise/asap",
|
||||
["exports"],
|
||||
function(__exports__) {
|
||||
"use strict";
|
||||
var browserGlobal = (typeof window !== 'undefined') ? window : {};
|
||||
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
|
||||
var local = (typeof global !== 'undefined') ? global : (this === undefined? window:this);
|
||||
|
||||
// node
|
||||
function useNextTick() {
|
||||
return function() {
|
||||
process.nextTick(flush);
|
||||
};
|
||||
}
|
||||
|
||||
function useMutationObserver() {
|
||||
var iterations = 0;
|
||||
var observer = new BrowserMutationObserver(flush);
|
||||
var node = document.createTextNode('');
|
||||
observer.observe(node, { characterData: true });
|
||||
|
||||
return function() {
|
||||
node.data = (iterations = ++iterations % 2);
|
||||
};
|
||||
}
|
||||
|
||||
function useSetTimeout() {
|
||||
return function() {
|
||||
local.setTimeout(flush, 1);
|
||||
};
|
||||
}
|
||||
|
||||
var queue = [];
|
||||
function flush() {
|
||||
for (var i = 0; i < queue.length; i++) {
|
||||
var tuple = queue[i];
|
||||
var callback = tuple[0], arg = tuple[1];
|
||||
callback(arg);
|
||||
}
|
||||
queue = [];
|
||||
}
|
||||
|
||||
var scheduleFlush;
|
||||
|
||||
// Decide what async method to use to triggering processing of queued callbacks:
|
||||
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
|
||||
scheduleFlush = useNextTick();
|
||||
} else if (BrowserMutationObserver) {
|
||||
scheduleFlush = useMutationObserver();
|
||||
} else {
|
||||
scheduleFlush = useSetTimeout();
|
||||
}
|
||||
|
||||
function asap(callback, arg) {
|
||||
var length = queue.push([callback, arg]);
|
||||
if (length === 1) {
|
||||
// If length is 1, that means that we need to schedule an async flush.
|
||||
// If additional callbacks are queued before the queue is flushed, they
|
||||
// will be processed by this flush that we are scheduling.
|
||||
scheduleFlush();
|
||||
}
|
||||
}
|
||||
|
||||
__exports__.asap = asap;
|
||||
});
|
||||
define("promise/config",
|
||||
["exports"],
|
||||
function(__exports__) {
|
||||
"use strict";
|
||||
var config = {
|
||||
instrument: false
|
||||
};
|
||||
|
||||
function configure(name, value) {
|
||||
if (arguments.length === 2) {
|
||||
config[name] = value;
|
||||
} else {
|
||||
return config[name];
|
||||
}
|
||||
}
|
||||
|
||||
__exports__.config = config;
|
||||
__exports__.configure = configure;
|
||||
});
|
||||
define("promise/polyfill",
|
||||
["./promise","./utils","exports"],
|
||||
function(__dependency1__, __dependency2__, __exports__) {
|
||||
"use strict";
|
||||
/*global self*/
|
||||
var RSVPPromise = __dependency1__.Promise;
|
||||
var isFunction = __dependency2__.isFunction;
|
||||
|
||||
function polyfill() {
|
||||
var local;
|
||||
|
||||
if (typeof global !== 'undefined') {
|
||||
local = global;
|
||||
} else if (typeof window !== 'undefined' && window.document) {
|
||||
local = window;
|
||||
} else {
|
||||
local = self;
|
||||
}
|
||||
|
||||
var es6PromiseSupport =
|
||||
"Promise" in local &&
|
||||
// Some of these methods are missing from
|
||||
// Firefox/Chrome experimental implementations
|
||||
"resolve" in local.Promise &&
|
||||
"reject" in local.Promise &&
|
||||
"all" in local.Promise &&
|
||||
"race" in local.Promise &&
|
||||
// Older version of the spec had a resolver object
|
||||
// as the arg rather than a function
|
||||
(function() {
|
||||
var resolve;
|
||||
new local.Promise(function(r) { resolve = r; });
|
||||
return isFunction(resolve);
|
||||
}());
|
||||
|
||||
if (!es6PromiseSupport) {
|
||||
local.Promise = RSVPPromise;
|
||||
}
|
||||
}
|
||||
|
||||
__exports__.polyfill = polyfill;
|
||||
});
|
||||
define("promise/promise",
|
||||
["./config","./utils","./all","./race","./resolve","./reject","./asap","exports"],
|
||||
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {
|
||||
"use strict";
|
||||
var config = __dependency1__.config;
|
||||
var configure = __dependency1__.configure;
|
||||
var objectOrFunction = __dependency2__.objectOrFunction;
|
||||
var isFunction = __dependency2__.isFunction;
|
||||
var now = __dependency2__.now;
|
||||
var all = __dependency3__.all;
|
||||
var race = __dependency4__.race;
|
||||
var staticResolve = __dependency5__.resolve;
|
||||
var staticReject = __dependency6__.reject;
|
||||
var asap = __dependency7__.asap;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
config.async = asap; // default async is asap;
|
||||
|
||||
function Promise(resolver) {
|
||||
if (!isFunction(resolver)) {
|
||||
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
|
||||
}
|
||||
|
||||
if (!(this instanceof Promise)) {
|
||||
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
|
||||
}
|
||||
|
||||
this._subscribers = [];
|
||||
|
||||
invokeResolver(resolver, this);
|
||||
}
|
||||
|
||||
function invokeResolver(resolver, promise) {
|
||||
function resolvePromise(value) {
|
||||
resolve(promise, value);
|
||||
}
|
||||
|
||||
function rejectPromise(reason) {
|
||||
reject(promise, reason);
|
||||
}
|
||||
|
||||
try {
|
||||
resolver(resolvePromise, rejectPromise);
|
||||
} catch(e) {
|
||||
rejectPromise(e);
|
||||
}
|
||||
}
|
||||
|
||||
function invokeCallback(settled, promise, callback, detail) {
|
||||
var hasCallback = isFunction(callback),
|
||||
value, error, succeeded, failed;
|
||||
|
||||
if (hasCallback) {
|
||||
try {
|
||||
value = callback(detail);
|
||||
succeeded = true;
|
||||
} catch(e) {
|
||||
failed = true;
|
||||
error = e;
|
||||
}
|
||||
} else {
|
||||
value = detail;
|
||||
succeeded = true;
|
||||
}
|
||||
|
||||
if (handleThenable(promise, value)) {
|
||||
return;
|
||||
} else if (hasCallback && succeeded) {
|
||||
resolve(promise, value);
|
||||
} else if (failed) {
|
||||
reject(promise, error);
|
||||
} else if (settled === FULFILLED) {
|
||||
resolve(promise, value);
|
||||
} else if (settled === REJECTED) {
|
||||
reject(promise, value);
|
||||
}
|
||||
}
|
||||
|
||||
var PENDING = void 0;
|
||||
var SEALED = 0;
|
||||
var FULFILLED = 1;
|
||||
var REJECTED = 2;
|
||||
|
||||
function subscribe(parent, child, onFulfillment, onRejection) {
|
||||
var subscribers = parent._subscribers;
|
||||
var length = subscribers.length;
|
||||
|
||||
subscribers[length] = child;
|
||||
subscribers[length + FULFILLED] = onFulfillment;
|
||||
subscribers[length + REJECTED] = onRejection;
|
||||
}
|
||||
|
||||
function publish(promise, settled) {
|
||||
var child, callback, subscribers = promise._subscribers, detail = promise._detail;
|
||||
|
||||
for (var i = 0; i < subscribers.length; i += 3) {
|
||||
child = subscribers[i];
|
||||
callback = subscribers[i + settled];
|
||||
|
||||
invokeCallback(settled, child, callback, detail);
|
||||
}
|
||||
|
||||
promise._subscribers = null;
|
||||
}
|
||||
|
||||
Promise.prototype = {
|
||||
constructor: Promise,
|
||||
|
||||
_state: undefined,
|
||||
_detail: undefined,
|
||||
_subscribers: undefined,
|
||||
|
||||
then: function(onFulfillment, onRejection) {
|
||||
var promise = this;
|
||||
|
||||
var thenPromise = new this.constructor(function() {});
|
||||
|
||||
if (this._state) {
|
||||
var callbacks = arguments;
|
||||
config.async(function invokePromiseCallback() {
|
||||
invokeCallback(promise._state, thenPromise, callbacks[promise._state - 1], promise._detail);
|
||||
});
|
||||
} else {
|
||||
subscribe(this, thenPromise, onFulfillment, onRejection);
|
||||
}
|
||||
|
||||
return thenPromise;
|
||||
},
|
||||
|
||||
'catch': function(onRejection) {
|
||||
return this.then(null, onRejection);
|
||||
}
|
||||
};
|
||||
|
||||
Promise.all = all;
|
||||
Promise.race = race;
|
||||
Promise.resolve = staticResolve;
|
||||
Promise.reject = staticReject;
|
||||
|
||||
function handleThenable(promise, value) {
|
||||
var then = null,
|
||||
resolved;
|
||||
|
||||
try {
|
||||
if (promise === value) {
|
||||
throw new TypeError("A promises callback cannot return that same promise.");
|
||||
}
|
||||
|
||||
if (objectOrFunction(value)) {
|
||||
then = value.then;
|
||||
|
||||
if (isFunction(then)) {
|
||||
then.call(value, function(val) {
|
||||
if (resolved) { return true; }
|
||||
resolved = true;
|
||||
|
||||
if (value !== val) {
|
||||
resolve(promise, val);
|
||||
} else {
|
||||
fulfill(promise, val);
|
||||
}
|
||||
}, function(val) {
|
||||
if (resolved) { return true; }
|
||||
resolved = true;
|
||||
|
||||
reject(promise, val);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if (resolved) { return true; }
|
||||
reject(promise, error);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function resolve(promise, value) {
|
||||
if (promise === value) {
|
||||
fulfill(promise, value);
|
||||
} else if (!handleThenable(promise, value)) {
|
||||
fulfill(promise, value);
|
||||
}
|
||||
}
|
||||
|
||||
function fulfill(promise, value) {
|
||||
if (promise._state !== PENDING) { return; }
|
||||
promise._state = SEALED;
|
||||
promise._detail = value;
|
||||
|
||||
config.async(publishFulfillment, promise);
|
||||
}
|
||||
|
||||
function reject(promise, reason) {
|
||||
if (promise._state !== PENDING) { return; }
|
||||
promise._state = SEALED;
|
||||
promise._detail = reason;
|
||||
|
||||
config.async(publishRejection, promise);
|
||||
}
|
||||
|
||||
function publishFulfillment(promise) {
|
||||
publish(promise, promise._state = FULFILLED);
|
||||
}
|
||||
|
||||
function publishRejection(promise) {
|
||||
publish(promise, promise._state = REJECTED);
|
||||
}
|
||||
|
||||
__exports__.Promise = Promise;
|
||||
});
|
||||
define("promise/race",
|
||||
["./utils","exports"],
|
||||
function(__dependency1__, __exports__) {
|
||||
"use strict";
|
||||
/* global toString */
|
||||
var isArray = __dependency1__.isArray;
|
||||
|
||||
/**
|
||||
`RSVP.race` allows you to watch a series of promises and act as soon as the
|
||||
first promise given to the `promises` argument fulfills or rejects.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var promise1 = new RSVP.Promise(function(resolve, reject){
|
||||
setTimeout(function(){
|
||||
resolve("promise 1");
|
||||
}, 200);
|
||||
});
|
||||
|
||||
var promise2 = new RSVP.Promise(function(resolve, reject){
|
||||
setTimeout(function(){
|
||||
resolve("promise 2");
|
||||
}, 100);
|
||||
});
|
||||
|
||||
RSVP.race([promise1, promise2]).then(function(result){
|
||||
// result === "promise 2" because it was resolved before promise1
|
||||
// was resolved.
|
||||
});
|
||||
```
|
||||
|
||||
`RSVP.race` is deterministic in that only the state of the first completed
|
||||
promise matters. For example, even if other promises given to the `promises`
|
||||
array argument are resolved, but the first completed promise has become
|
||||
rejected before the other promises became fulfilled, the returned promise
|
||||
will become rejected:
|
||||
|
||||
```javascript
|
||||
var promise1 = new RSVP.Promise(function(resolve, reject){
|
||||
setTimeout(function(){
|
||||
resolve("promise 1");
|
||||
}, 200);
|
||||
});
|
||||
|
||||
var promise2 = new RSVP.Promise(function(resolve, reject){
|
||||
setTimeout(function(){
|
||||
reject(new Error("promise 2"));
|
||||
}, 100);
|
||||
});
|
||||
|
||||
RSVP.race([promise1, promise2]).then(function(result){
|
||||
// Code here never runs because there are rejected promises!
|
||||
}, function(reason){
|
||||
// reason.message === "promise2" because promise 2 became rejected before
|
||||
// promise 1 became fulfilled
|
||||
});
|
||||
```
|
||||
|
||||
@method race
|
||||
@for RSVP
|
||||
@param {Array} promises array of promises to observe
|
||||
@param {String} label optional string for describing the promise returned.
|
||||
Useful for tooling.
|
||||
@return {Promise} a promise that becomes fulfilled with the value the first
|
||||
completed promises is resolved with if the first completed promise was
|
||||
fulfilled, or rejected with the reason that the first completed promise
|
||||
was rejected with.
|
||||
*/
|
||||
function race(promises) {
|
||||
/*jshint validthis:true */
|
||||
var Promise = this;
|
||||
|
||||
if (!isArray(promises)) {
|
||||
throw new TypeError('You must pass an array to race.');
|
||||
}
|
||||
return new Promise(function(resolve, reject) {
|
||||
var results = [], promise;
|
||||
|
||||
for (var i = 0; i < promises.length; i++) {
|
||||
promise = promises[i];
|
||||
|
||||
if (promise && typeof promise.then === 'function') {
|
||||
promise.then(resolve, reject);
|
||||
} else {
|
||||
resolve(promise);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
__exports__.race = race;
|
||||
});
|
||||
define("promise/reject",
|
||||
["exports"],
|
||||
function(__exports__) {
|
||||
"use strict";
|
||||
/**
|
||||
`RSVP.reject` returns a promise that will become rejected with the passed
|
||||
`reason`. `RSVP.reject` is essentially shorthand for the following:
|
||||
|
||||
```javascript
|
||||
var promise = new RSVP.Promise(function(resolve, reject){
|
||||
reject(new Error('WHOOPS'));
|
||||
});
|
||||
|
||||
promise.then(function(value){
|
||||
// Code here doesn't run because the promise is rejected!
|
||||
}, function(reason){
|
||||
// reason.message === 'WHOOPS'
|
||||
});
|
||||
```
|
||||
|
||||
Instead of writing the above, your code now simply becomes the following:
|
||||
|
||||
```javascript
|
||||
var promise = RSVP.reject(new Error('WHOOPS'));
|
||||
|
||||
promise.then(function(value){
|
||||
// Code here doesn't run because the promise is rejected!
|
||||
}, function(reason){
|
||||
// reason.message === 'WHOOPS'
|
||||
});
|
||||
```
|
||||
|
||||
@method reject
|
||||
@for RSVP
|
||||
@param {Any} reason value that the returned promise will be rejected with.
|
||||
@param {String} label optional string for identifying the returned promise.
|
||||
Useful for tooling.
|
||||
@return {Promise} a promise that will become rejected with the given
|
||||
`reason`.
|
||||
*/
|
||||
function reject(reason) {
|
||||
/*jshint validthis:true */
|
||||
var Promise = this;
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
reject(reason);
|
||||
});
|
||||
}
|
||||
|
||||
__exports__.reject = reject;
|
||||
});
|
||||
define("promise/resolve",
|
||||
["exports"],
|
||||
function(__exports__) {
|
||||
"use strict";
|
||||
function resolve(value) {
|
||||
/*jshint validthis:true */
|
||||
if (value && typeof value === 'object' && value.constructor === this) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var Promise = this;
|
||||
|
||||
return new Promise(function(resolve) {
|
||||
resolve(value);
|
||||
});
|
||||
}
|
||||
|
||||
__exports__.resolve = resolve;
|
||||
});
|
||||
define("promise/utils",
|
||||
["exports"],
|
||||
function(__exports__) {
|
||||
"use strict";
|
||||
function objectOrFunction(x) {
|
||||
return isFunction(x) || (typeof x === "object" && x !== null);
|
||||
}
|
||||
|
||||
function isFunction(x) {
|
||||
return typeof x === "function";
|
||||
}
|
||||
|
||||
function isArray(x) {
|
||||
return Object.prototype.toString.call(x) === "[object Array]";
|
||||
}
|
||||
|
||||
// Date.now is not available in browsers < IE9
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility
|
||||
var now = Date.now || function() { return new Date().getTime(); };
|
||||
|
||||
|
||||
__exports__.objectOrFunction = objectOrFunction;
|
||||
__exports__.isFunction = isFunction;
|
||||
__exports__.isArray = isArray;
|
||||
__exports__.now = now;
|
||||
});
|
||||
requireModule('promise/polyfill').polyfill();
|
||||
}());
|
||||
@@ -0,0 +1,149 @@
|
||||
const test = require('ava');
|
||||
const sh = require('shelljs');
|
||||
const Shell = require('../lib/shell');
|
||||
const Git = require('../lib/plugin/git/Git');
|
||||
const { git } = require('../config/release-it.json');
|
||||
const { factory } = require('./util');
|
||||
const { mkTmpDir, gitAdd } = require('./util/helpers');
|
||||
|
||||
test.serial.beforeEach(t => {
|
||||
const bare = mkTmpDir();
|
||||
const target = mkTmpDir();
|
||||
sh.pushd('-q', bare);
|
||||
sh.exec(`git init --bare .`);
|
||||
sh.exec(`git clone ${bare} ${target}`);
|
||||
sh.pushd('-q', target);
|
||||
gitAdd('line', 'file', 'Add file');
|
||||
t.context = { bare, target };
|
||||
});
|
||||
|
||||
test.serial('should throw if on wrong branch', async t => {
|
||||
const options = { git: { requireBranch: 'dev' } };
|
||||
const gitClient = factory(Git, { options });
|
||||
sh.exec('git remote remove origin');
|
||||
await t.throwsAsync(gitClient.init(), { message: /^Must be on branch dev/ });
|
||||
});
|
||||
|
||||
test.serial('should throw if there is no remote Git url', async t => {
|
||||
const gitClient = factory(Git, { options: { git } });
|
||||
sh.exec('git remote remove origin');
|
||||
await t.throwsAsync(gitClient.init(), { message: /^Could not get remote Git url/ });
|
||||
});
|
||||
|
||||
test.serial('should throw if working dir is not clean', async t => {
|
||||
const gitClient = factory(Git, { options: { git } });
|
||||
sh.exec('rm file');
|
||||
await t.throwsAsync(gitClient.init(), { message: /^Working dir must be clean/ });
|
||||
});
|
||||
|
||||
test.serial('should throw if no upstream is configured', async t => {
|
||||
const gitClient = factory(Git, { options: { git } });
|
||||
sh.exec('git checkout -b foo');
|
||||
await t.throwsAsync(gitClient.init(), { message: /^No upstream configured for current branch/ });
|
||||
});
|
||||
|
||||
test.serial('should throw if there are no commits', async t => {
|
||||
const options = { git: { requireCommits: true } };
|
||||
const gitClient = factory(Git, { options });
|
||||
sh.exec('git tag 1.0.0');
|
||||
await t.throwsAsync(gitClient.init(), { message: /^There are no commits since the latest tag/ });
|
||||
});
|
||||
|
||||
test.serial('should not throw if there are commits', async t => {
|
||||
const options = { git: { requireCommits: true } };
|
||||
const gitClient = factory(Git, { options });
|
||||
sh.exec('git tag 1.0.0');
|
||||
gitAdd('line', 'file', 'Add file');
|
||||
await t.notThrowsAsync(gitClient.init());
|
||||
});
|
||||
|
||||
test.serial('should not throw if there are no tags', async t => {
|
||||
const options = { git: { requireCommits: true } };
|
||||
const gitClient = factory(Git, { options });
|
||||
gitAdd('line', 'file', 'Add file');
|
||||
await t.notThrowsAsync(gitClient.init());
|
||||
});
|
||||
|
||||
test.serial('should not throw if origin remote is renamed', async t => {
|
||||
sh.exec('git remote rename origin upstream');
|
||||
const gitClient = factory(Git);
|
||||
await t.notThrowsAsync(gitClient.init());
|
||||
});
|
||||
|
||||
test.serial('should detect and include version prefix ("v")', async t => {
|
||||
const gitClient = factory(Git, { options: { git } });
|
||||
sh.exec('git tag v1.0.0');
|
||||
await gitClient.init();
|
||||
await gitClient.bump('1.0.1');
|
||||
t.is(gitClient.getContext('tagName'), 'v1.0.1');
|
||||
});
|
||||
|
||||
test.serial('should detect and exclude version prefix', async t => {
|
||||
const gitClient = factory(Git, { options: { git } });
|
||||
sh.exec('git tag 1.0.0');
|
||||
await gitClient.init();
|
||||
await gitClient.bump('1.0.1');
|
||||
t.is(gitClient.getContext('tagName'), '1.0.1');
|
||||
});
|
||||
|
||||
test.serial('should detect and exclude version prefix (configured)', async t => {
|
||||
const gitClient = factory(Git, { options: { git: { tagName: 'v${version}' } } });
|
||||
sh.exec('git tag 1.0.0');
|
||||
await gitClient.init();
|
||||
await gitClient.bump('1.0.1');
|
||||
t.is(gitClient.getContext('tagName'), 'v1.0.1');
|
||||
});
|
||||
|
||||
test.serial('should honor custom tagName configuration', async t => {
|
||||
const gitClient = factory(Git, { options: { git: { tagName: 'TAGNAME-${repo.project}-v${version}' } } });
|
||||
sh.exec('git tag 1.0.0');
|
||||
await gitClient.init();
|
||||
await gitClient.bump('1.0.1');
|
||||
const { project } = gitClient.getContext('repo');
|
||||
t.is(gitClient.getContext('tagName'), `TAGNAME-${project}-v1.0.1`);
|
||||
});
|
||||
|
||||
test.serial('should get the latest tag after fetch', async t => {
|
||||
const shell = factory(Shell);
|
||||
const gitClient = factory(Git, { container: { shell } });
|
||||
const { bare, target } = t.context;
|
||||
const other = mkTmpDir();
|
||||
sh.exec('git push');
|
||||
sh.exec(`git clone ${bare} ${other}`);
|
||||
sh.pushd('-q', other);
|
||||
sh.exec('git tag 1.0.0');
|
||||
sh.exec('git push --tags');
|
||||
sh.pushd('-q', target);
|
||||
await gitClient.init();
|
||||
t.is(gitClient.getContext('latestTagName'), '1.0.0');
|
||||
});
|
||||
|
||||
test.serial('should get the latest custom tag after fetch when tagName is configured', async t => {
|
||||
const shell = factory(Shell);
|
||||
const gitClient = factory(Git, {
|
||||
options: { git: { tagName: 'TAGNAME-v${version}' } },
|
||||
container: { shell }
|
||||
});
|
||||
const { bare, target } = t.context;
|
||||
const other = mkTmpDir();
|
||||
sh.exec('git push');
|
||||
sh.exec(`git clone ${bare} ${other}`);
|
||||
sh.pushd('-q', other);
|
||||
sh.exec('git tag TAGNAME-OTHER-v2.0.0');
|
||||
sh.exec('git tag TAGNAME-v1.0.0');
|
||||
sh.exec('git tag TAGNAME-OTHER-v2.0.2');
|
||||
sh.exec('git push --tags');
|
||||
sh.pushd('-q', target);
|
||||
await gitClient.init();
|
||||
t.is(gitClient.getContext('latestTagName'), 'TAGNAME-v1.0.0');
|
||||
});
|
||||
|
||||
test.serial('should generate correct changelog', async t => {
|
||||
const gitClient = factory(Git, { options: { git } });
|
||||
sh.exec('git tag 1.0.0');
|
||||
gitAdd('line', 'file', 'Add file');
|
||||
gitAdd('line', 'file', 'Add file');
|
||||
await gitClient.init();
|
||||
const changelog = await gitClient.getChangelog();
|
||||
t.regex(changelog, /\* Add file \(\w{7}\)\n\* Add file \(\w{7}\)/);
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fetch_1 = require("../internal/observable/dom/fetch");
|
||||
exports.fromFetch = fetch_1.fromFetch;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ColdObservable.js","sources":["../../../src/internal/testing/ColdObservable.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQlD;IAAuC,0CAAa;IAMlD,wBAAmB,QAAuB,EAC9B,SAAoB;QADhC,YAEE,kBAAM,UAA+B,UAA2B;YAC9D,IAAM,UAAU,GAAsB,IAAW,CAAC;YAClD,IAAM,KAAK,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;YAC9C,IAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;YACxC,YAAY,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC;gBAChC,UAAU,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC,CAAC;YACJ,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACxC,OAAO,YAAY,CAAC;QACtB,CAAC,CAAC,SAEH;QAbkB,cAAQ,GAAR,QAAQ,CAAe;QALnC,mBAAa,GAAsB,EAAE,CAAC;QAiB3C,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;;IAC7B,CAAC;IAED,yCAAgB,GAAhB,UAAiB,UAA2B;QAC1C,IAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE;YACvC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACjC,UAAU,CAAC,GAAG,CACZ,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAC,EAAuB;oBAArB,oBAAO,EAAE,0BAAU;gBAAS,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAAC,CAAC,EAChG,OAAO,CAAC,KAAK,EACb,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,CAAC,CAC3B,CAAC;SACH;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAhCD,CAAuC,UAAU,GAgChD;;AACD,WAAW,CAAC,cAAc,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concatMap.js","sources":["../src/operator/concatMap.ts"],"names":[],"mappings":";;;;;AAAA,oDAA+C"}
|
||||
@@ -0,0 +1,218 @@
|
||||
'use strict';
|
||||
/**
|
||||
* `rawlist` type prompt
|
||||
*/
|
||||
|
||||
var _ = {
|
||||
extend: require('lodash/extend'),
|
||||
isNumber: require('lodash/isNumber'),
|
||||
findIndex: require('lodash/findIndex'),
|
||||
};
|
||||
var chalk = require('chalk');
|
||||
var { map, takeUntil } = require('rxjs/operators');
|
||||
var Base = require('./base');
|
||||
var Separator = require('../objects/separator');
|
||||
var observe = require('../utils/events');
|
||||
var Paginator = require('../utils/paginator');
|
||||
var incrementListIndex = require('../utils/incrementListIndex');
|
||||
|
||||
class RawListPrompt extends Base {
|
||||
constructor(questions, rl, answers) {
|
||||
super(questions, rl, answers);
|
||||
|
||||
if (!this.opt.choices) {
|
||||
this.throwParamError('choices');
|
||||
}
|
||||
|
||||
this.opt.validChoices = this.opt.choices.filter(Separator.exclude);
|
||||
|
||||
this.selected = 0;
|
||||
this.rawDefault = 0;
|
||||
|
||||
_.extend(this.opt, {
|
||||
validate: function (val) {
|
||||
return val != null;
|
||||
},
|
||||
});
|
||||
|
||||
var def = this.opt.default;
|
||||
if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) {
|
||||
this.selected = def;
|
||||
this.rawDefault = def;
|
||||
} else if (!_.isNumber(def) && def != null) {
|
||||
let index = _.findIndex(this.opt.choices.realChoices, ({ value }) => value === def);
|
||||
let safeIndex = Math.max(index, 0);
|
||||
this.selected = safeIndex;
|
||||
this.rawDefault = safeIndex;
|
||||
}
|
||||
|
||||
// Make sure no default is set (so it won't be printed)
|
||||
this.opt.default = null;
|
||||
|
||||
const shouldLoop = this.opt.loop === undefined ? true : this.opt.loop;
|
||||
this.paginator = new Paginator(undefined, { isInfinite: shouldLoop });
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the Inquiry session
|
||||
* @param {Function} cb Callback when prompt is done
|
||||
* @return {this}
|
||||
*/
|
||||
|
||||
_run(cb) {
|
||||
this.done = cb;
|
||||
|
||||
// Once user confirm (enter key)
|
||||
var events = observe(this.rl);
|
||||
var submit = events.line.pipe(map(this.getCurrentValue.bind(this)));
|
||||
|
||||
var validation = this.handleSubmitEvents(submit);
|
||||
validation.success.forEach(this.onEnd.bind(this));
|
||||
validation.error.forEach(this.onError.bind(this));
|
||||
|
||||
events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this));
|
||||
events.normalizedDownKey
|
||||
.pipe(takeUntil(events.line))
|
||||
.forEach(this.onDownKey.bind(this));
|
||||
events.keypress
|
||||
.pipe(takeUntil(validation.success))
|
||||
.forEach(this.onKeypress.bind(this));
|
||||
// Init the prompt
|
||||
this.render();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the prompt to screen
|
||||
* @return {RawListPrompt} self
|
||||
*/
|
||||
|
||||
render(error) {
|
||||
// Render question
|
||||
var message = this.getQuestion();
|
||||
var bottomContent = '';
|
||||
|
||||
if (this.status === 'answered') {
|
||||
message += chalk.cyan(this.answer);
|
||||
} else {
|
||||
var choicesStr = renderChoices(this.opt.choices, this.selected);
|
||||
message +=
|
||||
'\n' + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
|
||||
message += '\n Answer: ';
|
||||
}
|
||||
message += this.rl.line;
|
||||
|
||||
if (error) {
|
||||
bottomContent = '\n' + chalk.red('>> ') + error;
|
||||
}
|
||||
|
||||
this.screen.render(message, bottomContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* When user press `enter` key
|
||||
*/
|
||||
|
||||
getCurrentValue(index) {
|
||||
if (index == null) {
|
||||
index = this.rawDefault;
|
||||
} else if (index === '') {
|
||||
index = this.selected;
|
||||
} else {
|
||||
index -= 1;
|
||||
}
|
||||
|
||||
var choice = this.opt.choices.getChoice(index);
|
||||
return choice ? choice.value : null;
|
||||
}
|
||||
|
||||
onEnd(state) {
|
||||
this.status = 'answered';
|
||||
this.answer = state.value;
|
||||
|
||||
// Re-render prompt
|
||||
this.render();
|
||||
|
||||
this.screen.done();
|
||||
this.done(state.value);
|
||||
}
|
||||
|
||||
onError() {
|
||||
this.render('Please enter a valid index');
|
||||
}
|
||||
|
||||
/**
|
||||
* When user press a key
|
||||
*/
|
||||
|
||||
onKeypress() {
|
||||
var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0;
|
||||
|
||||
if (this.opt.choices.getChoice(index)) {
|
||||
this.selected = index;
|
||||
} else {
|
||||
this.selected = undefined;
|
||||
}
|
||||
this.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* When user press up key
|
||||
*/
|
||||
|
||||
onUpKey() {
|
||||
this.onArrowKey('up');
|
||||
}
|
||||
|
||||
/**
|
||||
* When user press down key
|
||||
*/
|
||||
|
||||
onDownKey() {
|
||||
this.onArrowKey('down');
|
||||
}
|
||||
|
||||
/**
|
||||
* When user press up or down key
|
||||
* @param {String} type Arrow type: up or down
|
||||
*/
|
||||
|
||||
onArrowKey(type) {
|
||||
this.selected = incrementListIndex(this.selected, type, this.opt);
|
||||
this.rl.line = String(this.selected + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for rendering list choices
|
||||
* @param {Number} pointer Position of the pointer
|
||||
* @return {String} Rendered content
|
||||
*/
|
||||
|
||||
function renderChoices(choices, pointer) {
|
||||
var output = '';
|
||||
var separatorOffset = 0;
|
||||
|
||||
choices.forEach(function (choice, i) {
|
||||
output += '\n ';
|
||||
|
||||
if (choice.type === 'separator') {
|
||||
separatorOffset++;
|
||||
output += ' ' + choice;
|
||||
return;
|
||||
}
|
||||
|
||||
var index = i - separatorOffset;
|
||||
var display = index + 1 + ') ' + choice.name;
|
||||
if (index === pointer) {
|
||||
display = chalk.cyan(display);
|
||||
}
|
||||
|
||||
output += display;
|
||||
});
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
module.exports = RawListPrompt;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M"},C:{"1":"PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB DC EC"},D:{"1":"UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB","194":"SB TB"},E:{"1":"A B C K L H 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J E F G GC zB HC IC JC KC"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB OC PC QC RC qB 9B SC rB","194":"GB"},G:{"1":"aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I vC"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:1,C:"DOM manipulation convenience methods"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skipWhile.js","sources":["../../../src/internal/operators/skipWhile.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAe3C,MAAM,UAAU,SAAS,CAAI,SAA+C;IAC1E,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC,EAA7C,CAA6C,CAAC;AAClF,CAAC;AAED;IACE,2BAAoB,SAA+C;QAA/C,cAAS,GAAT,SAAS,CAAsC;IACnE,CAAC;IAED,gCAAI,GAAJ,UAAK,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/E,CAAC;IACH,wBAAC;AAAD,CAAC,AAPD,IAOC;AAOD;IAAqC,+CAAa;IAIhD,6BAAY,WAA0B,EAClB,SAA+C;QADnE,YAEE,kBAAM,WAAW,CAAC,SACnB;QAFmB,eAAS,GAAT,SAAS,CAAsC;QAJ3D,cAAQ,GAAY,IAAI,CAAC;QACzB,WAAK,GAAW,CAAC,CAAC;;IAK1B,CAAC;IAES,mCAAK,GAAf,UAAgB,KAAQ;QACtB,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;IACH,CAAC;IAEO,8CAAgB,GAAxB,UAAyB,KAAQ;QAC/B,IAAI;YACF,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;SACjC;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC7B;IACH,CAAC;IACH,0BAAC;AAAD,CAAC,AA5BD,CAAqC,UAAU,GA4B9C"}
|
||||
@@ -0,0 +1,101 @@
|
||||
const fs = require('fs');
|
||||
const { EOL } = require('os');
|
||||
const _ = require('lodash');
|
||||
const gitUrlParse = require('git-url-parse');
|
||||
const semver = require('semver');
|
||||
const osName = require('os-name');
|
||||
const pkg = require('../package.json');
|
||||
const Log = require('./log');
|
||||
|
||||
const log = new Log();
|
||||
|
||||
const getSystemInfo = () => {
|
||||
return {
|
||||
'release-it': pkg.version,
|
||||
node: process.version,
|
||||
os: osName()
|
||||
};
|
||||
};
|
||||
|
||||
const clean = args => args.filter(arg => arg != null);
|
||||
|
||||
const format = (template = '', context = {}) => {
|
||||
try {
|
||||
return _.template(template)(context);
|
||||
} catch (error) {
|
||||
log.error(`Unable to render template with context:\n${template}\n${JSON.stringify(context)}`);
|
||||
log.error(error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const truncateLines = (input, maxLines = 10, surplusText = null) => {
|
||||
const lines = input.split(EOL);
|
||||
const surplus = lines.length - maxLines;
|
||||
const output = lines.slice(0, maxLines).join(EOL);
|
||||
return surplus > 0 ? (surplusText ? `${output}${surplusText}` : `${output}${EOL}...and ${surplus} more`) : output;
|
||||
};
|
||||
|
||||
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
const rejectAfter = (ms, error) =>
|
||||
wait(ms).then(() => {
|
||||
throw error;
|
||||
});
|
||||
|
||||
const parseGitUrl = remoteUrl => {
|
||||
if (!remoteUrl) return { host: null, owner: null, project: null, protocol: null, remote: null, repository: null };
|
||||
const normalizedUrl = (remoteUrl || '').replace(/\\/g, '/');
|
||||
const parsedUrl = gitUrlParse(normalizedUrl);
|
||||
const { resource: host, name: project, protocol, href: remote } = parsedUrl;
|
||||
const owner = protocol === 'file' ? _.last(parsedUrl.owner.split('/')) : parsedUrl.owner;
|
||||
const repository = `${owner}/${project}`;
|
||||
return { host, owner, project, protocol, remote, repository };
|
||||
};
|
||||
|
||||
const reduceUntil = async (collection, fn) => {
|
||||
let result;
|
||||
for (const item of collection) {
|
||||
if (result) break;
|
||||
result = await fn(item);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
const hasAccess = path => {
|
||||
try {
|
||||
fs.accessSync(path);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const parseVersion = raw => {
|
||||
if (raw == null) return { version: raw, isPreRelease: false, preReleaseId: null };
|
||||
const version = semver.valid(raw) ? raw : semver.coerce(raw);
|
||||
if (!version) return { version: raw, isPreRelease: false, preReleaseId: null };
|
||||
const parsed = semver.parse(version);
|
||||
const isPreRelease = parsed.prerelease.length > 0;
|
||||
const preReleaseId = isPreRelease && isNaN(parsed.prerelease[0]) ? parsed.prerelease[0] : null;
|
||||
return {
|
||||
version: version.toString(),
|
||||
isPreRelease,
|
||||
preReleaseId
|
||||
};
|
||||
};
|
||||
|
||||
const e = (message, docs) => new Error(docs ? `${message}${EOL}Documentation: ${docs}${EOL}` : message);
|
||||
|
||||
module.exports = {
|
||||
getSystemInfo,
|
||||
clean,
|
||||
format,
|
||||
truncateLines,
|
||||
rejectAfter,
|
||||
reduceUntil,
|
||||
parseGitUrl,
|
||||
hasAccess,
|
||||
parseVersion,
|
||||
e
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"throttleTime.js","sources":["../../../src/internal/operators/throttleTime.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAkB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAkFnE,MAAM,UAAU,YAAY,CAAI,QAAgB,EAChB,SAAgC,EAChC,MAA8C;IAD9C,0BAAA,EAAA,iBAAgC;IAChC,uBAAA,EAAA,8BAA8C;IAC5E,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,EAA3F,CAA2F,CAAC;AAChI,CAAC;AAED;IACE,8BAAoB,QAAgB,EAChB,SAAwB,EACxB,OAAgB,EAChB,QAAiB;QAHjB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAe;QACxB,YAAO,GAAP,OAAO,CAAS;QAChB,aAAQ,GAAR,QAAQ,CAAS;IACrC,CAAC;IAED,mCAAI,GAAJ,UAAK,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CACrB,IAAI,sBAAsB,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CACnG,CAAC;IACJ,CAAC;IACH,2BAAC;AAAD,CAAC,AAZD,IAYC;AAOD;IAAwC,kDAAa;IAKnD,gCAAY,WAA0B,EAClB,QAAgB,EAChB,SAAwB,EACxB,OAAgB,EAChB,QAAiB;QAJrC,YAKE,kBAAM,WAAW,CAAC,SACnB;QALmB,cAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAS,GAAT,SAAS,CAAe;QACxB,aAAO,GAAP,OAAO,CAAS;QAChB,cAAQ,GAAR,QAAQ,CAAS;QAP7B,uBAAiB,GAAY,KAAK,CAAC;QACnC,oBAAc,GAAM,IAAI,CAAC;;IAQjC,CAAC;IAES,sCAAK,GAAf,UAAgB,KAAQ;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;gBAC5B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;aAC/B;SACF;aAAM;YACL,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAiB,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACtH,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC9B;iBAAM,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACxB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;gBAC5B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;aAC/B;SACF;IACH,CAAC;IAES,0CAAS,GAAnB;QACE,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC3C,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC7B;aAAM;YACL,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC7B;IACH,CAAC;IAED,8CAAa,GAAb;QACE,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,SAAS,EAAE;YACb,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC3C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAC3C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3B,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;aAChC;YACD,SAAS,CAAC,WAAW,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACvB;IACH,CAAC;IACH,6BAAC;AAAD,CAAC,AApDD,CAAwC,UAAU,GAoDjD;AAMD,SAAS,YAAY,CAAI,GAAmB;IAClC,IAAA,2BAAU,CAAS;IAC3B,UAAU,CAAC,aAAa,EAAE,CAAC;AAC7B,CAAC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/InnerSubscriber"));
|
||||
//# sourceMappingURL=InnerSubscriber.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"windowWhen.js","sources":["../src/operator/windowWhen.ts"],"names":[],"mappings":";;;;;AAAA,qDAAgD"}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/switchMapTo';
|
||||
@@ -0,0 +1,36 @@
|
||||
import { noop } from './noop';
|
||||
import { identity } from './identity';
|
||||
import { UnaryFunction } from '../types';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
export function pipe<T>(): UnaryFunction<T, T>;
|
||||
export function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;
|
||||
export function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;
|
||||
export function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;
|
||||
export function pipe<T, A, B, C, D>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>): UnaryFunction<T, D>;
|
||||
export function pipe<T, A, B, C, D, E>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>): UnaryFunction<T, E>;
|
||||
export function pipe<T, A, B, C, D, E, F>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>): UnaryFunction<T, F>;
|
||||
export function pipe<T, A, B, C, D, E, F, G>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>): UnaryFunction<T, G>;
|
||||
export function pipe<T, A, B, C, D, E, F, G, H>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>): UnaryFunction<T, H>;
|
||||
export function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>): UnaryFunction<T, I>;
|
||||
export function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>, ...fns: UnaryFunction<any, any>[]): UnaryFunction<T, {}>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
export function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {
|
||||
return pipeFromArray(fns);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {
|
||||
if (fns.length === 0) {
|
||||
return identity as UnaryFunction<any, any>;
|
||||
}
|
||||
|
||||
if (fns.length === 1) {
|
||||
return fns[0];
|
||||
}
|
||||
|
||||
return function piped(input: T): R {
|
||||
return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
//By Stefan Wallin
|
||||
|
||||
//tests for progressbar-support. All browsers that don't support progressbar returns undefined =)
|
||||
Modernizr.addTest("progressbar",function(){
|
||||
return document.createElement('progress').max !== undefined;
|
||||
});
|
||||
|
||||
//tests for meter-support. All browsers that don't support meters returns undefined =)
|
||||
Modernizr.addTest("meter",function(){
|
||||
return document.createElement('meter').max !== undefined;
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","2":"J E F G BC"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"2":"CC tB I u J E F G A B C K L H M N O v w x y z DC EC","66":"0 1 2 3 4 5 6","129":"7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB","257":"VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"I u J E F G A B C K L H M N"},E:{"1":"J E F G A B C K L H IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u GC zB HC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"G B C OC PC QC RC qB 9B SC rB"},G:{"1":"F WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC UC VC"},H:{"2":"nC"},I:{"1":"D sC tC","2":"tB I oC pC qC rC AC"},J:{"1":"A","2":"E"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"B","2":"A"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"129":"9C"}},B:4,C:"WebVTT - Web Video Text Tracks"};
|
||||
@@ -0,0 +1,54 @@
|
||||
let flexSpec = require('./flex-spec')
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class JustifyContent extends Declaration {
|
||||
/**
|
||||
* Change property name for 2009 and 2012 specs
|
||||
*/
|
||||
prefixed (prop, prefix) {
|
||||
let spec
|
||||
;[spec, prefix] = flexSpec(prefix)
|
||||
if (spec === 2009) {
|
||||
return prefix + 'box-pack'
|
||||
}
|
||||
if (spec === 2012) {
|
||||
return prefix + 'flex-pack'
|
||||
}
|
||||
return super.prefixed(prop, prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property name by final spec
|
||||
*/
|
||||
normalize () {
|
||||
return 'justify-content'
|
||||
}
|
||||
|
||||
/**
|
||||
* Change value for 2009 and 2012 specs
|
||||
*/
|
||||
set (decl, prefix) {
|
||||
let spec = flexSpec(prefix)[0]
|
||||
if (spec === 2009 || spec === 2012) {
|
||||
let value = JustifyContent.oldValues[decl.value] || decl.value
|
||||
decl.value = value
|
||||
if (spec !== 2009 || value !== 'distribute') {
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
} else if (spec === 'final') {
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack']
|
||||
|
||||
JustifyContent.oldValues = {
|
||||
'flex-end': 'end',
|
||||
'flex-start': 'start',
|
||||
'space-between': 'justify',
|
||||
'space-around': 'distribute'
|
||||
}
|
||||
|
||||
module.exports = JustifyContent
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A BC","164":"B"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB DC EC"},D:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB","132":"BB CB DB EB FB GB HB"},E:{"1":"C K L H rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J GC zB HC IC","164":"E F G A B JC KC 0B qB"},F:{"1":"5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"G B C H M N O v w x OC PC QC RC qB 9B SC rB","132":"0 1 2 3 4 y z"},G:{"1":"dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC aC bC cC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:2,C:"Encrypted Media Extensions"};
|
||||
Reference in New Issue
Block a user