本文整理汇总了TypeScript中lodash.split函数的典型用法代码示例。如果您正苦于以下问题:TypeScript split函数的具体用法?TypeScript split怎么用?TypeScript split使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了split函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
).then(entries => {
if (this.parent && selectedPath === this.parent.path) {
this.entry = (_.assign(this.ancestors.pop(), {children: this.getChildrenFromEntries(entries)}) as Entry);
} else {
let parent = this.entry,
child = parent && _.find(parent.children, {path: selectedPath}),
type = child ? child.type : 'DIRECTORY';
this.ancestors.push(parent);
this.entry = {
name: _.last(_.split(selectedPath, '/')) + (type === 'DIRECTORY' ? '/' : ''),
path: selectedPath,
children: this.getChildrenFromEntries(entries),
parent: parent,
type: type
};
}
this.parent = _.last(this.ancestors);
});
示例2:
data.rows.map((row, rowIndex) => {
const rowNameList = _.split(row, CHART_STRING_DELIMITER);
if (xAxis == rowNameList[0]) {
// 시리즈
refineColumns.map((column, columnIndex) => {
if( column['name'].indexOf(seriesList[count]) != -1 ) {
// 컬럼에서 Row랑 같은 Index의 Value를 합침
column['value'].map((value, valueIndex) => {
if (rowIndex == valueIndex) {
seriesdata[xAxisIndex] += value;
}
});
}
});
}
});
示例3: loadTopicById
loadTopicById(topicId:number):Topic {
let topic:Topic = new Topic();
topic.id = topicId;
topic.number = 1000060;
topic.typeId = 'single';
topic.type = Type.getTypeById(topic.typeId);
topic.singletonAlbum = true;
topic.posterUrl = 'images/a.jpg';
topic.subject = '《捡个娃娃来爱》第四集 大结局';
topic.label = '耽美/近代/现代/爱情/轻松';
topic.labelItemArray = _.split(topic.label, '/');
topic.message = '';
topic.categoryId = 4;
topic.category = Category.getCategoryById(topic.categoryId);
topic.club = '优声由色';
topic.cast = '东京以东/钻石星尘/包子/小优/yita';
topic.yuanzhu = 'yuanzhu';
topic.director = '龙海包公子';
topic.producer = '';
topic.writer = '龙海包公子';
topic.effector = '抹茶雪糕';
topic.photographer = '祭CC';
topic.produceDate = 1127404800;
topic.viewNum = 101;
topic.downloadNum = 202;
topic.joinNum = 303;
topic.replyNum = 505;
topic.poll_1 = 10;
topic.poll_2 = 10;
topic.poll_3 = 10;
topic.poll_4 = 10;
topic.poll_5 = 10;
topic.dateline = 1276180424;
topic.uId = 6;
topic.userName = '默默';
return topic;
}
示例4: co
return co(function *() {
const addressParts = _.split(address, '*');
if (addressParts.length !== 2) {
throw new Error(`invalid stellar address: ${address}`);
}
const [, homeDomain] = addressParts;
try {
if (homeDomain === this.homeDomain) {
const federationServer = this.getBitGoFederationServer();
return yield federationServer.resolveAddress(address);
} else {
return yield stellar.FederationServer.resolve(address);
}
} catch (e) {
if (e.message === 'Network Error') {
throw e;
} else {
throw new Error('account not found');
}
}
}).call(this);
示例5: generateNewTitle
generateNewTitle(oldTitle, aes, titleName){
let newTitle;
if (_.endsWith(oldTitle, '_CLONE')){
newTitle = oldTitle + '(1)';
}else{
if (_.endsWith(oldTitle, ')')){
let split = _.split(oldTitle, '(');
let index = _.last(split);
split.pop();
index = _.replace(index, ')', '');
let indexInt = _.parseInt(index);
newTitle = split + '(' + _.add(indexInt, 1) + ')';
}else{
newTitle = oldTitle + '_CLONE';
}
}
if(aes && _.findIndex(aes, function(o) { return (_.hasIn(o,titleName) && o[titleName] == newTitle); }) > -1){
return this.generateNewTitle(newTitle, aes, titleName);
}else{
return newTitle;
}
}
示例6:
mkRelativeRoot = (source : string) : string => {
var arr = _.split(source, "/");
arr.pop(); // don't count leading `.`.
arr.pop(); // just count directories, not the file name.
return arr.map(() => "..").join("/") + "/";
};
示例7: if
this.chart.on('click', (params) => {
let selectMode: ChartSelectMode;
let selectedColValues: string[];
// 현재 차트의 시리즈
const series = this.chartOption.series;
// 데이터가 아닌 빈 공백을 클릭했다면
// 모든 데이터 선택효과를 해제하며 필터에서 제거.
if (this.isSelected && _.isNull(params)) {
selectMode = ChartSelectMode.CLEAR;
this.chartOption = this.selectionClear(this.chartOption);
// 차트에서 선택한 데이터가 없음을 설정
this.isSelected = false;
// return;
} else if (params != null) {
// outlier(scatter) 영역은 필터에 해당하지 않으므로 취소
if (_.eq(params.seriesType, SeriesType.SCATTER)) return;
// parameter 정보를 기반으로 시리즈정보 설정
const seriesIndex = params.seriesIndex;
const dataIndex = params.dataIndex;
const seriesValueList = series[seriesIndex].data;
// 이미 선택이 되어있는지 여부
const isSelectMode = _.isUndefined(seriesValueList[dataIndex].itemStyle);
if (_.isUndefined(series[seriesIndex].data[dataIndex].itemStyle)) {
series[seriesIndex].data[dataIndex].itemStyle = optGen.ItemStyle.auto();
}
if (isSelectMode) {
// 선택 처리
selectMode = ChartSelectMode.ADD;
} else {
// 선택 해제
selectMode = ChartSelectMode.SUBTRACT;
}
// 차트에서 선택한 데이터 존재 여부 설정
this.isSelected = isSelectMode;
// UI에 전송할 선택정보 설정
selectedColValues = _.split(params.name, CHART_STRING_DELIMITER);
} else {
return;
}
// 자기자신을 선택시 externalFilters는 false로 설정
if (this.params.externalFilters) this.params.externalFilters = false;
// UI에 전송할 선택정보 설정
const selectData = this.setSelectData(params, selectedColValues, []);
// 차트에 적용
this.apply(false);
this.lastDrawSeries = _.cloneDeep(this.chartOption['series']);
// 이벤트 데이터 전송
this.chartSelectInfo.emit(new ChartSelectInfo(selectMode, selectData, this.params));
});
示例8: removeOptionalRouteTokens
private removeOptionalRouteTokens(populatedUrl: string): string {
return split(populatedUrl, '/{?')[0];
}