extremejs / utils Goto Github PK
View Code? Open in Web Editor NEWExtremeJS Utilities
Home Page: https://extremejs.github.io/utils/
License: MIT License
ExtremeJS Utilities
Home Page: https://extremejs.github.io/utils/
License: MIT License
No response
This method should return all but the last element of the value.
Purposed definition:
function head<Value extends unknown[] | string>(value: Value): Value;
No response
This method determines whether the provided value is a symbol or not.
Purposed definition:
function isSymbol(value: unknown): value is symbol;
No response
This method should compute the mean of the values returned by the iteratee
for each element in the array.
Purposed definition:
function meanByFn(array: unknown[], iteratee: (value: unknown) => number): number;
No response
This method determines whether the provided value is a string or not.
Purposed definition:
function isString(value: unknown): value is string;
No response
This method determines whether the provided number is an even number or not.
Purposed definition:
function isEven(number: number): boolean;
No response
This method determines whether the provided value is null/undefined or not.
Purposed definition:
function isNil(value: unknown): boolean;
No response
This method should check whether the string
starts with the given searchString
string.
Purposed definition:
function startsWith(string: string, searchString: string, position?: number): boolean;
No response
This method determines whether the provided value is undefined or not.
Purposed definition:
function isUndefined(value: unknown): boolean;
No response
This method should compute the mean of the values returned by the property
for each element in the array
.
Purposed definition:
function meanByProperty(array: unknown[], property: string): number;
No response
This method should iterate through each of the provided values
array, by the provided iteratee
function and add the resulting numbers returned by the said iteratee
function to produce the desired sum
.
Purposed definition:
function sumByFn<Value>(values: Value[], iteratee: (value: Value) => number): number;
No response
This method should split string
by separator
.
Purposed definition:
function split(string: string, separator: string | RegExp, limit?: number): string[];
No response
This method should convert the given string to camel case.
Purposed definition:
function camelCase (string: string): string;
No response
This method should convert all elements in the array
into a string separated by the separator
.
Purposed definition:
function join(array: unknown[], separator: string = ""): string;
No response
This method should create a new array concatenating the input array with any additional arrays and/or values.
Purposed definition:
function concat(array: unknown[], ...values: unknown[][]): unknown[];
No response
This method should convert the first character of the string
to upper case.
Purposed definition:
function upperFirst(string: string): string;
No response
This method repeats the given string count
times.
Purposed definition:
function repeat(string: string, count: number): string;
No response
This method determines whether the provided value is a finite number or not.
Purposed definition:
function isFinite(value: unknown): boolean;
No response
This method replaces matches for the pattern
in the string
with the replacement
.
Purposed definition:
function replace(string: string, pattern: RegExp | string, replacement: Function | string): string;
No response
This method should create an array of elements split into groups the length of size
. If the array
can't be split evenly, the final chunk will be the remaining elements.
Purposed definition:
function chunk(array: unknown[], size: number = 1): unknown[][];
No response
This method determines whether the provided value is a safe integer or not.
Purposed definition:
function isSafeInteger(value: unknown): boolean;
No response
This method should convert the given string to kebab case.
Purposed definition:
function kebabCase(string: string): string;
No response
This method should convert the first character of the string
to lower case.
Purposed definition:
function lowerFirst(string: string): string;
No response
This method should return the desired value based on the provided property.
Purposed definition:
function get(value: unknown, property: PropertyT, fallback: unknown): unknown;
No response
This method determines whether the provided value is a plain object or not.
Purposed definition:
function isPlainObject(value: unknown): boolean;
No response
This method determines whether the provided value is a RegExp istance or not.
Purposed definition:
function isRegExp(value: unknown): boolean;
No response
This method should return all but the first element of the value.
Purposed definition:
function tail<Value extends unknown[] | string>(value: Value): Value;
No response
This method determines whether the provided value is an object or not.
Purposed definition:
function isObject(value: unknown): boolean;
No response
This method should convert the given string to snake case.
Purposed definition:
function snakeCase(string: string): string;
No response
This method determines whether the provided value is an array or not.
Purposed definition:
const isArray = Array.isArray;
No response
This method determines whether the provided value is an error or not.
Purposed definition:
function isError(value: unknown): boolean;
No response
This method should filter out the falsey values from the provided array
.
Purposed definition:
function compact<Value>(array: Value[]): Array<CompactT<Value>>;
export type CompactT<Value> = Value extends ""
? never
: Value extends 0
? never
: Value extends false
? never
: Value extends null
? never
: Value extends undefined
? never
: Value extends typeof NaN
? never
: Value;
No response
This method determines whether the provided value is a number or not.
Purposed definition:
function isNumber(value: unknown): value is number;
No response
This method should convert the first character of the string
to upper case and the remaining to lower case.
Purposed definition:
function capitalize(string: string): string;
No response
This method should return the last element of the value.
Purposed definition:
function last<Value extends unknown[] | string>(value: Value): Value;
No response
This method should check whether the string
ends with the given searchString
string.
Purposed definition:
function endsWith(string: string, searchString: string, position?: number): boolean;
No response
This method should return the first element of the value.
Purposed definition:
function first<Value extends unknown[] | string>(value: Value): Value;
No response
This method should add the provided numbers
to produce the desired sum
.
Purposed definition:
function sum(numbers: number[]): number;
No response
This method determines whether the provided value is a buffer or not.
Purposed definition:
function isBuffer(value: unknown): boolean;
No response
This method should convert the provided property to an array of keys that'll represent the path of a value in an object.
Purposed definition:
function toPath<Property extends PropertyT>(property: Property): PathT<Property>;
type PropertyT = PropertyKey;
type PathT<Property extends PropertyT> = Property extends ""
? []
: Property extends number
? [Property]
: Property extends symbol
? [Property]
: Property extends `${ infer First }.${ infer Rest }`
? [...PathT<First>, ...PathT<Rest>]
: Property extends `${ infer First }[${ infer Rest }`
? [...PathT<First>, ...PathT<Rest>]
: Property extends `${ infer First }][${ infer Rest }`
? [...PathT<First>, ...PathT<Rest>]
: Property extends `${ infer Last }]`
? [Last]
: [Property];
No response
This method determines whether the provided value is null or not.
Purposed definition:
function isNull(value: unknown): boolean;
No response
This method should iterate through each of the provided values
array and add the value of each element's property
to produce the desired sum
.
Purposed definition:
function sumByProperty<Value>(values: Value[], property: PropertyT): number;
No response
This method determines whether the provided value is an integer or not.
Purposed definition:
function isInteger(value: unknown): boolean;
No response
This method determines whether the provided value is a boolean or not.
Purposed definition:
function isBoolean(value: unknown): value is boolean;
No response
This method determines whether the provided value is a date or not.
Purposed definition:
function isDate(value: unknown): boolean;
No response
This method should create a slice of the value
(array/string) from start
, up to, but not including, end
.
Purposed definition:
function slice(value: string | unknown[], start: number = 0, end: number = value.length): string | unknown[];
No response
This method should convert the given string to lowercase.
Purposed definition:
function lowerCase(string: string): string;
No response
This method determines whether the provided value is NaN or not.
Purposed definition:
function IsNaN(value: unknown): boolean;
No response
This method should compute the mean of the numbers.
Purposed definition:
function mean(numbers: number[]): number;
No response
This method determines whether the provided value is a function or not.
Purposed definition:
function isFunction(value: unknown): boolean;
No response
This method should convert the given string to uppercase.
Purposed definition:
function upperCase(string: string): string;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.