code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function nonNegativeOrDefault(value, defaultValue) {
return helpers$1.isFinite(value) && value >= 0 ? value : defaultValue;
} | Generate a set of logarithmic ticks
@param generationOptions the options used to generate the ticks
@param dataRange the range of the data
@returns {number[]} array of tick values | nonNegativeOrDefault | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function IDMatches(meta) {
return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
} | Generate a set of logarithmic ticks
@param generationOptions the options used to generate the ticks
@param dataRange the range of the data
@returns {number[]} array of tick values | IDMatches | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getTickBackdropHeight(opts) {
var tickOpts = opts.ticks;
if (tickOpts.display && opts.display) {
return valueOrDefault$c(tickOpts.fontSize, core_defaults.global.defaultFontSize) + tickOpts.backdropPaddingY * 2;
}
return 0;
} | Returns the value of the first tick.
@param {number} value - The minimum not zero value.
@return {number} The first tick value.
@private | getTickBackdropHeight | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function measureLabelSize(ctx, lineHeight, label) {
if (helpers$1.isArray(label)) {
return {
w: helpers$1.longestText(ctx, ctx.font, label),
h: label.length * lineHeight
};
}
return {
w: ctx.measureText(label).width,
h: lineHeight
};
} | Returns the value of the first tick.
@param {number} value - The minimum not zero value.
@return {number} The first tick value.
@private | measureLabelSize | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function determineLimits(angle, pos, size, min, max) {
if (angle === min || angle === max) {
return {
start: pos - (size / 2),
end: pos + (size / 2)
};
} else if (angle < min || angle > max) {
return {
start: pos - size,
end: pos
};
}
return {
start: pos,
end: pos + size
};
} | Returns the value of the first tick.
@param {number} value - The minimum not zero value.
@return {number} The first tick value.
@private | determineLimits | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function fitWithPointLabels(scale) {
// Right, this is really confusing and there is a lot of maths going on here
// The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
//
// Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
//
// Solution:
//
// We assu... | Helper function to fit a radial linear scale with point labels | fitWithPointLabels | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getTextAlignForAngle(angle) {
if (angle === 0 || angle === 180) {
return 'center';
} else if (angle < 180) {
return 'left';
}
return 'right';
} | Helper function to fit a radial linear scale with point labels | getTextAlignForAngle | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function fillText(ctx, text, position, lineHeight) {
var y = position.y + lineHeight / 2;
var i, ilen;
if (helpers$1.isArray(text)) {
for (i = 0, ilen = text.length; i < ilen; ++i) {
ctx.fillText(text[i], position.x, y);
y += lineHeight;
}
} else {
ctx.fillText(text, position.x, y);
}
} | Helper function to fit a radial linear scale with point labels | fillText | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function adjustPointPositionForLabelHeight(angle, textSize, position) {
if (angle === 90 || angle === 270) {
position.y -= (textSize.h / 2);
} else if (angle > 270 || angle < 90) {
position.y -= textSize.h;
}
} | Helper function to fit a radial linear scale with point labels | adjustPointPositionForLabelHeight | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function drawPointLabels(scale) {
var ctx = scale.ctx;
var opts = scale.options;
var pointLabelOpts = opts.pointLabels;
var tickBackdropHeight = getTickBackdropHeight(opts);
var outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);
var plFont = helpers$1.options._parseFo... | Helper function to fit a radial linear scale with point labels | drawPointLabels | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function drawRadiusLine(scale, gridLineOpts, radius, index) {
var ctx = scale.ctx;
var circular = gridLineOpts.circular;
var valueCount = scale.chart.data.labels.length;
var lineColor = valueAtIndexOrDefault$1(gridLineOpts.color, index - 1);
var lineWidth = valueAtIndexOrDefault$1(gridLineOpts.lineWidth, index - 1... | Helper function to fit a radial linear scale with point labels | drawRadiusLine | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function numberOrZero(param) {
return helpers$1.isNumber(param) ? param : 0;
} | Helper function to fit a radial linear scale with point labels | numberOrZero | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function interpolate$1(table, skey, sval, tkey) {
var range = lookup(table, skey, sval);
// Note: the lookup table ALWAYS contains at least 2 items (min and max)
var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;
var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] :... | Linearly interpolates the given source `value` using the table items `skey` values and
returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')
returns the position for a timestamp equal to 42. If value is out of bounds, values at
index [0, 1] or [n - 1, n] are used for the interpolation. | interpolate$1 | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function toTimestamp(scale, input) {
var adapter = scale._adapter;
var options = scale.options.time;
var parser = options.parser;
var format = parser || options.format;
var value = input;
if (typeof parser === 'function') {
value = parser(value);
}
// Only parse if its not a timestamp already
if (!helpers$... | Linearly interpolates the given source `value` using the table items `skey` values and
returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')
returns the position for a timestamp equal to 42. If value is out of bounds, values at
index [0, 1] or [n - 1, n] are used for the interpolation. | toTimestamp | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function parse(scale, input) {
if (helpers$1.isNullOrUndef(input)) {
return null;
}
var options = scale.options.time;
var value = toTimestamp(scale, scale.getRightValue(input));
if (value === null) {
return value;
}
if (options.round) {
value = +scale._adapter.startOf(value, options.round);
}
return v... | Linearly interpolates the given source `value` using the table items `skey` values and
returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')
returns the position for a timestamp equal to 42. If value is out of bounds, values at
index [0, 1] or [n - 1, n] are used for the interpolation. | parse | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function determineUnitForAutoTicks(minUnit, min, max, capacity) {
var ilen = UNITS.length;
var i, interval, factor;
for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {
interval = INTERVALS[UNITS[i]];
factor = interval.steps ? interval.steps : MAX_INTEGER;
if (interval.common && Math.ceil((max - min) / (fac... | Figures out what unit results in an appropriate number of auto-generated ticks | determineUnitForAutoTicks | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
var i, unit;
for (i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {
unit = UNITS[i];
if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {
return unit;
}
}
return UNITS[minUnit ? UNITS.indexOf... | Figures out what unit to format a set of ticks with | determineUnitForFormatting | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function determineMajorUnit(unit) {
for (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {
if (INTERVALS[UNITS[i]].common) {
return UNITS[i];
}
}
} | Figures out what unit to format a set of ticks with | determineMajorUnit | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function generate(scale, min, max, capacity) {
var adapter = scale._adapter;
var options = scale.options;
var timeOpts = options.time;
var minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);
var stepSize = resolve$5([timeOpts.stepSize, timeOpts.unitStepSize, 1]);
var weekday ... | Generates a maximum of `capacity` timestamps between min and max, rounded to the
`minor` unit using the given scale time `options`.
Important: this method can return ticks outside the min and max range, it's the
responsibility of the calling code to clamp values if needed. | generate | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function computeOffsets(table, ticks, min, max, options) {
var start = 0;
var end = 0;
var first, last;
if (options.offset && ticks.length) {
first = interpolate$1(table, 'time', ticks[0], 'pos');
if (ticks.length === 1) {
start = 1 - first;
} else {
start = (interpolate$1(table, 'time', ticks[1], 'pos... | Returns the start and end offsets from edges in the form of {start, end}
where each value is a relative width to the scale and ranges between 0 and 1.
They add extra margins on the both sides by scaling down the original scale.
Offsets are added when the `offset` option is true. | computeOffsets | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function setMajorTicks(scale, ticks, map, majorUnit) {
var adapter = scale._adapter;
var first = +adapter.startOf(ticks[0].value, majorUnit);
var last = ticks[ticks.length - 1].value;
var major, index;
for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {
index = map[major];
if (inde... | Returns the start and end offsets from edges in the form of {start, end}
where each value is a relative width to the scale and ranges between 0 and 1.
They add extra margins on the both sides by scaling down the original scale.
Offsets are added when the `offset` option is true. | setMajorTicks | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function ticksFromTimestamps(scale, values, majorUnit) {
var ticks = [];
var map = {};
var ilen = values.length;
var i, value;
for (i = 0; i < ilen; ++i) {
value = values[i];
map[value] = i;
ticks.push({
value: value,
major: false
});
}
// We set the major ticks separately from the above loop be... | Returns the start and end offsets from edges in the form of {start, end}
where each value is a relative width to the scale and ranges between 0 and 1.
They add extra margins on the both sides by scaling down the original scale.
Offsets are added when the `offset` option is true. | ticksFromTimestamps | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function decodeFill(el, index, count) {
var model = el._model || {};
var fill = model.fill;
var target;
if (fill === undefined) {
fill = !!model.backgroundColor;
}
if (fill === false || fill === null) {
return false;
}
if (fill === true) {
return 'origin';
}
target = parseFloat(fill, 10);
if (isFin... | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | decodeFill | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function computeLinearBoundary(source) {
var model = source.el._model || {};
var scale = source.el._scale || {};
var fill = source.fill;
var target = null;
var horizontal;
if (isFinite(fill)) {
return null;
}
// Backward compatibility: until v3, we still need to support boundary values set on
// the model ... | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | computeLinearBoundary | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function computeCircularBoundary(source) {
var scale = source.el._scale;
var options = scale.options;
var length = scale.chart.data.labels.length;
var fill = source.fill;
var target = [];
var start, end, center, i, point;
if (!length) {
return null;
}
start = options.ticks.reverse ? scale.max : scale.min;
... | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | computeCircularBoundary | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function computeBoundary(source) {
var scale = source.el._scale || {};
if (scale.getPointPositionForValue) {
return computeCircularBoundary(source);
}
return computeLinearBoundary(source);
} | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | computeBoundary | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function resolveTarget(sources, index, propagate) {
var source = sources[index];
var fill = source.fill;
var visited = [index];
var target;
if (!propagate) {
return fill;
}
while (fill !== false && visited.indexOf(fill) === -1) {
if (!isFinite(fill)) {
return fill;
}
target = sources[fill];
if (!... | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | resolveTarget | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createMapper(source) {
var fill = source.fill;
var type = 'dataset';
if (fill === false) {
return null;
}
if (!isFinite(fill)) {
type = 'boundary';
}
return mappers[type](source);
} | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | createMapper | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isDrawable(point) {
return point && !point.skip;
} | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | isDrawable | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function drawArea(ctx, curve0, curve1, len0, len1) {
var i, cx, cy, r;
if (!len0 || !len1) {
return;
}
// building first area curve (normal)
ctx.moveTo(curve0[0].x, curve0[0].y);
for (i = 1; i < len0; ++i) {
helpers$1.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);
}
if (curve1[0].angle !== undefined) {
... | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | drawArea | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function doFill(ctx, points, mapper, view, color, loop) {
var count = points.length;
var span = view.spanGaps;
var curve0 = [];
var curve1 = [];
var len0 = 0;
var len1 = 0;
var i, ilen, index, p0, p1, d0, d1, loopOffset;
ctx.beginPath();
for (i = 0, ilen = count; i < ilen; ++i) {
index = i % count;
p0 = ... | Provided for backward compatibility with scale.getValueForPixel().
@deprecated since version 2.8.0
@todo remove at version 3
@private | doFill | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getBoxWidth(labelOpts, fontSize) {
return labelOpts.usePointStyle && labelOpts.boxWidth > fontSize ?
fontSize :
labelOpts.boxWidth;
} | Helper function to get the box width based on the usePointStyle option
@param {object} labelopts - the label options on the legend
@param {number} fontSize - the label font size
@return {number} width of the color box area | getBoxWidth | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createNewLegendAndAttach(chart, legendOpts) {
var legend = new Legend({
ctx: chart.ctx,
options: legendOpts,
chart: chart
});
core_layouts.configure(chart, legend, legendOpts);
core_layouts.addBox(chart, legend);
chart.legend = legend;
} | Handle an event
@private
@param {IEvent} event - The event to handle | createNewLegendAndAttach | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createNewTitleBlockAndAttach(chart, titleOpts) {
var title = new Title({
ctx: chart.ctx,
options: titleOpts,
chart: chart
});
core_layouts.configure(chart, title, titleOpts);
core_layouts.addBox(chart, title);
chart.titleBlock = title;
} | IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required! | createNewTitleBlockAndAttach | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
_indexOfDictionary = function(dictionary, value) {
// The type of the value
var type = typeof value;
// If is boolean, return a boolean token
if (type === 'boolean')
return value ? TOKEN_TRUE : TOKEN_FALSE;
// If is null, return a... yes! the null token
if (value === null)
return TOKEN_NULL... | Get the index value of the dictionary
@param {Object} dictionary a object that have two array attributes: 'string' and 'number'
@param {Object} data | _indexOfDictionary | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
_encode = function(str) {
if ( typeof str !== 'string')
return str;
return str.replace(/[\+ \|\^\%]/g, function(a) {
return ({
' ' : '+',
'+' : '%2B',
'|' : '%7C',
'^' : '%5E',
'%' : '%25'
})[a]
});
} | Get the index value of the dictionary
@param {Object} dictionary a object that have two array attributes: 'string' and 'number'
@param {Object} data | _encode | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
_decode = function(str) {
if ( typeof str !== 'string')
return str;
return str.replace(/\+|%2B|%7C|%5E|%25/g, function(a) {
return ({
'+' : ' ',
'%2B' : '+',
'%7C' : '|',
'%5E' : '^',
'%25' : '%'
})[a]
})
} | Get the index value of the dictionary
@param {Object} dictionary a object that have two array attributes: 'string' and 'number'
@param {Object} data | _decode | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
_base10To36 = function(number) {
return Number.prototype.toString.call(number, 36).toUpperCase();
} | Get the index value of the dictionary
@param {Object} dictionary a object that have two array attributes: 'string' and 'number'
@param {Object} data | _base10To36 | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
_base36To10 = function(number) {
return parseInt(number, 36);
} | Get the index value of the dictionary
@param {Object} dictionary a object that have two array attributes: 'string' and 'number'
@param {Object} data | _base36To10 | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function configFromStringAndArray(config) {
var tempConfig,
bestMoment,
scoreToBeat,
i,
currentScore,
validFormatFound,
bestFormatIsValid = false;
if (config._f.length === 0) {
getParsingFlags(config).invalidFormat = tr... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | configFromStringAndArray | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function configFromObject(config) {
if (config._d) {
return;
}
var i = normalizeObjectUnits(config._i),
dayOrDate = i.day === undefined ? i.date : i.day;
config._a = map(
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | configFromObject | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createFromConfig(config) {
var res = new Moment(checkOverflow(prepareConfig(config)));
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | createFromConfig | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function prepareConfig(config) {
var input = config._i,
format = config._f;
config._locale = config._locale || getLocale(config._l);
if (input === null || (format === undefined && input === '')) {
return createInvalid({ nullInput: true });
}
if (typeof ... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | prepareConfig | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function configFromInput(config) {
var input = config._i;
if (isUndefined(input)) {
config._d = new Date(hooks.now());
} else if (isDate(input)) {
config._d = new Date(input.valueOf());
} else if (typeof input === 'string') {
configFromString(config);
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | configFromInput | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createLocalOrUTC(input, format, locale, strict, isUTC) {
var c = {};
if (format === true || format === false) {
strict = format;
format = undefined;
}
if (locale === true || locale === false) {
strict = locale;
locale = undefined... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | createLocalOrUTC | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createLocal(input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, false);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | createLocal | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return createLocal();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (!m... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | pickBy | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function min() {
var args = [].slice.call(arguments, 0);
return pickBy('isBefore', args);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | min | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function max() {
var args = [].slice.call(arguments, 0);
return pickBy('isAfter', args);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | max | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
now = function () {
return Date.now ? Date.now() : +new Date();
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | now | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isDurationValid(m) {
var key,
unitHasDecimal = false,
i;
for (key in m) {
if (
hasOwnProp(m, key) &&
!(
indexOf.call(ordering, key) !== -1 &&
(m[key] == null || !isNaN(m[key]))
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isDurationValid | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isValid$1() {
return this._isValid;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isValid$1 | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createInvalid$1() {
return createDuration(NaN);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | createInvalid$1 | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function Duration(duration) {
var normalizedInput = normalizeObjectUnits(duration),
years = normalizedInput.year || 0,
quarters = normalizedInput.quarter || 0,
months = normalizedInput.month || 0,
weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | Duration | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isDuration(obj) {
return obj instanceof Duration;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isDuration | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function absRound(number) {
if (number < 0) {
return Math.round(-1 * number) * -1;
} else {
return Math.round(number);
}
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | absRound | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function compareArrays(array1, array2, dontConvert) {
var len = Math.min(array1.length, array2.length),
lengthDiff = Math.abs(array1.length - array2.length),
diffs = 0,
i;
for (i = 0; i < len; i++) {
if (
(dontConvert && array1[i] !== array... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | compareArrays | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function offset(token, separator) {
addFormatToken(token, 0, 0, function () {
var offset = this.utcOffset(),
sign = '+';
if (offset < 0) {
offset = -offset;
sign = '-';
}
return (
sign +
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | offset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function offsetFromString(matcher, string) {
var matches = (string || '').match(matcher),
chunk,
parts,
minutes;
if (matches === null) {
return null;
}
chunk = matches[matches.length - 1] || [];
parts = (chunk + '').match(chunkOff... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | offsetFromString | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function cloneWithOffset(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff =
(isMoment(input) || isDate(input)
? input.valueOf()
: createLocal(input).valueOf()) - res.valueOf();
// Use ... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | cloneWithOffset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getDateOffset(m) {
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871
return -Math.round(m._d.getTimezoneOffset());
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | getDateOffset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getSetOffset(input, keepLocalTime, keepMinutes) {
var offset = this._offset || 0,
localAdjust;
if (!this.isValid()) {
return input != null ? this : NaN;
}
if (input != null) {
if (typeof input === 'string') {
input = offsetFrom... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | getSetOffset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getSetZone(input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | getSetZone | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function setOffsetToUTC(keepLocalTime) {
return this.utcOffset(0, keepLocalTime);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | setOffsetToUTC | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function setOffsetToLocal(keepLocalTime) {
if (this._isUTC) {
this.utcOffset(0, keepLocalTime);
this._isUTC = false;
if (keepLocalTime) {
this.subtract(getDateOffset(this), 'm');
}
}
return this;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | setOffsetToLocal | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function setOffsetToParsedOffset() {
if (this._tzm != null) {
this.utcOffset(this._tzm, false, true);
} else if (typeof this._i === 'string') {
var tZone = offsetFromString(matchOffset, this._i);
if (tZone != null) {
this.utcOffset(tZone);
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | setOffsetToParsedOffset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function hasAlignedHourOffset(input) {
if (!this.isValid()) {
return false;
}
input = input ? createLocal(input).utcOffset() : 0;
return (this.utcOffset() - input) % 60 === 0;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | hasAlignedHourOffset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isDaylightSavingTime() {
return (
this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset()
);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isDaylightSavingTime | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isDaylightSavingTimeShifted() {
if (!isUndefined(this._isDSTShifted)) {
return this._isDSTShifted;
}
var c = {},
other;
copyConfig(c, this);
c = prepareConfig(c);
if (c._a) {
other = c._isUTC ? createUTC(c._a) : createLocal(... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isDaylightSavingTimeShifted | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isLocal() {
return this.isValid() ? !this._isUTC : false;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isLocal | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isUtcOffset() {
return this.isValid() ? this._isUTC : false;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isUtcOffset | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isUtc() {
return this.isValid() ? this._isUTC && this._offset === 0 : false;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isUtc | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createDuration(input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
ret,
diffRes;
if (isDuration(input)) {
duration = {
ms: input._milliseconds,
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | createDuration | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function parseIso(inp, sign) {
// We'd normally use ~~inp for this, but unfortunately it also
// converts floats to ints.
// inp may be undefined, so careful calling replace on it.
var res = inp && parseFloat(inp.replace(',', '.'));
// apply sign while we're at it
return ... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | parseIso | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function positiveMomentsDifference(base, other) {
var res = {};
res.months =
other.month() - base.month() + (other.year() - base.year()) * 12;
if (base.clone().add(res.months, 'M').isAfter(other)) {
--res.months;
}
res.milliseconds = +other - +base.clone... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | positiveMomentsDifference | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function momentsDifference(base, other) {
var res;
if (!(base.isValid() && other.isValid())) {
return { milliseconds: 0, months: 0 };
}
other = cloneWithOffset(other, base);
if (base.isBefore(other)) {
res = positiveMomentsDifference(base, other);
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | momentsDifference | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function createAdder(direction, name) {
return function (val, period) {
var dur, tmp;
//invert the arguments, but complain about it
if (period !== null && !isNaN(+period)) {
deprecateSimple(
name,
'moment().' +
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | createAdder | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function addSubtract(mom, duration, isAdding, updateOffset) {
var milliseconds = duration._milliseconds,
days = absRound(duration._days),
months = absRound(duration._months);
if (!mom.isValid()) {
// No op
return;
}
updateOffset = updateO... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | addSubtract | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isString(input) {
return typeof input === 'string' || input instanceof String;
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isString | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isMomentInput(input) {
return (
isMoment(input) ||
isDate(input) ||
isString(input) ||
isNumber(input) ||
isNumberOrStringArray(input) ||
isMomentInputObject(input) ||
input === null ||
input === undefined
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isMomentInput | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isMomentInputObject(input) {
var objectTest = isObject(input) && !isObjectEmpty(input),
propertyTest = false,
properties = [
'years',
'year',
'y',
'months',
'month',
'M',
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isMomentInputObject | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isNumberOrStringArray(input) {
var arrayTest = isArray(input),
dataTypeTest = false;
if (arrayTest) {
dataTypeTest =
input.filter(function (item) {
return !isNumber(item) && isString(input);
}).length === 0;
}
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isNumberOrStringArray | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isCalendarSpec(input) {
var objectTest = isObject(input) && !isObjectEmpty(input),
propertyTest = false,
properties = [
'sameDay',
'nextDay',
'lastDay',
'nextWeek',
'lastWeek',
'sameE... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isCalendarSpec | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function getCalendarFormat(myMoment, now) {
var diff = myMoment.diff(now, 'days', true);
return diff < -6
? 'sameElse'
: diff < -1
? 'lastWeek'
: diff < 0
? 'lastDay'
: diff < 1
? 'sameDay'
: diff < 2
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | getCalendarFormat | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function calendar$1(time, formats) {
// Support for single parameter, formats only overload to the calendar function
if (arguments.length === 1) {
if (!arguments[0]) {
time = undefined;
formats = undefined;
} else if (isMomentInput(arguments[0])) {... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | calendar$1 | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function clone() {
return new Moment(this);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | clone | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isAfter(input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valu... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isAfter | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isBefore(input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.val... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isBefore | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isBetween(from, to, units, inclusivity) {
var localFrom = isMoment(from) ? from : createLocal(from),
localTo = isMoment(to) ? to : createLocal(to);
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
return false;
}
inclusivity = inclusiv... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isBetween | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isSame(input, units) {
var localInput = isMoment(input) ? input : createLocal(input),
inputMs;
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isSame | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isSameOrAfter(input, units) {
return this.isSame(input, units) || this.isAfter(input, units);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isSameOrAfter | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function isSameOrBefore(input, units) {
return this.isSame(input, units) || this.isBefore(input, units);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | isSameOrBefore | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function diff(input, units, asFloat) {
var that, zoneDelta, output;
if (!this.isValid()) {
return NaN;
}
that = cloneWithOffset(input, this);
if (!that.isValid()) {
return NaN;
}
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | diff | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function monthDiff(a, b) {
if (a.date() < b.date()) {
// end-of-month calculations work correct when the start month has more
// days than the end month.
return -monthDiff(b, a);
}
// difference in months
var wholeMonthDiff = (b.year() - a.year()) * 12... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | monthDiff | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function toString() {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | toString | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function toISOString(keepOffset) {
if (!this.isValid()) {
return null;
}
var utc = keepOffset !== true,
m = utc ? this.clone().utc() : this;
if (m.year() < 0 || m.year() > 9999) {
return formatMoment(
m,
utc
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | toISOString | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function inspect() {
if (!this.isValid()) {
return 'moment.invalid(/* ' + this._i + ' */)';
}
var func = 'moment',
zone = '',
prefix,
year,
datetime,
suffix;
if (!this.isLocal()) {
func = this.utcOffset()... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | inspect | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function format(inputString) {
if (!inputString) {
inputString = this.isUtc()
? hooks.defaultFormatUtc
: hooks.defaultFormat;
}
var output = formatMoment(this, inputString);
return this.localeData().postformat(output);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | format | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function from(time, withoutSuffix) {
if (
this.isValid() &&
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
) {
return createDuration({ to: this, from: time })
.locale(this.locale())
.humanize(!withoutSuffix);
... | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | from | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
function fromNow(withoutSuffix) {
return this.from(createLocal(), withoutSuffix);
} | Return a human readable representation of a moment that can
also be evaluated to get a new moment which is the same
@link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | fromNow | javascript | gongfuxiang/shopxo | public/static/common/lib/ckplayer/hls.js/hls-demo.js | https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.