{"size": 853, "ext": "js", "max_stars_repo_path": "node_modules/@angular/common/esm/src/pipes/slice_pipe.js", "max_stars_repo_name": "ShaofeiZi/angularDemo", "max_stars_repo_stars_event_min_datetime": "2019-02-14T02:27:10.000Z", "max_stars_repo_stars_event_max_datetime": "2019-02-14T02:27:10.000Z", "max_issues_repo_path": "node_modules/@angular/common/esm/src/pipes/slice_pipe.js", "max_issues_repo_name": "ShaofeiZi/angularDemo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/@angular/common/esm/src/pipes/slice_pipe.js", "max_forks_repo_name": "ShaofeiZi/angularDemo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 37.0869565217, "max_line_length": 81, "alphanum_fraction": 0.6342321219}
import { Pipe } from '@angular/core';
import { ListWrapper } from '../facade/collection';
import { StringWrapper, isArray, isBlank, isString } from '../facade/lang';
import { InvalidPipeArgumentException } from './invalid_pipe_argument_exception';
export class SlicePipe {
    transform(value, start, end = null) {
        if (isBlank(value))
            return value;
        if (!this.supports(value)) {
            throw new InvalidPipeArgumentException(SlicePipe, value);
        }
        if (isString(value)) {
            return StringWrapper.slice(value, start, end);
        }
        return ListWrapper.slice(value, start, end);
    }
    supports(obj) { return isString(obj) || isArray(obj); }
}
/** @nocollapse */
SlicePipe.decorators = [
    { type: Pipe, args: [{ name: 'slice', pure: false },] },
];
//# sourceMappingURL=slice_pipe.js.map