File tree Expand file tree Collapse file tree 4 files changed +24
-9
lines changed
Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 1919 <!-- Analysis -->
2020 <PackageVersion Include =" StyleCop.Analyzers" Version =" 1.2.0-beta.556" NoWarn =" NU5104" />
2121 <PackageVersion Include =" Roslynator.Analyzers" Version =" 4.14.1" />
22- <PackageVersion Include =" Meziantou.Analyzer" Version =" 2.0.257 " />
22+ <PackageVersion Include =" Meziantou.Analyzer" Version =" 2.0.258 " />
2323 <!-- Specifications -->
2424 <PackageVersion Include =" Cratis.Specifications.XUnit" Version =" 3.0.4" />
2525 <PackageVersion Include =" xunit" Version =" 2.9.3" />
2626 <PackageVersion Include =" xunit.runner.visualstudio" Version =" 3.1.5" />
2727 <PackageVersion Include =" moq" Version =" 4.20.72" />
2828 <PackageVersion Include =" Microsoft.NET.Test.SDK" Version =" 18.0.1" />
2929
30- <PackageVersion Include =" Microsoft.Extensions.DependencyInjection" Version =" 10.0.0 " />
31- <PackageVersion Include =" Microsoft.Extensions.DependencyModel" Version =" 10.0.0 " />
32- <PackageVersion Include =" System.Text.Json" Version =" 10.0.0 " />
30+ <PackageVersion Include =" Microsoft.Extensions.DependencyInjection" Version =" 10.0.1 " />
31+ <PackageVersion Include =" Microsoft.Extensions.DependencyModel" Version =" 10.0.1 " />
32+ <PackageVersion Include =" System.Text.Json" Version =" 10.0.1 " />
3333 <PackageVersion Include =" OpenTelemetry" Version =" 1.14.0" />
3434 </ItemGroup >
3535 <Import Project =" $(MSBuildThisFileDirectory)/Directory.Packages.NET8-9.props" Condition =" '$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net9.0' " />
Original file line number Diff line number Diff line change @@ -35,7 +35,12 @@ export class Guid implements IEquatable {
3535 * Initializes a new instance of the {Guid} class.
3636 * @param {number[]|Uint8Array } bytes - The 16 bytes that represents a {Guid}.
3737 */
38- constructor ( readonly bytes : number [ ] | Uint8Array ) {
38+ constructor ( readonly bytes : number [ ] | Uint8Array | undefined ) {
39+ if ( bytes === undefined ) {
40+ this . _stringVersion = Guid . empty . toString ( ) ;
41+ return ;
42+ }
43+
3944 this . _stringVersion = '' +
4045 getString ( bytes [ 3 ] ) + getString ( bytes [ 2 ] ) + getString ( bytes [ 1 ] ) + getString ( bytes [ 0 ] ) +
4146 '-' +
Original file line number Diff line number Diff line change 1+ // Copyright (c) Cratis. All rights reserved.
2+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+ import { Guid } from '../Guid' ;
5+
6+ describe ( 'when constructing with undefined bytes' , ( ) => {
7+ const guid = new Guid ( undefined ) ;
8+
9+ it ( 'should be the same as empty' , ( ) => guid . equals ( Guid . empty ) . should . be . true ) ;
10+ } ) ;
Original file line number Diff line number Diff line change 2727 "@types/chai" : " 5.2.3" ,
2828 "@types/chai-as-promised" : " 8.0.2" ,
2929 "@types/mocha" : " 10.0.10" ,
30- "@types/node" : " 24.10.2 " ,
30+ "@types/node" : " 25.0.1 " ,
3131 "@types/sinon" : " 21.0.0" ,
3232 "@types/sinon-chai" : " 4.0.0" ,
33- "@typescript-eslint/eslint-plugin" : " 8.48.1 " ,
33+ "@typescript-eslint/eslint-plugin" : " 8.49.0 " ,
3434 "@typescript-eslint/parser" : " 8.49.0" ,
3535 "chai" : " 6.2.1" ,
3636 "chai-as-promised" : " 8.0.2" ,
3737 "edit-json-file" : " 1.8.1" ,
38- "eslint" : " 9.39.1 " ,
38+ "eslint" : " 9.39.2 " ,
3939 "eslint-config-prettier" : " 10.1.8" ,
4040 "eslint-plugin-header" : " 3.1.1" ,
4141 "eslint-plugin-import" : " 2.32.0" ,
4646 "globals" : " 16.5.0" ,
4747 "mocha" : " 11.7.5" ,
4848 "module-alias" : " 2.2.3" ,
49- "npm-check-updates" : " 19.1.2 " ,
49+ "npm-check-updates" : " 19.2.0 " ,
5050 "prettier" : " 3.7.4" ,
5151 "rollup" : " 4.53.3" ,
5252 "rollup-plugin-commonjs" : " 10.1.0" ,
You can’t perform that action at this time.
0 commit comments