This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function ArraySortBy <T> (array: T[], getProperty: (value: T) => any): T[] { | |
| return array.sort((a, b) => { | |
| let aValue: any = getProperty(a), | |
| bValue: any = getProperty(b); | |
| if (aValue === undefined || bValue === undefined) { | |
| return 0; | |
| } | |
| return (aValue > bValue ) ? 1 : ((bValue > aValue) ? -1 : 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as _ from "underscore"; | |
| /** | |
| * @param destination | |
| * @param sources | |
| * @returns {any} | |
| * @constructor | |
| */ | |
| export function DeepExtend (destination: any, ...sources: any[]): any { | |
| var parentRE: RegExp = new RegExp('#{\s*?_\s*?}'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://maxfarseer.gitbooks.io/redux-course-ru/content/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Находит на странице слова из словаря, если кол-во слов больше лимита - сайт порнографической/эротической тематики. | |
| * | |
| * @param dictionary | |
| * @param debug | |
| * @constructor | |
| */ | |
| function PornoDetector (dictionary, debug) { | |
| this.dictionary = dictionary; | |
| this.filteredDictionary = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var StringExpressionParser = function () { | |
| this.operators = [ | |
| '+', '-', '*', '/', '^' | |
| ]; | |
| this.priorities = [ | |
| ['*', '/'], | |
| ['+', '-'] | |
| ]; | |
| }; |
NewerOlder