ts-prime
Version:
A utility library for JavaScript and Typescript.
1,612 lines • 568 kB
JSON
{
"metadata": {
"toolPackage": "@microsoft/api-extractor",
"toolVersion": "7.12.0",
"schemaVersion": 1003,
"oldestForwardsCompatibleVersion": 1001
},
"kind": "Package",
"canonicalReference": "ts-prime!",
"docComment": "",
"name": "ts-prime",
"members": [
{
"kind": "EntryPoint",
"canonicalReference": "ts-prime!",
"name": "",
"members": [
{
"kind": "Function",
"canonicalReference": "ts-prime!allPass:function(1)",
"docComment": "/**\n * Determines whether all predicates returns true for the input data.\n *\n * @param data - The input data for predicates.\n *\n * @param fns - The list of predicates. @signature P.allPass(data, fns) @signature P.allPass(fns)(data)\n *\n * @example\n *\n * const isDivisibleBy3 = (x: number) => x % 3 === 0 const isDivisibleBy4 = (x: number) => x % 4 === 0 const fns = [isDivisibleBy3, isDivisibleBy4] P.allPass(12, fns) // => true P.allPass(8, fns) // => false @category Array, Pipe\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function allPass<T>(data: "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": ", fns: "
},
{
"kind": "Reference",
"text": "ReadonlyArray",
"canonicalReference": "!ReadonlyArray:interface"
},
{
"kind": "Content",
"text": "<(data: T) => boolean>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "data",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "fns",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "allPass"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!allPass:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function allPass<T>(fns: "
},
{
"kind": "Reference",
"text": "ReadonlyArray",
"canonicalReference": "!ReadonlyArray:interface"
},
{
"kind": "Content",
"text": "<(data: T) => boolean>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(data: T) => boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "fns",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "allPass"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!anyPass:function(1)",
"docComment": "/**\n * Determines whether any predicate returns true for the input data.\n *\n * @param data - item\n *\n * @param fns - The list of predicates. @signature P.anyPass(data,fns) @signature P.anyPass(fns)(data)\n *\n * @example\n *\n * const isDivisibleBy3 = (x: number) => x % 3 === 0 const isDivisibleBy4 = (x: number) => x % 4 === 0 const fns = [isDivisibleBy3, isDivisibleBy4] P.anyPass(fns)(8) // => true P.anyPass(fns)(11) // => false @category Array, Pipe\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function anyPass<T>(data: "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": ", fns: "
},
{
"kind": "Reference",
"text": "ReadonlyArray",
"canonicalReference": "!ReadonlyArray:interface"
},
{
"kind": "Content",
"text": "<(data: T) => boolean>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "data",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "fns",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "anyPass"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!anyPass:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function anyPass<T>(fns: "
},
{
"kind": "Reference",
"text": "ReadonlyArray",
"canonicalReference": "!ReadonlyArray:interface"
},
{
"kind": "Content",
"text": "<(data: T) => boolean>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(data: T) => boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "fns",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "anyPass"
},
{
"kind": "TypeAlias",
"canonicalReference": "ts-prime!ArgsType:type",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type ArgsType<T> = "
},
{
"kind": "Content",
"text": "T extends (...args: infer U) => any ? U : []"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "ArgsType",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"typeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "Function",
"canonicalReference": "ts-prime!assertError:function(1)",
"docComment": "/**\n * Assertion statement\n *\n * @throws\n *\n * Throws if data is instance of error @export const request = () => P.canFail(()=> axios.get(url)) const result = await request.then(P.assertError) @category Utility\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function assertError<T>(data: "
},
{
"kind": "Content",
"text": "T | "
},
{
"kind": "Reference",
"text": "Error",
"canonicalReference": "!Error:interface"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "data",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "assertError"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!base64decode:function(1)",
"docComment": "/**\n * Decode base64 encoded string. @signature P.base64decode(str)\n *\n * @example\n *\n * P.base64decode(\"dHMtcHJpbWUgaXMgYXdlc29tZQ==\") //=> ts-prime is awesome @category Utility\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function base64decode(input: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "input",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "base64decode"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!base64encode:function(1)",
"docComment": "/**\n * Encode string with base64 encoding. @signature P.base64encode(str)\n *\n * @example\n *\n * P.base64encode(\"ts-prime is awesome\") //=> dHMtcHJpbWUgaXMgYXdlc29tZQ== @category Utility\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function base64encode(input: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "input",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "base64encode"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!cache:function(1)",
"docComment": "/**\n * Function middleware that caches function output based on input\n *\n * @param fn - target function\n *\n * @param cacheFn - function that receives and return cache key @signature P.cache(fn, options) @signature P.cache(options)(fn)\n *\n * @example\n *\n * const request = (url: string) => axios.get(url) const requestWithCache = P.cache(request, (url) => url) @category Utility, Pipe\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function cache<I extends "
},
{
"kind": "Content",
"text": "(...args: any[]) => any"
},
{
"kind": "Content",
"text": ">(fn: "
},
{
"kind": "Content",
"text": "I"
},
{
"kind": "Content",
"text": ", options?: "
},
{
"kind": "Reference",
"text": "CacheOptions",
"canonicalReference": "ts-prime!CacheOptions:interface"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "ArgsType",
"canonicalReference": "ts-prime!ArgsType:type"
},
{
"kind": "Content",
"text": "<I>, "
},
{
"kind": "Reference",
"text": "ReturnType",
"canonicalReference": "!ReturnType:type"
},
{
"kind": "Content",
"text": "<I>>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "I"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 12,
"endIndex": 13
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "fn",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
},
{
"parameterName": "options",
"parameterTypeTokenRange": {
"startIndex": 5,
"endIndex": 11
}
}
],
"typeParameters": [
{
"typeParameterName": "I",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "cache"
},
{
"kind": "Interface",
"canonicalReference": "ts-prime!CacheMechanism:interface",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface CacheMechanism<R> "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "R",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "CacheMechanism",
"members": [
{
"kind": "PropertySignature",
"canonicalReference": "ts-prime!CacheMechanism#get:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "get: "
},
{
"kind": "Content",
"text": "(key: string) => R | undefined"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"releaseTag": "Public",
"name": "get",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "ts-prime!CacheMechanism#set:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "set: "
},
{
"kind": "Content",
"text": "(key: string, data: R) => void"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"releaseTag": "Public",
"name": "set",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"extendsTokenRanges": []
},
{
"kind": "Interface",
"canonicalReference": "ts-prime!CacheOptions:interface",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface CacheOptions<I extends "
},
{
"kind": "Content",
"text": "any[]"
},
{
"kind": "Content",
"text": ", R> "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "I",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "R",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "CacheOptions",
"members": [
{
"kind": "PropertySignature",
"canonicalReference": "ts-prime!CacheOptions#cacheKeyFn:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "cacheKeyFn?: "
},
{
"kind": "Content",
"text": "(...args: I) => string"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": true,
"releaseTag": "Public",
"name": "cacheKeyFn",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "ts-prime!CacheOptions#cacheMechanism:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "cacheMechanism?: "
},
{
"kind": "Reference",
"text": "CacheMechanism",
"canonicalReference": "ts-prime!CacheMechanism:interface"
},
{
"kind": "Content",
"text": "<R>"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": true,
"releaseTag": "Public",
"name": "cacheMechanism",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"extendsTokenRanges": []
},
{
"kind": "Function",
"canonicalReference": "ts-prime!canFail:function(1)",
"docComment": "/**\n * Similar to try catch statement. If function throws insisted callback this function will return `Error` instance\n *\n * @example\n *\n * const err = P.canFail(()=> JSON.parse(data)) if (P.isError(err)) { console.log(err) }\n *\n * const request = await canFail(() => axios.get(url)) if (P.isError(request)) return @category Utility\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function canFail<T>(fn: "
},
{
"kind": "Content",
"text": "() => "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "CanGetError",
"canonicalReference": "ts-prime!CanGetError:type"
},
{
"kind": "Content",
"text": "<T>>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 9
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "fn",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 4
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "canFail"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!canFail:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function canFail<T>(fn: "
},
{
"kind": "Content",
"text": "() => T"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "CanGetError",
"canonicalReference": "ts-prime!CanGetError:type"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "fn",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "canFail"
},
{
"kind": "TypeAlias",
"canonicalReference": "ts-prime!CanGetError:type",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type CanGetError<T> = "
},
{
"kind": "Reference",
"text": "Error",
"canonicalReference": "!Error:interface"
},
{
"kind": "Content",
"text": " | T"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "CanGetError",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"typeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
},
{
"kind": "Function",
"canonicalReference": "ts-prime!capitalize:function(1)",
"docComment": "/**\n * Capitalize first letter of word\n *\n * @param str - Any string @signature P.capitalize(str)\n *\n * @example\n *\n * P.capitalize(\"tom\") //=> Tom @category String\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function capitalize(str: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "str",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "capitalize"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!chunk:function(1)",
"docComment": "/**\n * Split an array into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining elements.\n *\n * @param array - the array\n *\n * @param size - the length of the chunk @signature P.chunk(array, size) @signature P.chunk(size)(array)\n *\n * @example\n *\n * P.chunk(['a', 'b', 'c', 'd'], 2) // => [['a', 'b'], ['c', 'd']] P.chunk(['a', 'b', 'c', 'd'], 3) // => [['a', 'b', 'c'], ['d']] P.chunk(2)(['a', 'b', 'c', 'd']) // => [['a', 'b'], ['c', 'd']] P.chunk(3)(['a', 'b', 'c', 'd']) // => [['a', 'b', 'c'], ['d']] @category Array, Pipe\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function chunk<T>(array: "
},
{
"kind": "Content",
"text": "readonly T[]"
},
{
"kind": "Content",
"text": ", size: "
},
{
"kind": "Content",
"text": "number"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "readonly T[][]"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "array",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "size",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "chunk"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!chunk:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function chunk<T>(size: "
},
{
"kind": "Content",
"text": "number"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(array: readonly T[]) => readonly T[][]"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "size",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "chunk"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!clamp:function(1)",
"docComment": "/**\n * Clamp the given value within the inclusive min and max bounds.\n *\n * @param value - the number\n *\n * @param limits - the bounds limits @signature P.clamp(value, { min, max }); @signature P.clamp({ min, max })(value);\n *\n * @example\n *\n * P.clamp(10, { min: 20 }) // => 20 P.clamp(10, { max: 5 }) // => 5 P.clamp(10, { max: 20, min: 5 }) // => 10\n *\n * P.clamp({ min: 20 })(10) // => 20 P.clamp({ max: 5 })(10) // => 5 P.clamp({ max: 20, min: 5 })(10) // => 10 @category Number, Pipe\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function clamp(value: "
},
{
"kind": "Content",
"text": "number"
},
{
"kind": "Content",
"text": ", limits: "
},
{
"kind": "Content",
"text": "{\n min?: number;\n max?: number;\n}"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "number"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "value",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "limits",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"name": "clamp"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!clamp:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function clamp(limits: "
},
{
"kind": "Content",
"text": "{\n min?: number;\n max?: number;\n}"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(value: number) => number"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "limits",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "clamp"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!clone:function(1)",
"docComment": "/**\n * Creates a deep copy of the value. Supported types: `Array`, `Object`, `Number`, `String`, `Boolean`, `Date`, `RegExp`. Functions are assigned by reference rather than copied.\n *\n * @param value - the object to clone @signature P.clone(value)\n *\n * @example\n *\n * P.clone({foo: 'bar'}) // {foo: 'bar'} @category Object\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function clone<T extends "
},
{
"kind": "Content",
"text": "any"
},
{
"kind": "Content",
"text": ">(value: "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "value",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "clone"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!compact:function(1)",
"docComment": "/**\n * Removes all undefined and null values from object rreecursively\n *\n * @param data - the object to compact @signature P.compact(value)\n *\n * @example\n *\n * P.compact({foo: undefined}) // {} @category Object\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function compact<T>(data: "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "data",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "compact"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!compact:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function compact<T>(): "
},
{
"kind": "Content",
"text": "(data: T) => T"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "compact"
},
{
"kind": "TypeAlias",
"canonicalReference": "ts-prime!ComplexSort:type",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type ComplexSort = "
},
{
"kind": "Content",
"text": "{\n order?: 'asc' | 'desc';\n value: "
},
{
"kind": "Reference",
"text": "SortValue",
"canonicalReference": "ts-prime!SortValue:type"
},
{
"kind": "Content",
"text": ";\n compare?: (a: "
},
{
"kind": "Reference",
"text": "SortValue",
"canonicalReference": "ts-prime!SortValue:type"
},
{
"kind": "Content",
"text": ", b: "
},
{
"kind": "Reference",
"text": "SortValue",
"canonicalReference": "ts-prime!SortValue:type"
},
{
"kind": "Content",
"text": ") => number;\n}"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "ComplexSort",
"typeTokenRange": {
"startIndex": 1,
"endIndex": 8
}
},
{
"kind": "Function",
"canonicalReference": "ts-prime!convertStringToNameCase:function(1)",
"docComment": "/**\n * Convert any string to nameCased variant\n *\n * @param str - the string\n *\n * @param to - convert string to 'PascalCase' | 'camelCase' | 'snake_case' | 'kebab-case' | 'Train-Case' @signature P.convertStringToNameCase(str, to);\n *\n * @example\n *\n * P.convertStringToNameCase(\"Super#@! ===-0- ball %%% cup\", 'PascalCase') // -> Super0BallCup P.convertStringToNameCase(\"Super#@! ===-0- ball %%% cup\", 'camelCase') // -> super0BallCup P.convertStringToNameCase(\"Super#@! ===-0- ball %%% cup\", 'snake_case') // -> super_0_ball_cup P.convertStringToNameCase(\"Super#@! ===-0- ball %%% cup\", 'kebab-case') // -> super-0-ball-cup P.convertStringToNameCase(\"Super#@! ===-0- ball %%% cup\", 'Train-Case') // -> Super-0-Ball-Cup @category String\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function convertStringToNameCase(str: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ", to: "
},
{
"kind": "Content",
"text": "'PascalCase' | 'camelCase' | 'snake_case' | 'kebab-case' | 'Train-Case'"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "str",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "to",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"name": "convertStringToNameCase"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!createPipe:function(1)",
"docComment": "/**\n * Creates a data-last pipe function. First function must be always annotated. Other functions are automatically inferred. @signature P.createPipe(op1, op2, op3)(data);\n *\n * @example\n *\n * P.createPipe( (x: number) => x * 2, x => x * 3 )(1) // => 6 @category Function\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function createPipe<A, B>(op1: "
},
{
"kind": "Content",
"text": "(input: A) => B"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(value: A) => B"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "op1",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"typeParameters": [
{
"typeParameterName": "A",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
},
{
"typeParameterName": "B",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "createPipe"
},
{
"kind": "Function",
"canonicalReference": "ts-prime!createPipe:function(2)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function createPipe<A, B, C>(op1: "
},
{
"kind": "Content",
"text": "(input: A) => B"
},
{
"kind": "Content",
"text": ", op2: "
},
{
"kind": "Content",
"text": "(input: B) => C"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(value: A) => C"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 5,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 2,
"parameters": [
{
"parameterName": "op1",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"parameterName": "op2",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
}
}
],
"typePar