From a5527849cfcedf1c395dceeca048fff546edb7ef Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Fri, 14 Mar 2025 00:53:56 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72172=20[bcryp?= =?UTF-8?q?tjs]=20Remove=20types=20by=20@wojtekmaj?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notNeededPackages.json | 4 + types/bcryptjs/.eslintrc.json | 5 -- types/bcryptjs/.npmignore | 5 -- types/bcryptjs/bcryptjs-tests.ts | 70 ----------------- types/bcryptjs/index.d.ts | 124 ------------------------------- types/bcryptjs/package.json | 25 ------- types/bcryptjs/tsconfig.json | 19 ----- 7 files changed, 4 insertions(+), 248 deletions(-) delete mode 100644 types/bcryptjs/.eslintrc.json delete mode 100644 types/bcryptjs/.npmignore delete mode 100644 types/bcryptjs/bcryptjs-tests.ts delete mode 100644 types/bcryptjs/index.d.ts delete mode 100644 types/bcryptjs/package.json delete mode 100644 types/bcryptjs/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 9e19328899ff35..7e2ce7551682e7 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -416,6 +416,10 @@ "libraryName": "bcp-47-match", "asOfVersion": "2.0.0" }, + "bcryptjs": { + "libraryName": "bcryptjs", + "asOfVersion": "3.0.0" + }, "bech32": { "libraryName": "bech32", "asOfVersion": "1.1.4" diff --git a/types/bcryptjs/.eslintrc.json b/types/bcryptjs/.eslintrc.json deleted file mode 100644 index 5805df8e2413ed..00000000000000 --- a/types/bcryptjs/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "@definitelytyped/strict-export-declare-modifiers": "off" - } -} diff --git a/types/bcryptjs/.npmignore b/types/bcryptjs/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/bcryptjs/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/bcryptjs/bcryptjs-tests.ts b/types/bcryptjs/bcryptjs-tests.ts deleted file mode 100644 index e6c0f71cb80c16..00000000000000 --- a/types/bcryptjs/bcryptjs-tests.ts +++ /dev/null @@ -1,70 +0,0 @@ -import bcryptjs = require("bcryptjs"); - -let str: string; -let num: number; -let bool: boolean; -let arr: number[]; -let error: Error; - -str = bcryptjs.genSaltSync(); -str = bcryptjs.genSaltSync(10); - -bcryptjs.genSalt((err: Error | null, salt: string) => { - str = salt; -}); -bcryptjs.genSalt(10, (err: Error | null, salt: string) => { - str = salt; -}); -bcryptjs.genSalt() - .then(salt => str = salt) - .catch(err => error = err); -bcryptjs.genSalt(10) - .then(salt => str = salt) - .catch(err => error = err); - -str = bcryptjs.hashSync("string"); -str = bcryptjs.hashSync("string", 10); -str = bcryptjs.hashSync("string", "salt"); - -bcryptjs.hash("string", 10, (err: Error | null, hash: string) => { - str = hash; -}); -bcryptjs.hash("string", 10, (err: Error | null, hash: string) => { - str = hash; -}, (percent: number) => { - num = percent; -}); -bcryptjs.hash("string", 10) - .then(salt => str = salt) - .catch(err => error = err); - -bcryptjs.hash("string", "salt", (err: Error | null, hash: string) => { - str = hash; -}); -bcryptjs.hash("string", "salt", (err: Error | null, hash: string) => { - str = hash; -}, (percent: number) => { - num = percent; -}); - -bool = bcryptjs.compareSync("string1", "string2"); - -bcryptjs.compare("string1", "string2", (err: Error | null, success: boolean) => { - bool = success; -}); -bcryptjs.compare("string1", "string2", (err: Error | null, success: boolean) => { - bool = success; -}, (percent: number) => { - num = percent; -}); -bcryptjs.compare("string1", "string2") - .then(success => bool = success) - .catch(err => error = err); - -num = bcryptjs.getRounds("string"); - -str = bcryptjs.getSalt("string"); - -str = bcryptjs.encodeBase64([1, 2, 3, 4, 5], 5); - -arr = bcryptjs.decodeBase64("string", 5); diff --git a/types/bcryptjs/index.d.ts b/types/bcryptjs/index.d.ts deleted file mode 100644 index 961680e99d1d5e..00000000000000 --- a/types/bcryptjs/index.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available. - * Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly! - * @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values. - */ -export declare function setRandomFallback(random: (random: number) => number[]): void; - -/** - * Synchronously generates a salt. - * @param rounds Number of rounds to use, defaults to 10 if omitted - * @return Resulting salt - * @throws If a random fallback is required but not set - */ -export declare function genSaltSync(rounds?: number): string; - -/** - * Asynchronously generates a salt. - * @param rounds Number of rounds to use, defaults to 10 if omitted - * @return Promise with resulting salt, if callback has been omitted - */ -export declare function genSalt(rounds?: number): Promise; - -/** - * Asynchronously generates a salt. - * @param callback Callback receiving the error, if any, and the resulting salt - */ -export declare function genSalt(callback: (err: Error | null, salt: string) => void): void; - -/** - * Asynchronously generates a salt. - * @param rounds Number of rounds to use, defaults to 10 if omitted - * @param callback Callback receiving the error, if any, and the resulting salt - */ -export declare function genSalt(rounds: number, callback: (err: Error | null, salt: string) => void): void; - -/** - * Synchronously generates a hash for the given string. - * @param s String to hash - * @param salt Salt length to generate or salt to use, default to 10 - * @return Resulting hash - */ -export declare function hashSync(s: string, salt?: number | string): string; - -/** - * Asynchronously generates a hash for the given string. - * @param s String to hash - * @param salt Salt length to generate or salt to use - * @return Promise with resulting hash, if callback has been omitted - */ -export declare function hash(s: string, salt: number | string): Promise; - -/** - * Asynchronously generates a hash for the given string. - * @param s String to hash - * @param salt Salt length to generate or salt to use - * @param callback Callback receiving the error, if any, and the resulting hash - * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. - */ -export declare function hash( - s: string, - salt: number | string, - callback?: (err: Error | null, hash: string) => void, - progressCallback?: (percent: number) => void, -): void; - -/** - * Synchronously tests a string against a hash. - * @param s String to compare - * @param hash Hash to test against - * @return true if matching, otherwise false - */ -export declare function compareSync(s: string, hash: string): boolean; - -/** - * Asynchronously compares the given data against the given hash. - * @param s Data to compare - * @param hash Data to be compared to - * @return Promise, if callback has been omitted - */ -export declare function compare(s: string, hash: string): Promise; - -/** - * Asynchronously compares the given data against the given hash. - * @param s Data to compare - * @param hash Data to be compared to - * @param callback Callback receiving the error, if any, otherwise the result - * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. - */ -export declare function compare( - s: string, - hash: string, - callback?: (err: Error | null, success: boolean) => void, - progressCallback?: (percent: number) => void, -): void; - -/** - * Gets the number of rounds used to encrypt the specified hash. - * @param hash Hash to extract the used number of rounds from - * @return Number of rounds used - */ -export declare function getRounds(hash: string): number; - -/** - * Gets the salt portion from a hash. Does not validate the hash. - * @param hash Hash to extract the salt from - * @return Extracted salt part - */ -export declare function getSalt(hash: string): string; - -/** - * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. - * @function - * @param b Byte array - * @param len Maximum input length - */ -export declare function encodeBase64(b: Readonly>, len: number): string; - -/** - * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. - * @function - * @param s String to decode - * @param len Maximum output length - */ -export declare function decodeBase64(s: string, len: number): number[]; diff --git a/types/bcryptjs/package.json b/types/bcryptjs/package.json deleted file mode 100644 index 1ca720cd2cbac5..00000000000000 --- a/types/bcryptjs/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "private": true, - "name": "@types/bcryptjs", - "version": "2.4.9999", - "projects": [ - "https://github.com/dcodeIO/bcrypt.js" - ], - "devDependencies": { - "@types/bcryptjs": "workspace:." - }, - "owners": [ - { - "name": "Joshua Filby", - "githubUsername": "Joshua-F" - }, - { - "name": "Rafael Kraut", - "githubUsername": "RafaelKr" - }, - { - "name": "Branislav HolĂ˝", - "githubUsername": "branoholy" - } - ] -} diff --git a/types/bcryptjs/tsconfig.json b/types/bcryptjs/tsconfig.json deleted file mode 100644 index bf08b743135a4f..00000000000000 --- a/types/bcryptjs/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bcryptjs-tests.ts" - ] -} From dfc45cb4828559e2f42e0d1e3681edb576cecaae Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Fri, 14 Mar 2025 09:31:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72168=20feat(r?= =?UTF-8?q?eact-kawaii):=20remove=20types=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notNeededPackages.json | 4 +++ types/react-kawaii/.npmignore | 5 --- types/react-kawaii/index.d.ts | 29 ----------------- types/react-kawaii/package.json | 20 ------------ types/react-kawaii/react-kawaii-tests.tsx | 38 ----------------------- types/react-kawaii/tsconfig.json | 20 ------------ 6 files changed, 4 insertions(+), 112 deletions(-) delete mode 100644 types/react-kawaii/.npmignore delete mode 100644 types/react-kawaii/index.d.ts delete mode 100644 types/react-kawaii/package.json delete mode 100644 types/react-kawaii/react-kawaii-tests.tsx delete mode 100644 types/react-kawaii/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 7e2ce7551682e7..1393f2844bc1e9 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -5587,6 +5587,10 @@ "libraryName": "react-jss", "asOfVersion": "10.0.0" }, + "react-kawaii": { + "libraryName": "react-kawaii", + "asOfVersion": "1.3.0" + }, "react-leaflet": { "libraryName": "react-leaflet", "asOfVersion": "3.0.0" diff --git a/types/react-kawaii/.npmignore b/types/react-kawaii/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/react-kawaii/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/react-kawaii/index.d.ts b/types/react-kawaii/index.d.ts deleted file mode 100644 index 9fbe656d4fd38b..00000000000000 --- a/types/react-kawaii/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from "react"; - -export type KawaiiMood = - | "sad" - | "shocked" - | "happy" - | "blissful" - | "lovestruck" - | "excited" - | "ko"; - -export interface KawaiiProps { - size?: number | undefined; - color?: string | undefined; - mood?: KawaiiMood | undefined; -} - -export const SpeechBubble: React.ComponentType; -export const Mug: React.ComponentType; -export const Browser: React.ComponentType; -export const Ghost: React.ComponentType; -export const Cat: React.ComponentType; -export const IceCream: React.ComponentType; -export const CreditCard: React.ComponentType; -export const File: React.ComponentType; -export const Backpack: React.ComponentType; -export const Planet: React.ComponentType; -export const Chocolate: React.ComponentType; -export const Folder: React.ComponentType; diff --git a/types/react-kawaii/package.json b/types/react-kawaii/package.json deleted file mode 100644 index e7b29674e6d81d..00000000000000 --- a/types/react-kawaii/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/react-kawaii", - "version": "0.17.9999", - "projects": [ - "https://github.com/miukimiu/react-kawaii" - ], - "dependencies": { - "@types/react": "*" - }, - "devDependencies": { - "@types/react-kawaii": "workspace:." - }, - "owners": [ - { - "name": "Zhang Yi Jiang", - "githubUsername": "ZhangYiJiang" - } - ] -} diff --git a/types/react-kawaii/react-kawaii-tests.tsx b/types/react-kawaii/react-kawaii-tests.tsx deleted file mode 100644 index 00382003334599..00000000000000 --- a/types/react-kawaii/react-kawaii-tests.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from "react"; -import { - Backpack, - Browser, - Cat, - Chocolate, - File, - Folder, - Ghost, - IceCream, - KawaiiMood, - KawaiiProps, - Mug, - Planet, - SpeechBubble, -} from "react-kawaii"; - -const PlanetExample = () => ; -const MugExample = () => ; -const GhostExample = () => ; -const FileExample = () => ; -const IceCreamExample = () => ; -const BrowserExample = () => ; -const BackpackExample = () => ; -const SpeechBubbleExample = () => ; -const CatExample = () => ; -const ChocolateExample = () => ; -const FolderExample = () => ; - -// @ts-expect-error -const invalidMoodNumber: KawaiiMood = 5; - -// @ts-expect-error -const invalidMoodString: KawaiiMood = ""; - -// This is defined on one line to avoid the position of the error moving between TS2/3 -// @ts-expect-error -const invalidProps: KawaiiProps = { size: "200px" }; diff --git a/types/react-kawaii/tsconfig.json b/types/react-kawaii/tsconfig.json deleted file mode 100644 index f6fbe3e1128eae..00000000000000 --- a/types/react-kawaii/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "jsx": "react", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "react-kawaii-tests.tsx" - ] -}