@eslint/object-schema
Advanced tools
+19
-11
@@ -17,5 +17,7 @@ 'use strict'; | ||
| * Merges two keys by overwriting the first with the second. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue2} The second value. | ||
| */ | ||
@@ -29,5 +31,7 @@ static overwrite(value1, value2) { | ||
| * second is defined. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value if it is defined. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue1 | TValue2} The second value if it is defined. | ||
| */ | ||
@@ -44,5 +48,7 @@ static replace(value1, value2) { | ||
| * Merges two properties by assigning properties from the second to the first. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} A new object containing properties from both value1 and | ||
| * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key. | ||
| * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and | ||
| * value2. | ||
@@ -295,3 +301,3 @@ */ | ||
| /** | ||
| * Separately track any keys that are required for faster validtion. | ||
| * Separately track any keys that are required for faster validation. | ||
| * @type {Map<string, PropertyDefinition>} | ||
@@ -429,3 +435,5 @@ */ | ||
| // validate existing keys | ||
| const definition = this.#definitions.get(key); | ||
| const definition = /** @type {PropertyDefinition} */ ( | ||
| this.#definitions.get(key) | ||
| ); // `definition` is guaranteed to exist since we check with `hasKey()` above. | ||
@@ -432,0 +440,0 @@ // first check to see if any other keys are required |
+18
-12
@@ -14,23 +14,29 @@ export type BuiltInMergeStrategy = $typests.BuiltInMergeStrategy; | ||
| * Merges two keys by overwriting the first with the second. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue2} The second value. | ||
| */ | ||
| static overwrite(value1: any, value2: any): any; | ||
| static overwrite<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue2; | ||
| /** | ||
| * Merges two keys by replacing the first with the second only if the | ||
| * second is defined. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value if it is defined. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue1 | TValue2} The second value if it is defined. | ||
| */ | ||
| static replace(value1: any, value2: any): any; | ||
| static replace<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue1 | TValue2; | ||
| /** | ||
| * Merges two properties by assigning properties from the second to the first. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} A new object containing properties from both value1 and | ||
| * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key. | ||
| * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and | ||
| * value2. | ||
| */ | ||
| static assign(value1: any, value2: any): any; | ||
| static assign<TValue1 extends Record<string | number | symbol, unknown> | undefined, TValue2 extends Record<string | number | symbol, unknown>>(value1: TValue1, value2: TValue2): Omit<TValue1, keyof TValue2> & TValue2; | ||
| } | ||
@@ -37,0 +43,0 @@ /** |
+18
-12
@@ -14,23 +14,29 @@ export type BuiltInMergeStrategy = $typests.BuiltInMergeStrategy; | ||
| * Merges two keys by overwriting the first with the second. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue2} The second value. | ||
| */ | ||
| static overwrite(value1: any, value2: any): any; | ||
| static overwrite<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue2; | ||
| /** | ||
| * Merges two keys by replacing the first with the second only if the | ||
| * second is defined. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value if it is defined. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue1 | TValue2} The second value if it is defined. | ||
| */ | ||
| static replace(value1: any, value2: any): any; | ||
| static replace<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue1 | TValue2; | ||
| /** | ||
| * Merges two properties by assigning properties from the second to the first. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} A new object containing properties from both value1 and | ||
| * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key. | ||
| * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and | ||
| * value2. | ||
| */ | ||
| static assign(value1: any, value2: any): any; | ||
| static assign<TValue1 extends Record<string | number | symbol, unknown> | undefined, TValue2 extends Record<string | number | symbol, unknown>>(value1: TValue1, value2: TValue2): Omit<TValue1, keyof TValue2> & TValue2; | ||
| } | ||
@@ -37,0 +43,0 @@ /** |
+19
-11
@@ -16,5 +16,7 @@ // @ts-self-types="./index.d.ts" | ||
| * Merges two keys by overwriting the first with the second. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue2} The second value. | ||
| */ | ||
@@ -28,5 +30,7 @@ static overwrite(value1, value2) { | ||
| * second is defined. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} The second value if it is defined. | ||
| * @template TValue1 The type of the value from the first object key. | ||
| * @template TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {TValue1 | TValue2} The second value if it is defined. | ||
| */ | ||
@@ -43,5 +47,7 @@ static replace(value1, value2) { | ||
| * Merges two properties by assigning properties from the second to the first. | ||
| * @param {*} value1 The value from the first object key. | ||
| * @param {*} value2 The value from the second object key. | ||
| * @returns {*} A new object containing properties from both value1 and | ||
| * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key. | ||
| * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key. | ||
| * @param {TValue1} value1 The value from the first object key. | ||
| * @param {TValue2} value2 The value from the second object key. | ||
| * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and | ||
| * value2. | ||
@@ -294,3 +300,3 @@ */ | ||
| /** | ||
| * Separately track any keys that are required for faster validtion. | ||
| * Separately track any keys that are required for faster validation. | ||
| * @type {Map<string, PropertyDefinition>} | ||
@@ -428,3 +434,5 @@ */ | ||
| // validate existing keys | ||
| const definition = this.#definitions.get(key); | ||
| const definition = /** @type {PropertyDefinition} */ ( | ||
| this.#definitions.get(key) | ||
| ); // `definition` is guaranteed to exist since we check with `hasKey()` above. | ||
@@ -431,0 +439,0 @@ // first check to see if any other keys are required |
+1
-1
| { | ||
| "name": "@eslint/object-schema", | ||
| "version": "3.0.1", | ||
| "version": "3.0.2", | ||
| "description": "An object schema merger/validator", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+1
-1
@@ -238,3 +238,3 @@ # ObjectSchema Package | ||
| <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3> | ||
| <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3> | ||
| <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3> | ||
| <p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p> | ||
@@ -241,0 +241,0 @@ <h3>Technology Sponsors</h3> |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
61354
5.37%1054
2.13%