@syncot/util
Advanced tools
Comparing version 1.0.3 to 2.0.0
@@ -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" | ||
} |
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
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
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
34361
17
835
4
1
+ Addedbase64-js@^1.5.1
+ Addedreadable-stream@^3.3.0
+ Added@types/node@22.7.4(transitive)
+ Added@types/readable-stream@2.3.15(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removed@syncot/error@^0.3.0
- Removed@syncot/error@0.3.0(transitive)