Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
schemaHelper.parseOptionPath = function (optionPath, options) {
options = options || {};
var errorInfo = 'Path is illegal: \'' + optionPath + '\'';
dtLib.assert(
optionPath && (optionPath = $.trim(optionPath)), errorInfo
);
// 因为mark down的url中不支持小括号(marked实现太简单了),所以小括号改用减号,数组不再用减号。
// URL中的数组,不写[i]。
// optionPath = optionPath.replace(/\-i/g, '-i]'); // 兼容 series-i表示数组的情况。
var pathArr = optionPath.split(/\.|\[/);
var retArr = [];
for (var i = 0, len = pathArr.length; i < len; i++) {
var itemStr = $.trim(pathArr[i]);
if (options.ignoreEmptyItem && itemStr === '') {
continue;
}
// 因为mark down的url中不支持小括号(marked实现太简单了),所以不用小括号,改用减号表示type。
// match: 'asdf-bb' 'asdf-' 'i]-bb' 'i]-' 'asdf' 'i]'
var regResult = itemStr.match(PATH_ITEM_REG) || [];
if (rc) {
isRc = true
pathStr += `Q${x} ${y} `;
} else {
if (j == 0) {
pathStr += `M${x} ${y} `;
} else {
pathStr += `L${x} ${y} `;
}
}
}
}
// 绘制线路path
let path = createSvg('path').appendTo(g);
path.attr({
d: $.trim(pathStr),
stroke: `#${color}`
});
}
}
it('button과 anchor가 둘다 포함된 경우 button은 태그 사이 내용 모두 제거하고 anchor는 태그만 제거한다', function() {
var htmlStr = $.trim($('#button').html()) + $.trim($('#anchor').html()),
expectStr = 'ButtonEnd of ExampleAnchor LinkEnd of Example';
expect(util.stripTags(htmlStr)).toBe(expectStr);
});
});
self.each(function(i, it) {
var cn = ' ' + it.className + ' ';
while (classPattern.test(cn)) {
cn = cn.replace(classPattern, ' ');
}
it.className = $.trim(cn);
});
beats.scrape = function () {
var player = $("#app__transport");
var durationElapsed = $.trim($(".horizontal_bar__handle").text()).split(" | ");
var info = {};
if (!player.length) {
return false;
}
if (durationElapsed.length === 2) {
info.duration = Utils.calculateDuration(durationElapsed[1]);
info.elapsed = Utils.calculateDuration(durationElapsed[0]);
}
info.artist = $(".artist-track-target .artist", player).text();
info.stopped = $("#play_pause_icon").hasClass("icon-bicons_play");
info.title = $(".artist-track-target .track", player).text();
return info;
onNext: function () {
this.props.onNext({
name: $.trim(this.state.name),
description: $.trim(this.state.description),
imageTags: this.state.imageTags,
newImage: this.state.newImage
});
},
setNameError: function (newName) {
typingTimer = setTimeout(function() {
if(updateContent(inputElement)) {
var rawInput = $.trim(inputElement.text());
eventObj.trigger('input-changed', rawInput);
};
}, doneTypingInterval);
}).on('keydown', function() {
onNext: function() {
this.props.onNext({
name: $.trim(this.state.name),
description: $.trim(this.state.description),
imageTags: this.state.imageTags,
newImage: this.state.newImage
});
},
setNameError: function(newName) {
function countWords(str){
var trimmedStr = $.trim(str);
if (trimmedStr){
return trimmedStr.match(/\S+/gi).length;
}
return 0;
}
function class2Selector(classStr) {
return ('.' + $.trim(classStr)).replace(/\s+/g, '.');
}