lodash APIs
- cloneDeep
- get
- isEqual
- isEmpty
- debounce
- merge
- uniq
- omit
- isString
- isArray
- pick
- sortBy
- groupBy
- flatten
- set
- find
- orderBy
- mapValues
- isObject
- last
- isNil
- isNumber
- range
- chunk
- throttle
- filter
- uniqBy
- difference
- pickBy
- noop
- capitalize
- uniqueId
- has
- isUndefined
- map
- camelCase
- isFunction
- kebabCase
- intersection
- random
- includes
- isPlainObject
- compact
- Dictionary
- findIndex
- keyBy
- forEach
- trim
- clamp
- identity
- remove
- keys
- isNull
- times
- startCase
- first
- values
- mapKeys
- sumBy
- max
- reduce
- some
- zip
- every
- memoize
- clone
- countBy
- concat
- snakeCase
- assign
- isBoolean
- uniqWith
- omitBy
- without
- minBy
- head
- maxBy
- min
- upperFirst
- escapeRegExp
- reverse
- sample
- shuffle
- defaults
- inRange
- flattenDeep
- take
- union
- sum
- mergeWith
- castArray
- replace
- flatMap
- reject
- zipObject
- template
- isNaN
- mean
- size
- findLast
- unset
- partition
- round
- fromPairs
- floor
- toPairs
- indexOf
- toString
- sampleSize
- differenceBy
- update
- chain
- startsWith
- xor
- pull
- DebouncedFunc
- defaultsDeep
- split
- findKey
- unescape
- partial
- toNumber
- invert
- each
- differenceWith
- endsWith
- slice
- isDate
- unionBy
- findLastIndex
- join
- isInteger
- delay
- isObjectLike
- padStart
- result
- isError
- extend
- cloneDeepWith
- upperCase
- trimStart
- constant
- matches
- lowerCase
- forIn
- lowerFirst
- once
- transform
- isMatch
- escape
- isEqualWith
- zipWith
- isRegExp
- entries
- sortedIndexBy
- dropWhile
- takeWhile
- isElement
- forEachRight
- ReplaceFunction
- TemplateExecutor
- keysIn
- IsEqualCustomizer
- isTypedArray
- cond
- stubTrue
- toUpper
- isMap
- isSet
- meanBy
- rangeRight
- repeat
- trimEnd
- now
- nth
- pullAt
- toPath
- eq
- lt
- lte
- gt
- gte
- pullAllBy
- pullAll
- toLower
- fill
- ceil
- flatMapDeep
- CloneDeepWithCustomizer
- negate
- takeRightWhile
- invoke
- tap
- intersectionWith
- truncate
- Collection
- bind
- curry
- partialRight
- sortedUniq
- sortedIndexOf
- Object
- drop
- _
Other Related APIs
lodash#invert TypeScript Examples
The following examples show how to use
lodash#invert.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: analysis-utils.ts From prism-frontend with MIT License | 7 votes |
export function getAnalysisTableColumns(
analysisResult?: AnalysisResult,
withLocalName = false,
): Column[] {
if (!analysisResult || analysisResult instanceof ExposedPopulationResult) {
return [];
}
if ('tableColumns' in analysisResult) {
return (analysisResult as PolygonAnalysisResult).tableColumns;
}
const { statistic } = analysisResult;
const baselineLayerTitle = analysisResult.getBaselineLayer().title;
return [
{
id: withLocalName ? 'localName' : 'name',
label: 'Name',
},
{
id: statistic,
label: invert(AggregationOperations)[statistic], // invert maps from computer name to display name.
format: value => getRoundedData(value as number),
},
{
id: 'baselineValue',
label: baselineLayerTitle,
format: (value: number | string) => value.toLocaleString('en-US'),
},
];
}
Example #2
Source File: sql-formatter.ts From querybook with Apache License 2.0 | 6 votes |
function tokensToText(tokens: IToken[]) {
let statementText = '';
const templateTagToId = {};
let lastToken: IToken = null;
for (const token of tokens) {
if (lastToken) {
if (token.line !== lastToken.line) {
statementText += '\n';
} else if (token.start > lastToken.end) {
statementText += ' ';
}
}
if (skipTokenType.has(token.type)) {
if (!(token.text in templateTagToId)) {
templateTagToId[token.text] = uniqueId('__TEMPLATED_TAG_');
}
statementText += templateTagToId[token.text];
} else {
statementText += token.text;
}
lastToken = token;
}
return {
statementText,
idToTemplateTag: invert(templateTagToId),
};
}
Example #3
Source File: keycodes.ts From roam-toolkit with MIT License | 5 votes |
CODE_TO_KEY: {[key: string]: string} = invert(KEY_TO_CODE)