@transcend-io/type-utils
Advanced tools
Comparing version 1.2.0 to 1.2.2
{ | ||
"name": "prettier", | ||
"version": "3.1.0-sdk", | ||
"main": "./index.cjs", | ||
"version": "2.8.8-sdk", | ||
"main": "./index.js", | ||
"type": "commonjs", | ||
"bin": "./bin/prettier.cjs" | ||
"bin": "./bin-prettier.js" | ||
} |
@@ -6,3 +6,2 @@ import type { ObjByString, StringKeys } from './types'; | ||
* This allows one to define an object keys in an enum and then the resulting map should keep the same typing | ||
* | ||
* @param obj - The object to apply the function to | ||
@@ -19,3 +18,2 @@ * @param applyFunc - The function to apply | ||
* This allows one to define an object keys in an enum and then the resulting map should keep the same typing | ||
* | ||
* @param obj - The object to apply the function to | ||
@@ -30,3 +28,2 @@ * @param applyFunc - The function to apply | ||
* Convert a typescript enum to a mapping of [value]: [value] and then call apply on that | ||
* | ||
* @param enm - The object to apply the function to | ||
@@ -33,0 +30,0 @@ * @param applyFunc - The function to apply |
@@ -11,3 +11,2 @@ "use strict"; | ||
* This allows one to define an object keys in an enum and then the resulting map should keep the same typing | ||
* | ||
* @param obj - The object to apply the function to | ||
@@ -28,3 +27,2 @@ * @param applyFunc - The function to apply | ||
* This allows one to define an object keys in an enum and then the resulting map should keep the same typing | ||
* | ||
* @param obj - The object to apply the function to | ||
@@ -47,3 +45,2 @@ * @param applyFunc - The function to apply | ||
* Convert a typescript enum to a mapping of [value]: [value] and then call apply on that | ||
* | ||
* @param enm - The object to apply the function to | ||
@@ -50,0 +47,0 @@ * @param applyFunc - The function to apply |
@@ -5,3 +5,2 @@ import * as t from 'io-ts'; | ||
* Decode a codec, returning the value if contents are validated, else throws an error | ||
* | ||
* @param codec - The codec to decode with | ||
@@ -8,0 +7,0 @@ * @param txt - The text to JSON parse |
@@ -20,3 +20,2 @@ "use strict"; | ||
* Decode a codec, returning the value if contents are validated, else throws an error | ||
* | ||
* @param codec - The codec to decode with | ||
@@ -23,0 +22,0 @@ * @param txt - The text to JSON parse |
@@ -12,3 +12,2 @@ import * as t from 'io-ts'; | ||
* Copied from https://github.com/gcanti/io-ts/issues/429#issuecomment-655394345 | ||
* | ||
* @param keys - The possible dictionary keys | ||
@@ -15,0 +14,0 @@ * @param values - The possible dictionary values |
@@ -33,3 +33,2 @@ "use strict"; | ||
* Copied from https://github.com/gcanti/io-ts/issues/429#issuecomment-655394345 | ||
* | ||
* @param keys - The possible dictionary keys | ||
@@ -36,0 +35,0 @@ * @param values - The possible dictionary values |
@@ -12,3 +12,2 @@ import * as t from 'io-ts'; | ||
* The refinement for encoding/decoding strings of fixed length | ||
* | ||
* @param min - The array min length | ||
@@ -15,0 +14,0 @@ * @param max - The array max length |
@@ -31,3 +31,2 @@ "use strict"; | ||
* The refinement for encoding/decoding strings of fixed length | ||
* | ||
* @param min - The array min length | ||
@@ -34,0 +33,0 @@ * @param max - The array max length |
@@ -11,3 +11,2 @@ import * as t from 'io-ts'; | ||
* The refinement for encoding/decoding strings of fixed length | ||
* | ||
* @param len - The string's length | ||
@@ -14,0 +13,0 @@ * @returns The fixed length string codec |
@@ -31,3 +31,2 @@ "use strict"; | ||
* The refinement for encoding/decoding strings of fixed length | ||
* | ||
* @param len - The string's length | ||
@@ -34,0 +33,0 @@ * @returns The fixed length string codec |
/** | ||
* Checks the error message to see if it is an io-ts codec error | ||
* | ||
* @param err - The error obj | ||
@@ -5,0 +4,0 @@ * @returns whether it is a io-ts codec error |
@@ -6,3 +6,2 @@ "use strict"; | ||
* Checks the error message to see if it is an io-ts codec error | ||
* | ||
* @param err - The error obj | ||
@@ -9,0 +8,0 @@ * @returns whether it is a io-ts codec error |
@@ -10,3 +10,2 @@ import * as t from 'io-ts'; | ||
* Like t.record, but where the keys are all optional to include | ||
* | ||
* @param domain - The key type, like `'a' | 'b' | 'c'`. In this example, 0 or more of those keys would need to be present. | ||
@@ -13,0 +12,0 @@ * @param codomain - The value type |
@@ -31,3 +31,2 @@ "use strict"; | ||
* Like t.record, but where the keys are all optional to include | ||
* | ||
* @param domain - The key type, like `'a' | 'b' | 'c'`. In this example, 0 or more of those keys would need to be present. | ||
@@ -34,0 +33,0 @@ * @param codomain - The value type |
import type { JSONSchema7 } from 'json-schema'; | ||
/** | ||
* Convert an io-ts codec to a JSON Schema (v7) | ||
* | ||
* @param _type - an io-ts codec | ||
@@ -6,0 +5,0 @@ * @param strict - whether to enable strict mode |
@@ -6,3 +6,2 @@ "use strict"; | ||
* Convert an io-ts codec to a JSON Schema (v7) | ||
* | ||
* @param _type - an io-ts codec | ||
@@ -9,0 +8,0 @@ * @param strict - whether to enable strict mode |
@@ -22,3 +22,2 @@ import type { ObjByString } from './types'; | ||
* Convert a list of strings to an "enum" object | ||
* | ||
* @param attributes - The attributes of the enum | ||
@@ -30,3 +29,2 @@ * @returns The input to become an enum | ||
* Create an enum object with a proxy handler that will throw an error when a property is access that is not in the enum | ||
* | ||
* @param attributes - The enums to merge into a single enum (all properties) | ||
@@ -38,3 +36,2 @@ * @returns The object proxy with error logger when a value is accessed outside of enum | ||
* Filter an enum and return the keys that remain | ||
* | ||
* @param obj - The object to filter | ||
@@ -47,3 +44,2 @@ * @param filterFunc - The function to filter the enum key/values by | ||
* Make an enum compatible with types -- in separate file because Logger/enums and Enum/index circular dependency | ||
* | ||
* @param x - The enum | ||
@@ -50,0 +46,0 @@ * @returns The object proxy with error logger when a value is accessed outside of enum |
@@ -6,3 +6,2 @@ "use strict"; | ||
* Convert a list of strings to an "enum" object | ||
* | ||
* @param attributes - The attributes of the enum | ||
@@ -21,3 +20,2 @@ * @returns The input to become an enum | ||
* Create an enum object with a proxy handler that will throw an error when a property is access that is not in the enum | ||
* | ||
* @param attributes - The enums to merge into a single enum (all properties) | ||
@@ -34,3 +32,2 @@ * @returns The object proxy with error logger when a value is accessed outside of enum | ||
* Filter an enum and return the keys that remain | ||
* | ||
* @param obj - The object to filter | ||
@@ -50,3 +47,2 @@ * @param filterFunc - The function to filter the enum key/values by | ||
* Make an enum compatible with types -- in separate file because Logger/enums and Enum/index circular dependency | ||
* | ||
* @param x - The enum | ||
@@ -53,0 +49,0 @@ * @returns The object proxy with error logger when a value is accessed outside of enum |
import type { ObjByString } from './types'; | ||
/** | ||
* Object.entries that actually preserves entries as types. | ||
* | ||
* @param o - The object to get the entries from | ||
@@ -6,0 +5,0 @@ * @returns The entries of the object preserving type |
@@ -6,3 +6,2 @@ "use strict"; | ||
* Object.entries that actually preserves entries as types. | ||
* | ||
* @param o - The object to get the entries from | ||
@@ -9,0 +8,0 @@ * @returns The entries of the object preserving type |
import type { StringKeys } from './types'; | ||
/** | ||
* Object.keys for string keys only | ||
* | ||
* @param o - The object to get the keys from | ||
@@ -11,4 +10,2 @@ * @returns The string keys of the object preserving type | ||
* Object.keys that actually preserves keys as types. | ||
* | ||
* | ||
* @param o - The object to get the keys from | ||
@@ -15,0 +12,0 @@ * @returns The keys of the object preserving type |
@@ -7,3 +7,2 @@ "use strict"; | ||
* Object.keys for string keys only | ||
* | ||
* @param o - The object to get the keys from | ||
@@ -18,4 +17,2 @@ * @returns The string keys of the object preserving type | ||
* Object.keys that actually preserves keys as types. | ||
* | ||
* | ||
* @param o - The object to get the keys from | ||
@@ -22,0 +19,0 @@ * @returns The keys of the object preserving type |
/** | ||
* Object.values that actually preserves values as types. | ||
* | ||
* @param o - The object to get the values from | ||
@@ -5,0 +4,0 @@ * @returns The values of the object preserving type |
@@ -6,3 +6,2 @@ "use strict"; | ||
* Object.values that actually preserves values as types. | ||
* | ||
* @param o - The object to get the values from | ||
@@ -9,0 +8,0 @@ * @returns The values of the object preserving type |
@@ -17,3 +17,2 @@ /** | ||
* resulting graphql statement is a pain, and thus why graphql-tag is not used. | ||
* | ||
* @param strings - The template string | ||
@@ -20,0 +19,0 @@ * @param expressions - The expressions injected into the template |
@@ -13,3 +13,2 @@ "use strict"; | ||
* resulting graphql statement is a pain, and thus why graphql-tag is not used. | ||
* | ||
* @param strings - The template string | ||
@@ -16,0 +15,0 @@ * @param expressions - The expressions injected into the template |
@@ -6,3 +6,2 @@ /** | ||
* list that return that identifier. | ||
* | ||
* @param iterable - the list to group by keys | ||
@@ -9,0 +8,0 @@ * @param getKey - the function to apply to an element of the list to get the key it should belong in |
@@ -9,3 +9,2 @@ "use strict"; | ||
* list that return that identifier. | ||
* | ||
* @param iterable - the list to group by keys | ||
@@ -12,0 +11,0 @@ * @param getKey - the function to apply to an element of the list to get the key it should belong in |
/** | ||
* Invert an object so that the values look up the keys. | ||
* If the object has an array as the value, each item in the array will be inverted. | ||
* | ||
* @param obj - The object to invert | ||
@@ -16,3 +15,2 @@ * @param throwOnDuplicate - When true, throw error if duplicate key detected | ||
* Safely invert an object to be { [key in TValue]: TKey[] } | ||
* | ||
* @param obj - The object to invert | ||
@@ -19,0 +17,0 @@ * @returns The inverted object |
@@ -9,3 +9,2 @@ "use strict"; | ||
* If the object has an array as the value, each item in the array will be inverted. | ||
* | ||
* @param obj - The object to invert | ||
@@ -50,3 +49,2 @@ * @param throwOnDuplicate - When true, throw error if duplicate key detected | ||
* Safely invert an object to be { [key in TValue]: TKey[] } | ||
* | ||
* @param obj - The object to invert | ||
@@ -53,0 +51,0 @@ * @returns The inverted object |
import * as t from 'io-ts'; | ||
/** | ||
* We care about the values of an enum. This does not come out of the box with io-ts so we have to invert the enum first. | ||
* | ||
* @param enm - The enum to invert | ||
@@ -6,0 +5,0 @@ * @returns The io-ts keyof |
@@ -33,3 +33,2 @@ "use strict"; | ||
* We care about the values of an enum. This does not come out of the box with io-ts so we have to invert the enum first. | ||
* | ||
* @param enm - The enum to invert | ||
@@ -36,0 +35,0 @@ * @returns The io-ts keyof |
@@ -5,3 +5,3 @@ { | ||
"description": "Small package containing useful typescript utilities.", | ||
"version": "1.2.0", | ||
"version": "1.2.2", | ||
"homepage": "https://github.com/transcend-io/type-utils", | ||
@@ -48,3 +48,3 @@ "repository": { | ||
"mocha": "^10.2.0", | ||
"prettier": "^3.1.0", | ||
"prettier": "^2.7.1", | ||
"ts-node": "^10.9.1", | ||
@@ -51,0 +51,0 @@ "typescript": "^5.3.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129037
1375