@syncot/util
Advanced tools
Comparing version
@@ -6,2 +6,27 @@ # Change Log | ||
# [2.0.0](https://github.com/SyncOT/SyncOT/compare/@syncot/util@1.0.3...@syncot/util@2.0.0) (2020-11-16) | ||
### Bug Fixes | ||
* replace SyncOt with SyncOT everywhere ([1643d98](https://github.com/SyncOT/SyncOT/commit/1643d98d22a811444a8992cbfb26598a583a5afd)) | ||
### Features | ||
* add createId ([dd2242f](https://github.com/SyncOT/SyncOT/commit/dd2242f7bb2cf0a97b295f5c2f5553d29b0a37ab)) | ||
* add stream utils ([e63f9dc](https://github.com/SyncOT/SyncOT/commit/e63f9dc7246f2fc5cb84ebbabdf04c7caacdc9e5)) | ||
* add task runner ([d4c0fe0](https://github.com/SyncOT/SyncOT/commit/d4c0fe04d106ee40c8d506cf9a6d9728b33a2166)) | ||
* move code here from @syncot/events ([07d2e35](https://github.com/SyncOT/SyncOT/commit/07d2e35971f083bafdf5a77b70ffd90e755c5579)) | ||
* move errors here from @syncot/error ([ed34daf](https://github.com/SyncOT/SyncOT/commit/ed34daf04c610df0eb552de55c28c93f1aaf1518)) | ||
### BREAKING CHANGES | ||
* "SyncOt" replaced with "SyncOT" in the whole codebase | ||
## [1.0.3](https://github.com/SyncOT/SyncOT/compare/@syncot/util@1.0.2...@syncot/util@1.0.3) (2020-11-10) | ||
@@ -8,0 +33,0 @@ |
@@ -0,1 +1,6 @@ | ||
export * from './error'; | ||
export * from './events'; | ||
export * from './id'; | ||
export * from './taskRunner'; | ||
export * from './util'; | ||
export * from './stream'; |
@@ -0,1 +1,6 @@ | ||
export * from './error'; | ||
export * from './events'; | ||
export * from './id'; | ||
export * from './taskRunner'; | ||
export * from './util'; | ||
export * from './stream'; |
/** | ||
* Throws an `AssertError` if `value` is falsy. | ||
*/ | ||
export declare function assert(value: any, message?: string): void; | ||
/** | ||
* A simple function which throws an error, when a theoretically unreachable code path is executed anyway. | ||
* @param _never An optional parameter which can be used by the client code to ensura that a variable | ||
* has type `never`. | ||
*/ | ||
export declare function assertUnreachable(_never?: never): never; | ||
/** | ||
* The type of validation result. | ||
@@ -35,2 +25,5 @@ */ | ||
}; | ||
/** | ||
* A function which does nothing. | ||
*/ | ||
export declare function noop(): void; | ||
@@ -69,2 +62,5 @@ /** | ||
}) => Promise<void>; | ||
/** | ||
* Returns a random integer in the specified range. | ||
*/ | ||
export declare function randomInteger(minInclusive: number, maxExclusive: number): number; |
@@ -1,19 +0,3 @@ | ||
import { createAssertError } from '@syncot/error'; | ||
import { assert } from './error'; | ||
/** | ||
* Throws an `AssertError` if `value` is falsy. | ||
*/ | ||
export function assert(value, message) { | ||
if (!value) { | ||
throw createAssertError(message); | ||
} | ||
} | ||
/** | ||
* A simple function which throws an error, when a theoretically unreachable code path is executed anyway. | ||
* @param _never An optional parameter which can be used by the client code to ensura that a variable | ||
* has type `never`. | ||
*/ | ||
export function assertUnreachable(_never) { | ||
throw createAssertError('This should never happen!'); | ||
} | ||
/** | ||
* Throws the specified `error`, if defined. | ||
@@ -39,2 +23,5 @@ */ | ||
}; | ||
/** | ||
* A function which does nothing. | ||
*/ | ||
export function noop() { | ||
@@ -71,2 +58,5 @@ // Do nothing. | ||
export const whenError = whenEvent('error'); | ||
/** | ||
* Returns a random integer in the specified range. | ||
*/ | ||
export function randomInteger(minInclusive, maxExclusive) { | ||
@@ -73,0 +63,0 @@ assert(Number.isSafeInteger(minInclusive), 'Argument "minInclusive" must be a safe integer.'); |
{ | ||
"name": "@syncot/util", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "A collection of simple utilities.", | ||
@@ -29,6 +29,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@syncot/error": "^0.3.0", | ||
"@types/readable-stream": "^2.3.1", | ||
"base64-js": "^1.5.1", | ||
"readable-stream": "^3.3.0", | ||
"tslib": "^2.0.3" | ||
}, | ||
"gitHead": "5ba3e377863fb1d00a2c1fb556ae6832f9950ada" | ||
"gitHead": "d44ea483c2be41defaa32738e82ec3a9e1e58492" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
34361
279.93%17
142.86%835
475.86%4
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed