dropkiq
Version:
Liquid Expressions Simplified
1 lines • 9.64 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var DEFAULT_FILTERS={abs:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"abs",selectRange:[3,3],hint:"Returns the absolute value of a number."},append:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'append: "example"',selectRange:[9,16],hint:"Concatenates two strings and returns the concatenated value."},at_least:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"at_least: 0",selectRange:[10,11],hint:"Limits a number to a minimum value."},at_most:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"at_most: 0",selectRange:[9,10],hint:"Limits a number to a maximum value."},capitalize:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"capitalize",selectRange:[10,10],hint:"Makes the first character of a string capitalized."},ceil:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"ceil",selectRange:[4,4],hint:"Rounds the input up to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied."},date:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'date: "year: %y, month: %m, day: %d"',selectRange:[7,35],hint:"Converts a timestamp into another date format. The format for this syntax is the same as strftime. The input uses the same format as Ruby’s Time.parse."},default:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'default: "example"',selectRange:[10,17],hint:"Allows you to specify a fallback in case a value doesn’t exist. default will show its value if the left side is nil, false, or empty."},divided_by:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"divided_by: 4",selectRange:[12,13],hint:"Divides a number by another number."},downcase:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"downcase",selectRange:[8,8],hint:"Makes each character in a string lowercase. It has no effect on strings which are already all lowercase."},escape:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"escape",selectRange:[6,6],hint:"Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn’t change strings that don’t have anything to escape."},escape_once:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"escape_once",selectRange:[11,11],hint:"Escapes a string without changing existing escaped entities. It doesn’t change strings that don’t have anything to escape."},first:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"first",selectRange:[5,5],hint:"Returns the first item of an array."},floor:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"floor",selectRange:[5,5],hint:"Rounds the input down to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied."},join:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'join: ","',selectRange:[7,8],hint:"Combines the items in an array into a single string using the argument as a separator."},last:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"last",selectRange:[4,4],hint:"Returns the last item of an array."},lstrip:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"lstrip",selectRange:[6,6],hint:"Removes all whitespace (tabs, spaces, and newlines) from the left side of a string. It does not affect spaces between words."},map:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'map: "length"',selectRange:[6,12],hint:"Creates an array of values by extracting the values of a named property from another object."},minus:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"minus: 2",selectRange:[7,8],hint:"Subtracts a number from another number."},modulo:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"modulo: 2",selectRange:[8,9],hint:"Returns the remainder of a division operation."},newline_to_br:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"newline_to_br",selectRange:[13,13],hint:"Replaces every newline (\n) in a string with an HTML line break (<br />)."},plus:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"plus: 3",selectRange:[6,7],hint:"Adds a number to another number."},prepend:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'prepend: "example"',selectRange:[10,17],hint:"Adds the specified string to the beginning of another string."},remove:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'remove: "example"',selectRange:[9,16],hint:"Removes every occurrence of the specified substring from a string."},remove_first:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'remove_first: "example"',selectRange:[15,22],hint:"Removes only the first occurrence of the specified substring from a string."},replace:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'replace: "this", "that"',selectRange:[10,14],hint:"Replaces every occurrence of the first argument in a string with the second argument."},replace_first:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'replace_first: "this", "that"',selectRange:[16,20],hint:"Replaces only the first occurrence of the first argument in a string with the second argument."},reverse:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"reverse",selectRange:[7,7],hint:"Reverses the order of the items in an array. reverse cannot reverse a string."},round:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"round",selectRange:[5,5],hint:"Rounds a number to the nearest integer or, if a number is passed as an argument, to that number of decimal places."},rstrip:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"rstrip",selectRange:[6,6],hint:"Removes all whitespace (tabs, spaces, and newlines) from the right side of a string. It does not affect spaces between words."},size:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"size",selectRange:[4,4],hint:"Returns the number of characters in a string or the number of items in an array."},slice:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"slice: 0",selectRange:[7,8],hint:"Returns a substring of 1 character beginning at the index specified by the first argument. An optional second argument specifies the length of the substring to be returned."},sort:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"sort",selectRange:[4,4],hint:"Sorts items in an array in case-sensitive order."},sort_natural:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"sort_natural",selectRange:[12,12],hint:"Sorts items in an array in case-insensitive order."},split:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:'split: ", "',selectRange:[8,10],hint:"Divides a string into an array using the argument as a separator. split is commonly used to convert comma-separated items from a string to an array."},strip:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"strip",selectRange:[5,5],hint:"Removes all whitespace (tabs, spaces, and newlines) from both the left and right sides of a string. It does not affect spaces between words."},strip_html:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"strip_html",selectRange:[10,10],hint:"Removes any HTML tags from a string."},strip_newlines:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"strip_newlines",selectRange:[14,14],hint:"Removes any newline characters (line breaks) from a string."},times:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"times: 2",selectRange:[7,8],hint:"Multiplies a number by another number."},truncate:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"truncate: 20",selectRange:[10,12],hint:"Shortens a string down to the number of characters passed as an argument. If the specified number of characters is less than the length of the string, an ellipsis (…) is appended to the string and is included in the character count."},truncatewords:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"truncatewords: 3",selectRange:[15,16],hint:"Shortens a string down to the number of words passed as an argument. If the specified number of words is less than the number of words in the string, an ellipsis (…) is appended to the string."},uniq:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"uniq",selectRange:[4,4],hint:"Removes any duplicate elements in an array."},upcase:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"upcase",selectRange:[6,6],hint:"Makes each character in a string uppercase. It has no effect on strings which are already all uppercase."},url_decode:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"url_decode",selectRange:[10,10],hint:"Decodes a string that has been encoded as a URL or by url_encode."},url_encode:{type:"ColumnTypes::Filter",foreign_table_name:null,insertionTemplate:"url_encode",selectRange:[10,10],hint:"Converts any URL-unsafe characters in a string into percent-encoded characters."}},FilterRegistry=function(){function e(){this.registry=DEFAULT_FILTERS}return e.prototype.registerFilter=function(e){this.registry=Object.assign(this.registry,e)},e}();exports.FilterRegistry=FilterRegistry;