This file contains 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
type Obj = Record<any, any> | |
const isGetter = (x: Obj, name: string) => Boolean((Object.getOwnPropertyDescriptor(x, name) ?? {})?.get) | |
const isFunction = (x: Obj, name: string) => typeof x[name] === 'function' | |
const deepFunctions = (x: Obj): string[] => | |
(x && x !== Object.prototype && | |
Object.getOwnPropertyNames(x) | |
.filter(name => isGetter(x, name) || isFunction(x, name)) | |
.concat(deepFunctions(Object.getPrototypeOf(x)) || [])) || [] |
This file contains 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
/** | |
* This Less.js plugin allows you to create value "maps" with custom at-rules. | |
* Unlike variables, the maps are global. | |
* | |
* This library allows for more dynamic data assignment/retrieval than variables. | |
* | |
* Example: | |
* | |
@set { | |
options { |