From 4e499dad9f3d03fcf85090ed516bcb30ba29bdad Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Thu, 22 Feb 2024 14:24:22 +0530 Subject: [PATCH 01/22] added is-same-date-object #1337 --- .../assert/is-same-date-object/README.md | 90 +++++++++++++++++++ .../benchmark/benchmark.length.js | 48 ++++++++++ .../assert/is-same-date-object/docs/repl.txt | 30 +++++++ .../is-same-date-object/docs/types/index.d.ts | 51 +++++++++++ .../is-same-date-object/docs/types/test.ts | 36 ++++++++ .../is-same-date-object/examples/index.js | 53 +++++++++++ .../assert/is-same-date-object/lib/index.js | 52 +++++++++++ .../assert/is-same-date-object/lib/main.js | 61 +++++++++++++ .../assert/is-same-date-object/package.json | 78 ++++++++++++++++ .../assert/is-same-date-object/test/test.js | 71 +++++++++++++++ 10 files changed, 570 insertions(+) create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/README.md create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/package.json create mode 100644 lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md new file mode 100644 index 000000000000..c5a5f48c2d22 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md @@ -0,0 +1,90 @@ + + +# isSameDateObject + +> Test if two arguments are both Date objects and represent the same date object + +
+ +## Usage + +```javascript +var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); +``` + +#### isSameDateObject( d1 , d2 ) + +Tests if two arguments are both valid date objects and both resolve to the same timestamp. + +```javascript +var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +var bool = isSameDateObject( d1, d2 ); +// returns true + +bool = isSameDateObject( d1, new Date(2023, 11, 31, 23, 59, 59, 78)); +// returns false +``` +
+ + + + +
+ +## Examples + + + +```javascript +var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); + +var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + +var bool = isSameDateObject( d1, d2 ); +// returns true + +d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +d2 = new Date(2024, 11, 31, 23, 59, 59, 78); + +bool = isSameDateObject( d1, d2 ); +// returns false + +d1 = new Date(); // Current date and time +d2 = new Date("2024-12-31T23:59:59.999Z"); // Date and time specified in ISO 8601 format + +bool = isSameDateObject(d1, d2); +// returns false + +var d3 = new Date(2024, 11, 31); // Date specified using year, month, and day +var d4 = new Date("December 31, 2024 23:59:59"); // Date and time specified in a readable format + +bool = isSameDateObject(d1, d3); +// returns false + +bool = isSameDateObject(d2, d4); +// returns true +``` + +
+ + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js new file mode 100644 index 000000000000..220dbc3b5da1 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +const bench = require('@stdlib/bench'); +var pkg = require( './../package.json' ).name; +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var isSameDateObject = require( './../lib' ); + +//FUNCTIONS // + +bench('isSameDateObject', function benchmark(b) { + var date1 = new Date(); + var date2 = new Date(); + var bool; + b.tic(); + for (var i = 0; i < b.iterations; i++) { + date2.setMilliseconds(i); // Change the date slightly each iteration + bool = isSameDateObject(date1, date2); + if (typeof bool !== 'boolean') { + b.fail('should return a boolean'); + } + } + b.toc(); + if (!isBoolean(bool)) { + b.fail('should return a boolean'); + } + b.pass('benchmark finished'); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt new file mode 100644 index 000000000000..830bf69417a7 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -0,0 +1,30 @@ + +{{alias}}( d1, d2 ) + Tests if two arguments are both Date objects and resolve to the same timestamp. + + Parameters + ---------- + d1:any + First input value. + d2:any + Second input value. + + Returns + ------- + bool: boolean + Boolean indicating whether two arguments are both Date objects and resolve to the same timestamp + + Examples + -------- + >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + >var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + >var bool = {{alias}}( d1, d2 ); + true + + >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + >var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); + >var bool = {{alias}}( d1, d2 ); + false + + See Also + -------- \ No newline at end of file diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts new file mode 100644 index 000000000000..57a96d32c2ed --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts @@ -0,0 +1,51 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Tests if two arguments are both generic arrays and have the same values. +* +* ## Notes +* +* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. +* +* @param d1 - first input value +* @param d2 - second input value +* @returns boolean indicating whether two arguments are the same +* +* @example +* var x = [ 1.0, 2.0, 3.0 ]; +* var y = [ 1.0, 2.0, 3.0 ]; +* +* var out = isSameArray( x, y ); +* // returns true +* +* @example +* var x = [ 1.0, 2.0, 3.0 ]; +* var y = [ 1.0, 2.0, 4.0 ]; +* +* var out = isSameArray( x, y ); +* // returns false +*/ +declare function isSameDateObject( d1: any, d2: any ): boolean; + + +// EXPORTS // + +export = isSameDateObject; diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts new file mode 100644 index 000000000000..120f221beebd --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts @@ -0,0 +1,36 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import isSameDateObject = require('./index'); + + +// TESTS // + +// The function returns a boolean... +{ + isSameDateObject(new Date(), new Date()); // $ExpectType boolean + isSameDateObject(null, null); // $ExpectType boolean + isSameDateObject('beep', 'boop'); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + isSameDateObject(); // $ExpectError + isSameDateObject(new Date()); // $ExpectError + isSameDateObject('beep', 'beep', new Date()); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js new file mode 100644 index 000000000000..d2b1c9fca153 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var isSameDateObject = require( './../lib' ); + +var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + +var bool = isSameDateObject( d1, d2 ); +console.log( bool ); +// => true + +d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +d2 = new Date(2024, 11, 31, 23, 59, 59, 78); + +bool = isSameDateObject( d1, d2 ); +console.log( bool ); +// => false + +d1 = new Date(); // Current date and time +d2 = new Date("2024-12-31T23:59:59.999Z"); // Date and time specified in ISO 8601 format + +var bool1 = isSameDateObject(d1, d2); +console.log(bool1); +// => false + +var d3 = new Date(2024, 11, 31); // Date specified using year, month, and day +var d4 = new Date("December 31, 2024 23:59:59"); // Date and time specified in a readable format + +var bool2 = isSameDateObject(d1, d3); +console.log(bool2); +// => false + +var bool3 = isSameDateObject(d2, d4); +console.log(bool3); +// => true diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js new file mode 100644 index 000000000000..469280873e23 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js @@ -0,0 +1,52 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Test if two arguments are both date objects and resolve to the same timestamp. +* +* @module @stdlib/assert/is-same-date-object +* +* @example +* var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); +* +* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +* +* var bool = isSameDateObject( d1, d2 ); +* // returns true + +* @example +* var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); +* +* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +* +* var bool = isSameDateObject( d1, d2 ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js new file mode 100644 index 000000000000..0f5ab4148d5e --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + + +'use strict'; + +// MODULES // + +var isDateObject = require( '@stdlib/assert/is-date-object' ); + + +// MAIN // + +/** +* Tests if two arguments are both Date objects and resolve to the same timestamp. +* +* @param {*} d1 - first value +* @param {*} d2 - second value +* @returns {boolean} boolean result +* +* @example +* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var bool = isSameDateObject( d1, d2 ); +* // returns true + +* @example +* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +* var bool = isSameDateObject( d1, d2 ); +* // returns false +*/ +function isSameDateObject( d1, d2 ) { + if ( !isDateObject(d1) || !isDateObject(d2) ) { + return false; + } + + return d1.getTime() === d2.getTime(); + +} + + +// EXPORTS // + +module.exports = isSameDateObject; + diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json new file mode 100644 index 000000000000..31dbaf0ed74e --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json @@ -0,0 +1,78 @@ +{ + "name": "@stdlib/assert/is-same-date-object", + "version": "0.0.0", + "description": "Test if two arguments are both Date objects and resolve to the same timestamp.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdassert", + "assertion", + "assert", + "utilities", + "utility", + "utils", + "util", + "equal", + "same", + "strict", + "is", + "issame", + "issamevalue", + "isequal", + "isstrictequal", + "type", + "check", + "valid", + "validate", + "test", + "typed", + "array", + "generic" + ] + } + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js new file mode 100644 index 000000000000..3e73cf69cea9 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js @@ -0,0 +1,71 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameDateObject = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof isSameDateObject, 'function', 'main export is a function' ); + t.end(); +}); + + +tape('the function returns `true` if provided 2 Date objects resolve to the same timestamp', function test( t ) { + var d1 + var d2 + + d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + t.strictEqual( isSameDateObject( d1, d1 ), true, 'returns expected value' ); + + d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + d3 = new Date(2024, 11, 31, 23, 59, 59, 999); + t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); + + d1 = new Date("December 31, 2024 23:59:59"); + d2 = new Date("2024-12-31T23:59:59.999Z"); + t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); + + t.end(); +}); + +tape('the function returns `false` if provided 2 Date objects do not resolve to the same timestamp', function test( t ) { + var d1 + var d2 + + d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + d2 = new Date(2024, 11, 31, 23, 59, 59, 78); + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + d1 = new Date(); + d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + d1 = new Date(2024, 11, 31); + d2 = new Date(2024, 11, 30); + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + t.end(); +}); From d184b02b76be24cd96b007bfeddf75c36d046326 Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Thu, 22 Feb 2024 15:07:38 +0530 Subject: [PATCH 02/22] feat(@stdlib/assert): add isSameDateObject function, closes 1337 --- .../assert/is-same-date-object/README.md | 9 +++-- .../is-same-date-object/examples/index.js | 4 +-- .../assert/is-same-date-object/test/test.js | 35 +++++++++---------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md index c5a5f48c2d22..7071211b23bd 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md @@ -42,7 +42,9 @@ var bool = isSameDateObject( d1, d2 ); bool = isSameDateObject( d1, new Date(2023, 11, 31, 23, 59, 59, 78)); // returns false + ``` + @@ -70,13 +72,13 @@ bool = isSameDateObject( d1, d2 ); // returns false d1 = new Date(); // Current date and time -d2 = new Date("2024-12-31T23:59:59.999Z"); // Date and time specified in ISO 8601 format +d2 = new Date('2024-12-31T23:59:59.999'); // Date and time specified in ISO 8601 format bool = isSameDateObject(d1, d2); // returns false var d3 = new Date(2024, 11, 31); // Date specified using year, month, and day -var d4 = new Date("December 31, 2024 23:59:59"); // Date and time specified in a readable format +var d4 = new Date('December 31, 2024 23:59:59:999'); // Date and time specified in a readable format bool = isSameDateObject(d1, d3); // returns false @@ -87,4 +89,5 @@ bool = isSameDateObject(d2, d4); - \ No newline at end of file + + diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index d2b1c9fca153..08eb40bdbfb4 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -35,14 +35,14 @@ console.log( bool ); // => false d1 = new Date(); // Current date and time -d2 = new Date("2024-12-31T23:59:59.999Z"); // Date and time specified in ISO 8601 format +d2 = new Date('2024-12-31T23:59:59.999'); // Date and time specified in ISO 8601 format var bool1 = isSameDateObject(d1, d2); console.log(bool1); // => false var d3 = new Date(2024, 11, 31); // Date specified using year, month, and day -var d4 = new Date("December 31, 2024 23:59:59"); // Date and time specified in a readable format +var d4 = new Date('December 31, 2024 23:59:59:999'); // Date and time specified in a readable format var bool2 = isSameDateObject(d1, d3); console.log(bool2); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js index 3e73cf69cea9..cebb3a9f3e42 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js @@ -32,40 +32,39 @@ tape( 'main export is a function', function test( t ) { t.end(); }); - tape('the function returns `true` if provided 2 Date objects resolve to the same timestamp', function test( t ) { - var d1 - var d2 + var d1; + var d2; d1 = new Date(2024, 11, 31, 23, 59, 59, 999); t.strictEqual( isSameDateObject( d1, d1 ), true, 'returns expected value' ); d1 = new Date(2024, 11, 31, 23, 59, 59, 999); - d3 = new Date(2024, 11, 31, 23, 59, 59, 999); + d2 = new Date(2024, 11, 31, 23, 59, 59, 999); t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); - d1 = new Date("December 31, 2024 23:59:59"); - d2 = new Date("2024-12-31T23:59:59.999Z"); + d1 = new Date('December 31, 2024 23:59:59:999'); + d2 = new Date('2024-12-31T23:59:59.999'); t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); t.end(); }); tape('the function returns `false` if provided 2 Date objects do not resolve to the same timestamp', function test( t ) { - var d1 - var d2 + var d1; + var d2; - d1 = new Date(2024, 11, 31, 23, 59, 59, 999); - d2 = new Date(2024, 11, 31, 23, 59, 59, 78); - t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + d2 = new Date(2024, 11, 31, 23, 59, 59, 78); + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); - d1 = new Date(); - d2 = new Date(2024, 11, 31, 23, 59, 59, 999); - t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + d1 = new Date(); + d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); - d1 = new Date(2024, 11, 31); - d2 = new Date(2024, 11, 30); - t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + d1 = new Date(2024, 11, 31); + d2 = new Date(2024, 11, 30); + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); - t.end(); + t.end(); }); From 4e840f0390b6bf1865ff716dd6b0e2f2722b58b5 Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Thu, 22 Feb 2024 15:53:57 +0530 Subject: [PATCH 03/22] docs(@stdlib/assert/is-same-date-object): update documentation in docs/types/index.d.ts --- .../is-same-date-object/docs/types/index.d.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts index 57a96d32c2ed..63083a7f44a6 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts @@ -19,28 +19,25 @@ // TypeScript Version: 4.1 /** -* Tests if two arguments are both generic arrays and have the same values. +* Tests if two arguments are both Date Objects and resolve to the same timestamp. * -* ## Notes -* -* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. * * @param d1 - first input value * @param d2 - second input value * @returns boolean indicating whether two arguments are the same * * @example -* var x = [ 1.0, 2.0, 3.0 ]; -* var y = [ 1.0, 2.0, 3.0 ]; +* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); * -* var out = isSameArray( x, y ); +* var bool = isSameDateObject( d1, d2 ); * // returns true -* + * @example -* var x = [ 1.0, 2.0, 3.0 ]; -* var y = [ 1.0, 2.0, 4.0 ]; +* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); * -* var out = isSameArray( x, y ); +* var bool = isSameDateObject( d1, d2 ); * // returns false */ declare function isSameDateObject( d1: any, d2: any ): boolean; From 55e77d3136866fd8689e922b2e0011ad9d984fb3 Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Thu, 22 Feb 2024 15:55:38 +0530 Subject: [PATCH 04/22] docs(@stdlib/assert/is-same-date-object): update documentation in docs/types/index.d.ts --- .../@stdlib/assert/is-same-date-object/docs/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts index 63083a7f44a6..0a6fce6cac1e 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts @@ -24,7 +24,7 @@ * * @param d1 - first input value * @param d2 - second input value -* @returns boolean indicating whether two arguments are the same +* @returns boolean indicating whether two arguments resolve to the same timestamp * * @example * var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); From b690edf4be7bf53a82b040b3d903c184b9499209 Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Fri, 23 Feb 2024 18:17:30 +0530 Subject: [PATCH 05/22] feat(@stdlib/assert): add isDateObject function,requested changes,#1337 --- .../assert/is-same-date-object/README.md | 30 ++++++------- .../benchmark/benchmark.length.js | 44 ++++++++++--------- .../assert/is-same-date-object/docs/repl.txt | 23 ++++++---- .../is-same-date-object/docs/types/index.d.ts | 4 +- .../is-same-date-object/docs/types/test.ts | 14 +++--- .../is-same-date-object/examples/index.js | 24 +++++----- .../assert/is-same-date-object/lib/index.js | 13 +++--- .../assert/is-same-date-object/lib/main.js | 28 ++++++------ .../assert/is-same-date-object/package.json | 2 +- .../assert/is-same-date-object/test/test.js | 24 +++++----- 10 files changed, 106 insertions(+), 100 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md index 7071211b23bd..e1f795361fd8 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md @@ -20,7 +20,7 @@ limitations under the License. # isSameDateObject -> Test if two arguments are both Date objects and represent the same date object +> Test if two arguments are both Date objects corresponding to the same date and time.
@@ -32,15 +32,15 @@ var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); #### isSameDateObject( d1 , d2 ) -Tests if two arguments are both valid date objects and both resolve to the same timestamp. +Tests if two arguments are both Date objects corresponding to the same date and time. ```javascript -var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); var bool = isSameDateObject( d1, d2 ); // returns true -bool = isSameDateObject( d1, new Date(2023, 11, 31, 23, 59, 59, 78)); +bool = isSameDateObject( d1, new Date( 2023, 11, 31, 23, 59, 59, 78 )); // returns false ``` @@ -59,31 +59,31 @@ bool = isSameDateObject( d1, new Date(2023, 11, 31, 23, 59, 59, 78)); ```javascript var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); -var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); var bool = isSameDateObject( d1, d2 ); // returns true -d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); bool = isSameDateObject( d1, d2 ); // returns false d1 = new Date(); // Current date and time -d2 = new Date('2024-12-31T23:59:59.999'); // Date and time specified in ISO 8601 format +d2 = new Date( '2024-12-31T23:59:59.999' ); // Date and time specified in ISO 8601 format -bool = isSameDateObject(d1, d2); +bool = isSameDateObject( d1, d2 ); // returns false -var d3 = new Date(2024, 11, 31); // Date specified using year, month, and day -var d4 = new Date('December 31, 2024 23:59:59:999'); // Date and time specified in a readable format +var d3 = new Date( 2024, 11, 31 ); // Date specified using year, month, and day +var d4 = new Date( 'December 31, 2024 23:59:59:999' ); // Date and time specified in a readable format -bool = isSameDateObject(d1, d3); +bool = isSameDateObject( d1, d3 ); // returns false -bool = isSameDateObject(d2, d4); +bool = isSameDateObject( d2, d4 ); // returns true ``` diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js index 220dbc3b5da1..7e21b50fc88a 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js @@ -20,29 +20,31 @@ // MODULES // -const bench = require('@stdlib/bench'); -var pkg = require( './../package.json' ).name; +var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var pkg = require( './../package.json' ).name; var isSameDateObject = require( './../lib' ); -//FUNCTIONS // -bench('isSameDateObject', function benchmark(b) { - var date1 = new Date(); - var date2 = new Date(); - var bool; - b.tic(); - for (var i = 0; i < b.iterations; i++) { - date2.setMilliseconds(i); // Change the date slightly each iteration - bool = isSameDateObject(date1, date2); - if (typeof bool !== 'boolean') { - b.fail('should return a boolean'); - } - } - b.toc(); - if (!isBoolean(bool)) { - b.fail('should return a boolean'); - } - b.pass('benchmark finished'); - b.end(); +// FUNCTIONS // + +bench( pkg + '', function benchmark( b ) { + var date1 = new Date(); + var date2 = new Date(); + var bool; + var i; + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + date2.setMilliseconds( i ); // Change the date slightly each iteration + bool = isSameDateObject( date1, date2 ); + if ( typeof bool !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean(bool) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); }); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index 830bf69417a7..b9f5391a39a7 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -1,30 +1,35 @@ {{alias}}( d1, d2 ) - Tests if two arguments are both Date objects and resolve to the same timestamp. + Tests if two arguments are both Date objects corresponding + to the same date and time. Parameters ---------- d1:any First input value. + d2:any Second input value. Returns ------- bool: boolean - Boolean indicating whether two arguments are both Date objects and resolve to the same timestamp + Boolean indicating whether both Date objects correspond + to the same date and time. Examples -------- - >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); - >var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); - >var bool = {{alias}}( d1, d2 ); + >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999) + >var d2 = new Date(2024, 11, 31, 23, 59, 59, 999) + >var bool = {{alias}}( d1, d2 ) true - >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); - >var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); - >var bool = {{alias}}( d1, d2 ); + >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999) + >var d2 = new Date(2024, 11, 31, 23, 59, 59, 78) + >var bool = {{alias}}( d1, d2 ) false + See Also - -------- \ No newline at end of file + -------- + diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts index 0a6fce6cac1e..32e3bbd6abe2 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts @@ -19,12 +19,12 @@ // TypeScript Version: 4.1 /** -* Tests if two arguments are both Date Objects and resolve to the same timestamp. +* Tests if two arguments are both Date objects corresponding to the same date and time. * * * @param d1 - first input value * @param d2 - second input value -* @returns boolean indicating whether two arguments resolve to the same timestamp +* @returns boolean indicating whether both are Date objects corresponding to the same date and time. * * @example * var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts index 120f221beebd..0bc2ed487ab6 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/test.ts @@ -16,21 +16,21 @@ * limitations under the License. */ -import isSameDateObject = require('./index'); +import isSameDateObject = require( './index' ); // TESTS // // The function returns a boolean... { - isSameDateObject(new Date(), new Date()); // $ExpectType boolean - isSameDateObject(null, null); // $ExpectType boolean - isSameDateObject('beep', 'boop'); // $ExpectType boolean + isSameDateObject( new Date(), new Date() ); // $ExpectType boolean + isSameDateObject( null, null ); // $ExpectType boolean + isSameDateObject( 'beep', 'boop' ); // $ExpectType boolean } // The compiler throws an error if the function is provided an unsupported number of arguments... { - isSameDateObject(); // $ExpectError - isSameDateObject(new Date()); // $ExpectError - isSameDateObject('beep', 'beep', new Date()); // $ExpectError + isSameDateObject(); // $ExpectError + isSameDateObject( new Date() ); // $ExpectError + isSameDateObject( 'beep', 'beep', new Date() ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index 08eb40bdbfb4..52d830fd3a51 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -20,34 +20,34 @@ var isSameDateObject = require( './../lib' ); -var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); var bool = isSameDateObject( d1, d2 ); console.log( bool ); // => true -d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); bool = isSameDateObject( d1, d2 ); console.log( bool ); // => false d1 = new Date(); // Current date and time -d2 = new Date('2024-12-31T23:59:59.999'); // Date and time specified in ISO 8601 format +d2 = new Date( '2024-12-31T23:59:59.999' ); // Date and time specified in ISO 8601 format -var bool1 = isSameDateObject(d1, d2); +var bool1 = isSameDateObject( d1, d2 ); console.log(bool1); // => false -var d3 = new Date(2024, 11, 31); // Date specified using year, month, and day -var d4 = new Date('December 31, 2024 23:59:59:999'); // Date and time specified in a readable format +var d3 = new Date( 2024, 11, 31 ); // Date specified using year, month, and day +var d4 = new Date( 'December 31, 2024 23:59:59:999' ); // Date and time specified in a readable format -var bool2 = isSameDateObject(d1, d3); -console.log(bool2); +var bool2 = isSameDateObject( d1, d3 ); +console.log( bool2 ); // => false -var bool3 = isSameDateObject(d2, d4); -console.log(bool3); +var bool3 = isSameDateObject( d2, d4 ); +console.log( bool3 ); // => true diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js index 469280873e23..e85c5b474557 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js @@ -19,24 +19,25 @@ 'use strict'; /** -* Test if two arguments are both date objects and resolve to the same timestamp. +* Test if two arguments are both Date objects corresponding to the same date and time. * * @module @stdlib/assert/is-same-date-object * * @example * var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); * -* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -* var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +* var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); * * var bool = isSameDateObject( d1, d2 ); * // returns true +* * @example * var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); * -* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -* var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +* var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +* var d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); * * var bool = isSameDateObject( d1, d2 ); * // returns false @@ -49,4 +50,4 @@ var main = require( './main.js' ); // EXPORTS // -module.exports = main; \ No newline at end of file +module.exports = main; diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js index 0f5ab4148d5e..a37d1cfd2eee 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js @@ -16,7 +16,6 @@ * limitations under the License. */ - 'use strict'; // MODULES // @@ -27,35 +26,34 @@ var isDateObject = require( '@stdlib/assert/is-date-object' ); // MAIN // /** -* Tests if two arguments are both Date objects and resolve to the same timestamp. +* Tests if two arguments are both Date objects corresponding to the same date and time. * -* @param {*} d1 - first value -* @param {*} d2 - second value -* @returns {boolean} boolean result +* @param {*} d1 - first value +* @param {*} d2 - second value +* @returns {boolean} boolean result * * @example -* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -* var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +* var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); * var bool = isSameDateObject( d1, d2 ); * // returns true +* * @example -* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -* var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +* var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +* var d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); * var bool = isSameDateObject( d1, d2 ); * // returns false */ function isSameDateObject( d1, d2 ) { - if ( !isDateObject(d1) || !isDateObject(d2) ) { - return false; - } + if ( !isDateObject( d1 ) || !isDateObject( d2 ) ) { + return false; + } - return d1.getTime() === d2.getTime(); - + return d1.getTime() === d2.getTime(); } // EXPORTS // module.exports = isSameDateObject; - diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json index 31dbaf0ed74e..4494baf77337 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/assert/is-same-date-object", "version": "0.0.0", - "description": "Test if two arguments are both Date objects and resolve to the same timestamp.", + "description": "Test if two arguments are both Date objects corresponding to the same date and time", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js index cebb3a9f3e42..807575f5b169 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js @@ -32,38 +32,38 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape('the function returns `true` if provided 2 Date objects resolve to the same timestamp', function test( t ) { +tape('the function returns `true` if provided 2 Date objects corresponding to the same date and time', function test( t ) { var d1; var d2; - d1 = new Date(2024, 11, 31, 23, 59, 59, 999); + d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); t.strictEqual( isSameDateObject( d1, d1 ), true, 'returns expected value' ); - d1 = new Date(2024, 11, 31, 23, 59, 59, 999); - d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); + d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); - d1 = new Date('December 31, 2024 23:59:59:999'); - d2 = new Date('2024-12-31T23:59:59.999'); + d1 = new Date( 'December 31, 2024 23:59:59:999' ); + d2 = new Date( '2024-12-31T23:59:59.999' ); t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); t.end(); }); -tape('the function returns `false` if provided 2 Date objects do not resolve to the same timestamp', function test( t ) { +tape('the function returns `false` if provided 2 Date objects corresponding to the same date and time', function test( t ) { var d1; var d2; - d1 = new Date(2024, 11, 31, 23, 59, 59, 999); - d2 = new Date(2024, 11, 31, 23, 59, 59, 78); + d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); + d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); d1 = new Date(); - d2 = new Date(2024, 11, 31, 23, 59, 59, 999); + d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); - d1 = new Date(2024, 11, 31); - d2 = new Date(2024, 11, 30); + d1 = new Date( 2024, 11, 31 ); + d2 = new Date( 2024, 11, 30 ); t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); t.end(); From d426b820b878d971fda0f1ee0c1c3d9ded12e83c Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Thu, 29 Feb 2024 17:58:18 +0530 Subject: [PATCH 06/22] feat(@stdlib/assert): add isDateObject function,requested changes,#1337 --- .../assert/is-same-date-object/README.md | 18 +++++++------- .../{benchmark.length.js => benchmark.js} | 20 ++++++++++++---- .../assert/is-same-date-object/docs/repl.txt | 8 +++---- .../is-same-date-object/docs/types/index.d.ts | 13 +++++----- .../assert/is-same-date-object/lib/index.js | 1 - .../assert/is-same-date-object/lib/main.js | 12 ++++------ .../assert/is-same-date-object/test/test.js | 24 +++++++++++++++++-- 7 files changed, 59 insertions(+), 37 deletions(-) rename lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/{benchmark.length.js => benchmark.js} (75%) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md index e1f795361fd8..6cad9be3ac20 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md @@ -20,7 +20,7 @@ limitations under the License. # isSameDateObject -> Test if two arguments are both Date objects corresponding to the same date and time. +> Test if two values are both Date objects corresponding to the same date and time.
@@ -30,9 +30,9 @@ limitations under the License. var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); ``` -#### isSameDateObject( d1 , d2 ) +#### isSameDateObject( d1, d2 ) -Tests if two arguments are both Date objects corresponding to the same date and time. +Tests if two values are both Date objects corresponding to the same date and time. ```javascript var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); @@ -40,16 +40,14 @@ var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); var bool = isSameDateObject( d1, d2 ); // returns true -bool = isSameDateObject( d1, new Date( 2023, 11, 31, 23, 59, 59, 78 )); +bool = isSameDateObject( d1, new Date( 2023, 11, 31, 23, 59, 59, 78 ) ); // returns false - ```
-
## Examples @@ -71,14 +69,14 @@ d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); bool = isSameDateObject( d1, d2 ); // returns false -d1 = new Date(); // Current date and time -d2 = new Date( '2024-12-31T23:59:59.999' ); // Date and time specified in ISO 8601 format +d1 = new Date(); +d2 = new Date( '2024-12-31T23:59:59.999' ); bool = isSameDateObject( d1, d2 ); // returns false -var d3 = new Date( 2024, 11, 31 ); // Date specified using year, month, and day -var d4 = new Date( 'December 31, 2024 23:59:59:999' ); // Date and time specified in a readable format +var d3 = new Date( 2024, 11, 31 ); +var d4 = new Date( 'December 31, 2024 23:59:59:999' ); bool = isSameDateObject( d1, d3 ); // returns false diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js similarity index 75% rename from lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js rename to lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js index 7e21b50fc88a..1f3bd9168d76 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js @@ -22,20 +22,30 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var isSameDateObject = require( './../lib' ); +var pkg = require( '@stdlib/assert/is-same-date-object/package.json' ).name; +var isSameDateObject = require( '@stdlib/assert/is-same-date-object/lib' ); -// FUNCTIONS // +// MAIN // bench( pkg + '', function benchmark( b ) { + var values = [ + '5', + 'Date', + new Date( 'December 31, 2024 23:59:59:999' ), + new Date( '2024-12-31T23:59:59.999' ), + NaN, + true, + false, + null + ]; var date1 = new Date(); - var date2 = new Date(); + var date2; var bool; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - date2.setMilliseconds( i ); // Change the date slightly each iteration + date2 = values[i%values.length]; bool = isSameDateObject( date1, date2 ); if ( typeof bool !== 'boolean' ) { b.fail( 'should return a boolean' ); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index b9f5391a39a7..bbdfed560e4a 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -1,6 +1,6 @@ {{alias}}( d1, d2 ) - Tests if two arguments are both Date objects corresponding + Tests if two values are both Date objects corresponding to the same date and time. Parameters @@ -14,8 +14,8 @@ Returns ------- bool: boolean - Boolean indicating whether both Date objects correspond - to the same date and time. + Boolean indicating whether both values are Date objects + corresponding to the same date and time. Examples -------- @@ -23,13 +23,11 @@ >var d2 = new Date(2024, 11, 31, 23, 59, 59, 999) >var bool = {{alias}}( d1, d2 ) true - >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999) >var d2 = new Date(2024, 11, 31, 23, 59, 59, 78) >var bool = {{alias}}( d1, d2 ) false - See Also -------- diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts index 32e3bbd6abe2..557a16d2e67a 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/types/index.d.ts @@ -19,23 +19,22 @@ // TypeScript Version: 4.1 /** -* Tests if two arguments are both Date objects corresponding to the same date and time. -* +* Tests if two values are both Date objects corresponding to the same date and time. * * @param d1 - first input value * @param d2 - second input value * @returns boolean indicating whether both are Date objects corresponding to the same date and time. * * @example -* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -* var d2 = new Date(2024, 11, 31, 23, 59, 59, 999); +* var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +* var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); * * var bool = isSameDateObject( d1, d2 ); * // returns true - +* * @example -* var d1 = new Date(2024, 11, 31, 23, 59, 59, 999); -* var d2 = new Date(2024, 11, 31, 23, 59, 59, 78); +* var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); +* var d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); * * var bool = isSameDateObject( d1, d2 ); * // returns false diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js index e85c5b474557..8344411ffca0 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/index.js @@ -31,7 +31,6 @@ * * var bool = isSameDateObject( d1, d2 ); * // returns true - * * @example * var isSameDateObject = require( '@stdlib/assert/is-same-date-object' ); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js index a37d1cfd2eee..09968192e934 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js @@ -20,7 +20,7 @@ // MODULES // -var isDateObject = require( '@stdlib/assert/is-date-object' ); +var isDateObject = require('@stdlib/assert/is-date-object'); // MAIN // @@ -37,7 +37,6 @@ var isDateObject = require( '@stdlib/assert/is-date-object' ); * var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); * var bool = isSameDateObject( d1, d2 ); * // returns true - * * @example * var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); @@ -45,12 +44,11 @@ var isDateObject = require( '@stdlib/assert/is-date-object' ); * var bool = isSameDateObject( d1, d2 ); * // returns false */ -function isSameDateObject( d1, d2 ) { - if ( !isDateObject( d1 ) || !isDateObject( d2 ) ) { - return false; +function isSameDateObject(d1, d2) { + if (isDateObject(d1) && isDateObject(d2)) { + return d1.getTime() === d2.getTime(); } - - return d1.getTime() === d2.getTime(); + return false; } diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js index 807575f5b169..0d3069c0d534 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js @@ -32,7 +32,7 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape('the function returns `true` if provided 2 Date objects corresponding to the same date and time', function test( t ) { +tape('the function returns `true` if provided two Date objects corresponding to the same date and time', function test( t ) { var d1; var d2; @@ -50,7 +50,7 @@ tape('the function returns `true` if provided 2 Date objects corresponding to th t.end(); }); -tape('the function returns `false` if provided 2 Date objects corresponding to the same date and time', function test( t ) { +tape('the function returns `false` if not provided two Date objects corresponding to the same date and time', function test( t ) { var d1; var d2; @@ -66,5 +66,25 @@ tape('the function returns `false` if provided 2 Date objects corresponding to t d2 = new Date( 2024, 11, 30 ); t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + d1 = new Date( 2024, 11, 31 ); + d2 = 'string'; + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + d1 = new Date( 2024, 11, 31 ); + d2 = 1; + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + d1 = new Date( 2024, 11, 31 ); + d2 = undefined; + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + d1 = new Date( 2024, 11, 31 ); + d2 = {}; + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + + d1 = new Date( 2024, 11, 31 ); + d2 = []; + t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); + t.end(); }); From 8dfcc54072ff1a2c8a0d2c6705d575ca9623fdcc Mon Sep 17 00:00:00 2001 From: Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:21:35 +0530 Subject: [PATCH 07/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt Co-authored-by: Athan Signed-off-by: Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> --- .../@stdlib/assert/is-same-date-object/docs/repl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index bbdfed560e4a..f078980cf8b7 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -5,7 +5,7 @@ Parameters ---------- - d1:any + d1: any First input value. d2:any From 8c731116e69b5237072c7045c83ad299ebef27b1 Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Fri, 1 Mar 2024 14:26:40 +0530 Subject: [PATCH 08/22] feat(@stdlib/assert): add isDateObject function,requested changes,#1337 --- .../assert/is-same-date-object/benchmark/benchmark.js | 4 ++-- .../@stdlib/assert/is-same-date-object/docs/repl.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js index 1f3bd9168d76..6ac55a9991c7 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js @@ -22,8 +22,8 @@ var bench = require( '@stdlib/bench' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var pkg = require( '@stdlib/assert/is-same-date-object/package.json' ).name; -var isSameDateObject = require( '@stdlib/assert/is-same-date-object/lib' ); +var pkg = require( './../package.json' ).name; +var isSameDateObject = require( './../lib' ); // MAIN // diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index f078980cf8b7..fc4ea71e8253 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -19,12 +19,12 @@ Examples -------- - >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999) - >var d2 = new Date(2024, 11, 31, 23, 59, 59, 999) + >var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ) + >var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ) >var bool = {{alias}}( d1, d2 ) true - >var d1 = new Date(2024, 11, 31, 23, 59, 59, 999) - >var d2 = new Date(2024, 11, 31, 23, 59, 59, 78) + >var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ) + >var d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ) >var bool = {{alias}}( d1, d2 ) false From f1710dd20c5be013b396e3d157a3b5d564173a39 Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Fri, 1 Mar 2024 14:36:52 +0530 Subject: [PATCH 09/22] feat(@stdlib/assert): add isDateObject function,requested changes,#1337 --- .../is-same-date-object/benchmark/benchmark.js | 16 +++++++++------- .../assert/is-same-date-object/lib/main.js | 6 +++--- .../assert/is-same-date-object/package.json | 2 +- .../assert/is-same-date-object/test/test.js | 10 +++++----- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js index 6ac55a9991c7..26336de932f0 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js @@ -29,7 +29,12 @@ var isSameDateObject = require( './../lib' ); // MAIN // bench( pkg + '', function benchmark( b ) { - var values = [ + var values; + var date1; + var date2; + var bool; + var i; + values = [ '5', 'Date', new Date( 'December 31, 2024 23:59:59:999' ), @@ -39,20 +44,17 @@ bench( pkg + '', function benchmark( b ) { false, null ]; - var date1 = new Date(); - var date2; - var bool; - var i; + date1 = new Date(); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - date2 = values[i%values.length]; + date2 = values[ i%values.length ]; bool = isSameDateObject( date1, date2 ); if ( typeof bool !== 'boolean' ) { b.fail( 'should return a boolean' ); } } b.toc(); - if ( !isBoolean(bool) ) { + if ( !isBoolean( bool ) ) { b.fail( 'should return a boolean' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js index 09968192e934..d804d00bcd48 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/lib/main.js @@ -20,7 +20,7 @@ // MODULES // -var isDateObject = require('@stdlib/assert/is-date-object'); +var isDateObject = require( '@stdlib/assert/is-date-object' ); // MAIN // @@ -44,8 +44,8 @@ var isDateObject = require('@stdlib/assert/is-date-object'); * var bool = isSameDateObject( d1, d2 ); * // returns false */ -function isSameDateObject(d1, d2) { - if (isDateObject(d1) && isDateObject(d2)) { +function isSameDateObject( d1, d2 ) { + if ( isDateObject( d1 ) && isDateObject( d2 ) ) { return d1.getTime() === d2.getTime(); } return false; diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json index 4494baf77337..2ad0c7dc87f1 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/assert/is-same-date-object", "version": "0.0.0", - "description": "Test if two arguments are both Date objects corresponding to the same date and time", + "description": "Test if two values are both Date objects corresponding to the same date and time", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js index 0d3069c0d534..1f85c75dca84 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/test/test.js @@ -30,9 +30,9 @@ tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.strictEqual( typeof isSameDateObject, 'function', 'main export is a function' ); t.end(); -}); +} ); -tape('the function returns `true` if provided two Date objects corresponding to the same date and time', function test( t ) { +tape( 'the function returns `true` if provided two Date objects corresponding to the same date and time', function test( t ) { var d1; var d2; @@ -48,9 +48,9 @@ tape('the function returns `true` if provided two Date objects corresponding to t.strictEqual( isSameDateObject( d1, d2 ), true, 'returns expected value' ); t.end(); -}); +} ); -tape('the function returns `false` if not provided two Date objects corresponding to the same date and time', function test( t ) { +tape( 'the function returns `false` if not provided two Date objects corresponding to the same date and time', function test( t ) { var d1; var d2; @@ -87,4 +87,4 @@ tape('the function returns `false` if not provided two Date objects correspondin t.strictEqual( isSameDateObject( d1, d2 ), false, 'returns expected value' ); t.end(); -}); +} ); From bc9877a918cbde192dbee64cf90d94905fcac8c7 Mon Sep 17 00:00:00 2001 From: Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:39:00 +0530 Subject: [PATCH 10/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js Co-authored-by: Athan Signed-off-by: Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> --- .../@stdlib/assert/is-same-date-object/benchmark/benchmark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js index 26336de932f0..3c000a5afc7c 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/benchmark/benchmark.js @@ -28,7 +28,7 @@ var isSameDateObject = require( './../lib' ); // MAIN // -bench( pkg + '', function benchmark( b ) { +bench( pkg, function benchmark( b ) { var values; var date1; var date2; From 59fb3c9f27e498eb7bab3397d17edbae1559d399 Mon Sep 17 00:00:00 2001 From: Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:43:41 +0530 Subject: [PATCH 11/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt Co-authored-by: Athan Signed-off-by: Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> --- .../@stdlib/assert/is-same-date-object/docs/repl.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index fc4ea71e8253..a7862cbf4c0e 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -8,7 +8,8 @@ d1: any First input value. - d2:any + + d2: any Second input value. Returns From bb1a8ae010caba26dc21dbefaa49e72c04a8f6eb Mon Sep 17 00:00:00 2001 From: adityacodes30 Date: Fri, 1 Mar 2024 14:44:53 +0530 Subject: [PATCH 12/22] feat(@stdlib/assert): add isDateObject function,requested changes,#1337 --- lib/node_modules/@stdlib/assert/is-same-date-object/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md index 6cad9be3ac20..b4bc4d707c56 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/README.md @@ -20,7 +20,7 @@ limitations under the License. # isSameDateObject -> Test if two values are both Date objects corresponding to the same date and time. +> Test if two values are [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) objects corresponding to the same date and time.
From 34d7024e90bd3aa40579faabc6b00aa66f45d358 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:09:35 -0500 Subject: [PATCH 13/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/package.json Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json index 2ad0c7dc87f1..cf186f432fdb 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json @@ -70,8 +70,8 @@ "valid", "validate", "test", - "typed", - "array", + "date", + "time", "generic" ] } From 7445142e16faa48036f6630a59c8ecc2b8d7265d Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:09:42 -0500 Subject: [PATCH 14/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/docs/repl.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index a7862cbf4c0e..a8090ad5ac23 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -20,13 +20,13 @@ Examples -------- - >var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ) - >var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ) - >var bool = {{alias}}( d1, d2 ) + > var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); + > var d2 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); + > var bool = {{alias}}( d1, d2 ) true - >var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ) - >var d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ) - >var bool = {{alias}}( d1, d2 ) + > var d1 = new Date( 2024, 11, 31, 23, 59, 59, 999 ); + > var d2 = new Date( 2024, 11, 31, 23, 59, 59, 78 ); + > var bool = {{alias}}( d1, d2 ) false See Also From 0cefc0e0306ae97ce03bbf10329e8b4398774daf Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:10:01 -0500 Subject: [PATCH 15/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/docs/repl.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt index a8090ad5ac23..e5078d774774 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/docs/repl.txt @@ -7,8 +7,6 @@ ---------- d1: any First input value. - - d2: any Second input value. From 063b38e4b9b8313573e68a226534fd8ba41be993 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:10:35 -0500 Subject: [PATCH 16/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js Signed-off-by: Philipp Burckhardt --- .../assert/is-same-date-object/examples/index.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index 52d830fd3a51..c41c0327a391 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -34,15 +34,13 @@ bool = isSameDateObject( d1, d2 ); console.log( bool ); // => false -d1 = new Date(); // Current date and time -d2 = new Date( '2024-12-31T23:59:59.999' ); // Date and time specified in ISO 8601 format - -var bool1 = isSameDateObject( d1, d2 ); -console.log(bool1); -// => false +d1 = new Date(); +d2 = new Date( '2024-12-31T23:59:59.999' ); +bool = isSameDateObject( d1, d2 ); +// returns false -var d3 = new Date( 2024, 11, 31 ); // Date specified using year, month, and day -var d4 = new Date( 'December 31, 2024 23:59:59:999' ); // Date and time specified in a readable format +var d3 = new Date( 2024, 11, 31 ); +var d4 = new Date( 'December 31, 2024 23:59:59:999' ); var bool2 = isSameDateObject( d1, d3 ); console.log( bool2 ); From fdf2ab49c7bf27900accdc029c30db5a6448d263 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:10:41 -0500 Subject: [PATCH 17/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index c41c0327a391..42956362c3e1 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -43,7 +43,7 @@ var d3 = new Date( 2024, 11, 31 ); var d4 = new Date( 'December 31, 2024 23:59:59:999' ); var bool2 = isSameDateObject( d1, d3 ); -console.log( bool2 ); +console.log( bool ); // => false var bool3 = isSameDateObject( d2, d4 ); From b0cda067c834e9539630b6107683bdac710a0073 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:10:46 -0500 Subject: [PATCH 18/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index 42956362c3e1..1b6a6d583903 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -42,7 +42,7 @@ bool = isSameDateObject( d1, d2 ); var d3 = new Date( 2024, 11, 31 ); var d4 = new Date( 'December 31, 2024 23:59:59:999' ); -var bool2 = isSameDateObject( d1, d3 ); +bool = isSameDateObject( d1, d3 ); console.log( bool ); // => false From 50a518969995c31ddc2658baf7cd7f46717f72f9 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:10:52 -0500 Subject: [PATCH 19/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index 1b6a6d583903..320f27cbdcba 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -46,6 +46,6 @@ bool = isSameDateObject( d1, d3 ); console.log( bool ); // => false -var bool3 = isSameDateObject( d2, d4 ); +var bool = isSameDateObject( d2, d4 ); console.log( bool3 ); // => true From 9aadb600e443f775b627f5368137a3b17084e996 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:10:57 -0500 Subject: [PATCH 20/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index 320f27cbdcba..24c4ce840308 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -47,5 +47,5 @@ console.log( bool ); // => false var bool = isSameDateObject( d2, d4 ); -console.log( bool3 ); +console.log( bool ); // => true From d38aa8b9fce67779247803193e640abb58d76c74 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 09:11:22 -0500 Subject: [PATCH 21/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/package.json Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json index cf186f432fdb..b7a1efe49d2b 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/package.json +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/assert/is-same-date-object", "version": "0.0.0", - "description": "Test if two values are both Date objects corresponding to the same date and time", + "description": "Test if two values are both Date objects corresponding to the same date and time.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 6cda4aae84dc65279f4334f9207b3a11f73910ff Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 3 Mar 2024 16:09:30 -0500 Subject: [PATCH 22/22] Update lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js Signed-off-by: Philipp Burckhardt --- .../@stdlib/assert/is-same-date-object/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js index 24c4ce840308..000083c80701 100644 --- a/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-same-date-object/examples/index.js @@ -46,6 +46,6 @@ bool = isSameDateObject( d1, d3 ); console.log( bool ); // => false -var bool = isSameDateObject( d2, d4 ); +bool = isSameDateObject( d2, d4 ); console.log( bool ); // => true