docs(isEqual): Add isEqual docs (#200)
Some checks are pending
CI / codecov (push) Waiting to run
Release / release (push) Waiting to run

This commit is contained in:
정해준 2024-07-15 09:43:42 +09:00 committed by GitHub
parent c1c3b3f708
commit 3f407712e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 385 additions and 230 deletions

View File

@ -0,0 +1,55 @@
import { bench, describe } from 'vitest';
import { isEqual as isEqualToolkit } from 'es-toolkit';
import { isEqual as isEqualLodash } from 'lodash';
describe('isEqual', () => {
bench('es-toolkit/isEqual', () => {
isEqualToolkit(1, 1);
isEqualToolkit('hello', 'hello');
isEqualToolkit(true, true);
isEqualToolkit('hello', 'world');
isEqualToolkit(true, false);
isEqualToolkit(NaN, NaN);
isEqualToolkit(+0, -0);
isEqualToolkit(new Date('2020-01-01'), new Date('2020-01-01'));
isEqualToolkit(new Date('2020-01-01'), new Date('2021-01-01'));
isEqualToolkit(/hello/g, /hello/g);
isEqualToolkit(/hello/g, /hello/i);
isEqualToolkit({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } });
isEqualToolkit({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 3 } });
isEqualToolkit({ a: 1, b: 2 }, { a: 1, b: 2 });
isEqualToolkit([1, 2, 3], [1, 2, 3]);
isEqualToolkit([1, 2, 3], [1, 2, 4]);
});
bench('lodash/isEqual', () => {
isEqualLodash(1, 1);
isEqualLodash('hello', 'hello');
isEqualLodash(true, true);
isEqualLodash('hello', 'world');
isEqualLodash(true, false);
isEqualLodash(NaN, NaN);
isEqualLodash(+0, -0);
isEqualLodash(new Date('2020-01-01'), new Date('2020-01-01'));
isEqualLodash(new Date('2020-01-01'), new Date('2021-01-01'));
isEqualLodash(/hello/g, /hello/g);
isEqualLodash(/hello/g, /hello/i);
isEqualLodash({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } });
isEqualLodash({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 3 } });
isEqualLodash({ a: 1, b: 2 }, { a: 1, b: 2 });
isEqualLodash([1, 2, 3], [1, 2, 3]);
isEqualLodash([1, 2, 3], [1, 2, 4]);
});
});

View File

@ -1,9 +1,9 @@
import { type DefaultTheme, defineConfig } from "vitepress"; import { type DefaultTheme, defineConfig } from 'vitepress';
export const en = defineConfig({ export const en = defineConfig({
lang: "en", lang: 'en',
description: description:
"A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.", 'A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.',
themeConfig: { themeConfig: {
nav: nav(), nav: nav(),
@ -11,12 +11,12 @@ export const en = defineConfig({
sidebar: sidebar(), sidebar: sidebar(),
editLink: { editLink: {
pattern: "https://github.com/toss/es-toolkit/edit/main/docs/:path", pattern: 'https://github.com/toss/es-toolkit/edit/main/docs/:path',
text: "Edit this page on GitHub", text: 'Edit this page on GitHub',
}, },
footer: { footer: {
message: "Released under the MIT License.", message: 'Released under the MIT License.',
copyright: `Copyright © ${new Date().getFullYear()} Viva Republica, Inc.`, copyright: `Copyright © ${new Date().getFullYear()} Viva Republica, Inc.`,
}, },
}, },
@ -24,141 +24,142 @@ export const en = defineConfig({
function nav(): DefaultTheme.NavItem[] { function nav(): DefaultTheme.NavItem[] {
return [ return [
{ text: "Home", link: "/" }, { text: 'Home', link: '/' },
{ text: "Introduction", link: "/intro" }, { text: 'Introduction', link: '/intro' },
{ text: "Reference", link: "/reference/array/chunk" }, { text: 'Reference', link: '/reference/array/chunk' },
]; ];
} }
function sidebar(): DefaultTheme.Sidebar { function sidebar(): DefaultTheme.Sidebar {
return [ return [
{ {
text: "Guide", text: 'Guide',
items: [ items: [
{ text: "Introduction", link: "/intro" }, { text: 'Introduction', link: '/intro' },
{ text: "Installation", link: "/installation" }, { text: 'Installation', link: '/installation' },
{ text: "Impact on Bundle Size", link: "/bundle-size" }, { text: 'Impact on Bundle Size', link: '/bundle-size' },
{ text: "Performance", link: "/performance" }, { text: 'Performance', link: '/performance' },
{ text: "Compatibility with Lodash", link: "/compatibility" }, { text: 'Compatibility with Lodash', link: '/compatibility' },
], ],
}, },
{ {
text: "Reference", text: 'Reference',
items: [ items: [
{ {
text: "Array Utilities", text: 'Array Utilities',
items: [ items: [
{ text: "chunk", link: "/reference/array/chunk" }, { text: 'chunk', link: '/reference/array/chunk' },
{ text: "countBy", link: "/reference/array/countBy" }, { text: 'countBy', link: '/reference/array/countBy' },
{ text: "compact", link: "/reference/array/compact" }, { text: 'compact', link: '/reference/array/compact' },
{ text: "difference", link: "/reference/array/difference" }, { text: 'difference', link: '/reference/array/difference' },
{ text: "differenceBy", link: "/reference/array/differenceBy" }, { text: 'differenceBy', link: '/reference/array/differenceBy' },
{ text: "differenceWith", link: "/reference/array/differenceWith" }, { text: 'differenceWith', link: '/reference/array/differenceWith' },
{ text: "drop", link: "/reference/array/drop" }, { text: 'drop', link: '/reference/array/drop' },
{ text: "dropWhile", link: "/reference/array/dropWhile" }, { text: 'dropWhile', link: '/reference/array/dropWhile' },
{ text: "dropRight", link: "/reference/array/dropRight" }, { text: 'dropRight', link: '/reference/array/dropRight' },
{ text: "dropRightWhile", link: "/reference/array/dropRightWhile" }, { text: 'dropRightWhile', link: '/reference/array/dropRightWhile' },
{ text: "fill", link: "/reference/array/fill" }, { text: 'fill', link: '/reference/array/fill' },
{ text: "toFilled", link: "/reference/array/toFilled" }, { text: 'toFilled', link: '/reference/array/toFilled' },
{ text: "flatten", link: "/reference/array/flatten" }, { text: 'flatten', link: '/reference/array/flatten' },
{ text: "flattenDeep", link: "/reference/array/flattenDeep" }, { text: 'flattenDeep', link: '/reference/array/flattenDeep' },
{ text: "forEachRight", link: "/reference/array/forEachRight" }, { text: 'forEachRight', link: '/reference/array/forEachRight' },
{ text: "groupBy", link: "/reference/array/groupBy" }, { text: 'groupBy', link: '/reference/array/groupBy' },
{ text: "intersection", link: "/reference/array/intersection" }, { text: 'intersection', link: '/reference/array/intersection' },
{ text: "intersectionBy", link: "/reference/array/intersectionBy" }, { text: 'intersectionBy', link: '/reference/array/intersectionBy' },
{ {
text: "intersectionWith", text: 'intersectionWith',
link: "/reference/array/intersectionWith", link: '/reference/array/intersectionWith',
}, },
{ text: "keyBy", link: "/reference/array/keyBy" }, { text: 'keyBy', link: '/reference/array/keyBy' },
{ text: "minBy", link: "/reference/array/minBy" }, { text: 'minBy', link: '/reference/array/minBy' },
{ text: "maxBy", link: "/reference/array/maxBy" }, { text: 'maxBy', link: '/reference/array/maxBy' },
{ text: "orderBy", link: "/reference/array/orderBy" }, { text: 'orderBy', link: '/reference/array/orderBy' },
{ text: "partition", link: "/reference/array/partition" }, { text: 'partition', link: '/reference/array/partition' },
{ text: "sample", link: "/reference/array/sample" }, { text: 'sample', link: '/reference/array/sample' },
{ text: "sampleSize", link: "/reference/array/sampleSize" }, { text: 'sampleSize', link: '/reference/array/sampleSize' },
{ text: "shuffle", link: "/reference/array/shuffle" }, { text: 'shuffle', link: '/reference/array/shuffle' },
{ text: "take", link: "/reference/array/take" }, { text: 'take', link: '/reference/array/take' },
{ text: "takeWhile", link: "/reference/array/takeWhile" }, { text: 'takeWhile', link: '/reference/array/takeWhile' },
{ text: "takeRight", link: "/reference/array/takeRight" }, { text: 'takeRight', link: '/reference/array/takeRight' },
{ text: "takeRightWhile", link: "/reference/array/takeRightWhile" }, { text: 'takeRightWhile', link: '/reference/array/takeRightWhile' },
{ text: "union", link: "/reference/array/union" }, { text: 'union', link: '/reference/array/union' },
{ text: "unionBy", link: "/reference/array/unionBy" }, { text: 'unionBy', link: '/reference/array/unionBy' },
{ text: "unionWith", link: "/reference/array/unionWith" }, { text: 'unionWith', link: '/reference/array/unionWith' },
{ text: "uniq", link: "/reference/array/uniq" }, { text: 'uniq', link: '/reference/array/uniq' },
{ text: "uniqBy", link: "/reference/array/uniqBy" }, { text: 'uniqBy', link: '/reference/array/uniqBy' },
{ text: "uniqWith", link: "/reference/array/uniqWith" }, { text: 'uniqWith', link: '/reference/array/uniqWith' },
{ text: "unzip", link: "/reference/array/unzip" }, { text: 'unzip', link: '/reference/array/unzip' },
{ text: "unzipWith", link: "/reference/array/unzipWith" }, { text: 'unzipWith', link: '/reference/array/unzipWith' },
{ text: "without", link: "/reference/array/without" }, { text: 'without', link: '/reference/array/without' },
{ text: "xor", link: "/reference/array/xor" }, { text: 'xor', link: '/reference/array/xor' },
{ text: "xorBy", link: "/reference/array/xorBy" }, { text: 'xorBy', link: '/reference/array/xorBy' },
{ text: "xorWith", link: "/reference/array/xorWith" }, { text: 'xorWith', link: '/reference/array/xorWith' },
{ text: "zip", link: "/reference/array/zip" }, { text: 'zip', link: '/reference/array/zip' },
{ text: "zipObject", link: "/reference/array/zipObject" }, { text: 'zipObject', link: '/reference/array/zipObject' },
{ text: "zipWith", link: "/reference/array/zipWith" }, { text: 'zipWith', link: '/reference/array/zipWith' },
{ text: "head", link: "/reference/array/head" }, { text: 'head', link: '/reference/array/head' },
{ text: "tail", link: "/reference/array/tail" }, { text: 'tail', link: '/reference/array/tail' },
{ text: "last", link: "/reference/array/last" }, { text: 'last', link: '/reference/array/last' },
{ text: "initial", link: "/reference/array/initial" }, { text: 'initial', link: '/reference/array/initial' },
], ],
}, },
{ {
text: "Function Utilities", text: 'Function Utilities',
items: [ items: [
{ text: "debounce", link: "/reference/function/debounce" }, { text: 'debounce', link: '/reference/function/debounce' },
{ text: "throttle", link: "/reference/function/throttle" }, { text: 'throttle', link: '/reference/function/throttle' },
{ text: "negate", link: "/reference/function/negate" }, { text: 'negate', link: '/reference/function/negate' },
{ text: "once", link: "/reference/function/once" }, { text: 'once', link: '/reference/function/once' },
{ text: "noop", link: "/reference/function/noop" }, { text: 'noop', link: '/reference/function/noop' },
], ],
}, },
{ {
text: "Math Utilities", text: 'Math Utilities',
items: [ items: [
{ text: "clamp", link: "/reference/math/clamp" }, { text: 'clamp', link: '/reference/math/clamp' },
{ text: "inRange", link: "/reference/math/inRange" }, { text: 'inRange', link: '/reference/math/inRange' },
{ text: "mean", link: "/reference/math/mean" }, { text: 'mean', link: '/reference/math/mean' },
{ text: "meanBy", link: "/reference/math/meanBy" }, { text: 'meanBy', link: '/reference/math/meanBy' },
{ text: "random", link: "/reference/math/random" }, { text: 'random', link: '/reference/math/random' },
{ text: "randomInt", link: "/reference/math/randomInt" }, { text: 'randomInt', link: '/reference/math/randomInt' },
{ text: "range", link: "/reference/math/range" }, { text: 'range', link: '/reference/math/range' },
{ text: "round", link: "/reference/math/round" }, { text: 'round', link: '/reference/math/round' },
{ text: "sum", link: "/reference/math/sum" }, { text: 'sum', link: '/reference/math/sum' },
{ text: "sumBy", link: "/reference/math/sumBy" }, { text: 'sumBy', link: '/reference/math/sumBy' },
], ],
}, },
{ {
text: "Object Utilities", text: 'Object Utilities',
items: [ items: [
{ text: "clone", link: "/reference/object/clone" }, { text: 'clone', link: '/reference/object/clone' },
{ text: "omit", link: "/reference/object/omit" }, { text: 'omit', link: '/reference/object/omit' },
{ text: "omitBy", link: "/reference/object/omitBy" }, { text: 'omitBy', link: '/reference/object/omitBy' },
{ text: "pick", link: "/reference/object/pick" }, { text: 'pick', link: '/reference/object/pick' },
{ text: "pickBy", link: "/reference/object/pickBy" }, { text: 'pickBy', link: '/reference/object/pickBy' },
{ text: "invert", link: "/reference/object/invert" }, { text: 'invert', link: '/reference/object/invert' },
], ],
}, },
{ {
text: "Predicates", text: 'Predicates',
items: [ items: [
{ text: "isNil", link: "/reference/predicate/isNil" }, { text: 'isEqual', link: '/reference/predicate/isEqual' },
{ text: "isNotNil", link: "/reference/predicate/isNotNil" }, { text: 'isNil', link: '/reference/predicate/isNil' },
{ text: "isNull", link: "/reference/predicate/isNull" }, { text: 'isNotNil', link: '/reference/predicate/isNotNil' },
{ text: "isUndefined", link: "/reference/predicate/isUndefined" }, { text: 'isNull', link: '/reference/predicate/isNull' },
{ text: 'isUndefined', link: '/reference/predicate/isUndefined' },
], ],
}, },
{ {
text: "Promise Utilities", text: 'Promise Utilities',
items: [{ text: "delay", link: "/reference/promise/delay" }], items: [{ text: 'delay', link: '/reference/promise/delay' }],
}, },
{ {
text: "String Utilities", text: 'String Utilities',
items: [ items: [
{ text: "snakeCase", link: "/reference/string/snakeCase" }, { text: 'snakeCase', link: '/reference/string/snakeCase' },
{ text: "kebabCase", link: "/reference/string/kebabCase" }, { text: 'kebabCase', link: '/reference/string/kebabCase' },
{ text: "lowerCase", link: "/reference/string/lowerCase" }, { text: 'lowerCase', link: '/reference/string/lowerCase' },
{ text: "capitalize", link: "/reference/string/capitalize" }, { text: 'capitalize', link: '/reference/string/capitalize' },
], ],
}, },
], ],

View File

@ -1,9 +1,8 @@
import { type DefaultTheme, defineConfig } from "vitepress"; import { type DefaultTheme, defineConfig } from 'vitepress';
export const ko = defineConfig({ export const ko = defineConfig({
lang: "ko", lang: 'ko',
description: description: '빠른 성능, 작은 번들 사이즈를 가지는 현대적인 JavaScript 유틸리티 라이브러리',
"빠른 성능, 작은 번들 사이즈를 가지는 현대적인 JavaScript 유틸리티 라이브러리",
themeConfig: { themeConfig: {
nav: nav(), nav: nav(),
@ -11,12 +10,12 @@ export const ko = defineConfig({
sidebar: sidebar(), sidebar: sidebar(),
editLink: { editLink: {
pattern: "https://github.com/toss/es-toolkit/edit/main/docs/:path", pattern: 'https://github.com/toss/es-toolkit/edit/main/docs/:path',
text: "GitHub에서 수정하기", text: 'GitHub에서 수정하기',
}, },
footer: { footer: {
message: "MIT 라이선스에 따라 배포됩니다.", message: 'MIT 라이선스에 따라 배포됩니다.',
copyright: `Copyright © ${new Date().getFullYear()} Viva Republica, Inc.`, copyright: `Copyright © ${new Date().getFullYear()} Viva Republica, Inc.`,
}, },
}, },
@ -24,156 +23,157 @@ export const ko = defineConfig({
function nav(): DefaultTheme.NavItem[] { function nav(): DefaultTheme.NavItem[] {
return [ return [
{ text: "홈", link: "/ko" }, { text: '홈', link: '/ko' },
{ text: "소개", link: "/ko/intro" }, { text: '소개', link: '/ko/intro' },
{ text: "레퍼런스", link: "/ko/reference/array/chunk" }, { text: '레퍼런스', link: '/ko/reference/array/chunk' },
]; ];
} }
function sidebar(): DefaultTheme.Sidebar { function sidebar(): DefaultTheme.Sidebar {
return [ return [
{ {
text: "가이드", text: '가이드',
items: [ items: [
{ text: "소개", link: "/ko/intro" }, { text: '소개', link: '/ko/intro' },
{ text: "설치", link: "/ko/installation" }, { text: '설치', link: '/ko/installation' },
{ text: "번들 사이즈", link: "/ko/bundle-size" }, { text: '번들 사이즈', link: '/ko/bundle-size' },
{ text: "성능", link: "/ko/performance" }, { text: '성능', link: '/ko/performance' },
{ text: "Lodash와 호환성", link: "/ko/compatibility" }, { text: 'Lodash와 호환성', link: '/ko/compatibility' },
], ],
}, },
{ {
text: "레퍼런스", text: '레퍼런스',
items: [ items: [
{ {
text: "배열", text: '배열',
items: [ items: [
{ text: "chunk", link: "/ko/reference/array/chunk" }, { text: 'chunk', link: '/ko/reference/array/chunk' },
{ text: "countBy", link: "/ko/reference/array/countBy" }, { text: 'countBy', link: '/ko/reference/array/countBy' },
{ text: "compact", link: "/ko/reference/array/compact" }, { text: 'compact', link: '/ko/reference/array/compact' },
{ text: "difference", link: "/ko/reference/array/difference" }, { text: 'difference', link: '/ko/reference/array/difference' },
{ text: "differenceBy", link: "/ko/reference/array/differenceBy" }, { text: 'differenceBy', link: '/ko/reference/array/differenceBy' },
{ {
text: "differenceWith", text: 'differenceWith',
link: "/ko/reference/array/differenceWith", link: '/ko/reference/array/differenceWith',
}, },
{ text: "drop", link: "/ko/reference/array/drop" }, { text: 'drop', link: '/ko/reference/array/drop' },
{ text: "dropWhile", link: "/ko/reference/array/dropWhile" }, { text: 'dropWhile', link: '/ko/reference/array/dropWhile' },
{ text: "dropRight", link: "/ko/reference/array/dropRight" }, { text: 'dropRight', link: '/ko/reference/array/dropRight' },
{ {
text: "dropRightWhile", text: 'dropRightWhile',
link: "/ko/reference/array/dropRightWhile", link: '/ko/reference/array/dropRightWhile',
}, },
{ text: "fill", link: "/ko/reference/array/fill" }, { text: 'fill', link: '/ko/reference/array/fill' },
{ text: "toFilled", link: "/ko/reference/array/toFilled" }, { text: 'toFilled', link: '/ko/reference/array/toFilled' },
{ text: "flatten", link: "/ko/reference/array/flatten" }, { text: 'flatten', link: '/ko/reference/array/flatten' },
{ text: "flattenDeep", link: "/ko/reference/array/flattenDeep" }, { text: 'flattenDeep', link: '/ko/reference/array/flattenDeep' },
{ text: "forEachRight", link: "/reference/array/forEachRight" }, { text: 'forEachRight', link: '/reference/array/forEachRight' },
{ text: "groupBy", link: "/ko/reference/array/groupBy" }, { text: 'groupBy', link: '/ko/reference/array/groupBy' },
{ text: "intersection", link: "/ko/reference/array/intersection" }, { text: 'intersection', link: '/ko/reference/array/intersection' },
{ {
text: "intersectionBy", text: 'intersectionBy',
link: "/ko/reference/array/intersectionBy", link: '/ko/reference/array/intersectionBy',
}, },
{ {
text: "intersectionWith", text: 'intersectionWith',
link: "/ko/reference/array/intersectionWith", link: '/ko/reference/array/intersectionWith',
}, },
{ text: "keyBy", link: "/ko/reference/array/keyBy" }, { text: 'keyBy', link: '/ko/reference/array/keyBy' },
{ text: "minBy", link: "/ko/reference/array/minBy" }, { text: 'minBy', link: '/ko/reference/array/minBy' },
{ text: "maxBy", link: "/ko/reference/array/maxBy" }, { text: 'maxBy', link: '/ko/reference/array/maxBy' },
{ text: "orderBy", link: "/ko/reference/array/orderBy" }, { text: 'orderBy', link: '/ko/reference/array/orderBy' },
{ text: "partition", link: "/ko/reference/array/partition" }, { text: 'partition', link: '/ko/reference/array/partition' },
{ text: "sample", link: "/ko/reference/array/sample" }, { text: 'sample', link: '/ko/reference/array/sample' },
{ text: "sampleSize", link: "/ko/reference/array/sampleSize" }, { text: 'sampleSize', link: '/ko/reference/array/sampleSize' },
{ text: "shuffle", link: "/ko/reference/array/shuffle" }, { text: 'shuffle', link: '/ko/reference/array/shuffle' },
{ text: "take", link: "/ko/reference/array/take" }, { text: 'take', link: '/ko/reference/array/take' },
{ text: "takeWhile", link: "/ko/reference/array/takeWhile" }, { text: 'takeWhile', link: '/ko/reference/array/takeWhile' },
{ text: "takeRight", link: "/ko/reference/array/takeRight" }, { text: 'takeRight', link: '/ko/reference/array/takeRight' },
{ {
text: "takeRightWhile", text: 'takeRightWhile',
link: "/ko/reference/array/takeRightWhile", link: '/ko/reference/array/takeRightWhile',
}, },
{ text: "union", link: "/ko/reference/array/union" }, { text: 'union', link: '/ko/reference/array/union' },
{ text: "unionBy", link: "/ko/reference/array/unionBy" }, { text: 'unionBy', link: '/ko/reference/array/unionBy' },
{ text: "unionWith", link: "/ko/reference/array/unionWith" }, { text: 'unionWith', link: '/ko/reference/array/unionWith' },
{ text: "unzip", link: "/ko/reference/array/unzip" }, { text: 'unzip', link: '/ko/reference/array/unzip' },
{ text: "unzipWith", link: "/ko/reference/array/unzipWith" }, { text: 'unzipWith', link: '/ko/reference/array/unzipWith' },
{ text: "uniq", link: "/ko/reference/array/uniq" }, { text: 'uniq', link: '/ko/reference/array/uniq' },
{ text: "uniqBy", link: "/ko/reference/array/uniqBy" }, { text: 'uniqBy', link: '/ko/reference/array/uniqBy' },
{ text: "uniqWith", link: "/ko/reference/array/uniqWith" }, { text: 'uniqWith', link: '/ko/reference/array/uniqWith' },
{ text: "without", link: "/ko/reference/array/without" }, { text: 'without', link: '/ko/reference/array/without' },
{ text: "xor", link: "/ko/reference/array/xor" }, { text: 'xor', link: '/ko/reference/array/xor' },
{ text: "xorBy", link: "/ko/reference/array/xorBy" }, { text: 'xorBy', link: '/ko/reference/array/xorBy' },
{ text: "xorWith", link: "/ko/reference/array/xorWith" }, { text: 'xorWith', link: '/ko/reference/array/xorWith' },
{ text: "zip", link: "/ko/reference/array/zip" }, { text: 'zip', link: '/ko/reference/array/zip' },
{ text: "zipObject", link: "/ko/reference/array/zipObject" }, { text: 'zipObject', link: '/ko/reference/array/zipObject' },
{ text: "zipWith", link: "/ko/reference/array/zipWith" }, { text: 'zipWith', link: '/ko/reference/array/zipWith' },
{ text: "head", link: "/ko/reference/array/head" }, { text: 'head', link: '/ko/reference/array/head' },
{ text: "tail", link: "/ko/reference/array/tail" }, { text: 'tail', link: '/ko/reference/array/tail' },
{ text: "last", link: "/ko/reference/array/last" }, { text: 'last', link: '/ko/reference/array/last' },
{ text: "initial", link: "/ko/reference/array/initial" }, { text: 'initial', link: '/ko/reference/array/initial' },
], ],
}, },
{ {
text: "함수", text: '함수',
items: [ items: [
{ text: "debounce", link: "/ko/reference/function/debounce" }, { text: 'debounce', link: '/ko/reference/function/debounce' },
{ text: "throttle", link: "/ko/reference/function/throttle" }, { text: 'throttle', link: '/ko/reference/function/throttle' },
{ text: "negate", link: "/reference/function/negate" }, { text: 'negate', link: '/reference/function/negate' },
{ text: "once", link: "/ko/reference/function/once" }, { text: 'once', link: '/ko/reference/function/once' },
{ text: "noop", link: "/ko/reference/function/noop" }, { text: 'noop', link: '/ko/reference/function/noop' },
], ],
}, },
{ {
text: "숫자", text: '숫자',
items: [ items: [
{ text: "clamp", link: "/ko/reference/math/clamp" }, { text: 'clamp', link: '/ko/reference/math/clamp' },
{ text: "inRange", link: "/ko/reference/math/inRange" }, { text: 'inRange', link: '/ko/reference/math/inRange' },
{ text: "mean", link: "/ko/reference/math/mean" }, { text: 'mean', link: '/ko/reference/math/mean' },
{ text: "meanBy", link: "/ko/reference/math/meanBy" }, { text: 'meanBy', link: '/ko/reference/math/meanBy' },
{ text: "random", link: "/ko/reference/math/random" }, { text: 'random', link: '/ko/reference/math/random' },
{ text: "randomInt", link: "/ko/reference/math/randomInt" }, { text: 'randomInt', link: '/ko/reference/math/randomInt' },
{ text: "round", link: "/ko/reference/math/round" }, { text: 'round', link: '/ko/reference/math/round' },
{ text: "range", link: "/ko/reference/math/range" }, { text: 'range', link: '/ko/reference/math/range' },
{ text: "sum", link: "/ko/reference/math/sum" }, { text: 'sum', link: '/ko/reference/math/sum' },
{ text: "sumBy", link: "/ko/reference/math/sumBy" }, { text: 'sumBy', link: '/ko/reference/math/sumBy' },
], ],
}, },
{ {
text: "객체", text: '객체',
items: [ items: [
{ text: "clone", link: "/ko/reference/object/clone" }, { text: 'clone', link: '/ko/reference/object/clone' },
{ text: "omit", link: "/ko/reference/object/omit" }, { text: 'omit', link: '/ko/reference/object/omit' },
{ text: "omitBy", link: "/ko/reference/object/omitBy" }, { text: 'omitBy', link: '/ko/reference/object/omitBy' },
{ text: "pick", link: "/ko/reference/object/pick" }, { text: 'pick', link: '/ko/reference/object/pick' },
{ text: "pickBy", link: "/ko/reference/object/pickBy" }, { text: 'pickBy', link: '/ko/reference/object/pickBy' },
{ text: "invert", link: "/ko/reference/object/invert" }, { text: 'invert', link: '/ko/reference/object/invert' },
], ],
}, },
{ {
text: "타입 가드", text: '타입 가드',
items: [ items: [
{ text: "isNil", link: "/ko/reference/predicate/isNil" }, { text: 'isEqual', link: '/ko/reference/predicate/isEqual' },
{ text: "isNotNil", link: "/ko/reference/predicate/isNotNil" }, { text: 'isNil', link: '/ko/reference/predicate/isNil' },
{ text: "isNull", link: "/ko/reference/predicate/isNull" }, { text: 'isNotNil', link: '/ko/reference/predicate/isNotNil' },
{ text: 'isNull', link: '/ko/reference/predicate/isNull' },
{ {
text: "isUndefined", text: 'isUndefined',
link: "/ko/reference/predicate/isUndefined", link: '/ko/reference/predicate/isUndefined',
}, },
], ],
}, },
{ {
text: "Promise", text: 'Promise',
items: [{ text: "delay", link: "/ko/reference/promise/delay" }], items: [{ text: 'delay', link: '/ko/reference/promise/delay' }],
}, },
{ {
text: "문자열", text: '문자열',
items: [ items: [
{ text: "snakeCase", link: "/ko/reference/string/snakeCase" }, { text: 'snakeCase', link: '/ko/reference/string/snakeCase' },
{ text: "kebabCase", link: "/ko/reference/string/kebabCase" }, { text: 'kebabCase', link: '/ko/reference/string/kebabCase' },
{ text: "lowerCase", link: "/ko/reference/string/lowerCase" }, { text: 'lowerCase', link: '/ko/reference/string/lowerCase' },
{ text: "capitalize", link: "/ko/reference/string/capitalize" }, { text: 'capitalize', link: '/ko/reference/string/capitalize' },
], ],
}, },
], ],
@ -181,27 +181,27 @@ function sidebar(): DefaultTheme.Sidebar {
]; ];
} }
export const search: DefaultTheme.LocalSearchOptions["locales"] = { export const search: DefaultTheme.LocalSearchOptions['locales'] = {
ko: { ko: {
translations: { translations: {
button: { button: {
buttonText: "검색", buttonText: '검색',
buttonAriaLabel: "검색", buttonAriaLabel: '검색',
}, },
modal: { modal: {
backButtonTitle: "뒤로가기", backButtonTitle: '뒤로가기',
displayDetails: "더보기", displayDetails: '더보기',
footer: { footer: {
closeKeyAriaLabel: "닫기", closeKeyAriaLabel: '닫기',
closeText: "닫기", closeText: '닫기',
navigateDownKeyAriaLabel: "아래로", navigateDownKeyAriaLabel: '아래로',
navigateText: "이동", navigateText: '이동',
navigateUpKeyAriaLabel: "위로", navigateUpKeyAriaLabel: '위로',
selectKeyAriaLabel: "선택", selectKeyAriaLabel: '선택',
selectText: "선택", selectText: '선택',
}, },
noResultsText: "검색 결과를 찾지 못했어요.", noResultsText: '검색 결과를 찾지 못했어요.',
resetButtonTitle: "모두 지우기", resetButtonTitle: '모두 지우기',
}, },
}, },
}, },

View File

@ -0,0 +1,89 @@
# isEqual
`isEqual` 함수는 두 값이 동일한지 확인하며, `Date`, `RegExp`, 깊은 객체 비교도 지원해요.
## Signature
```typescript
function isEqual(a: unknown, b: unknown): boolean;
```
## Parameters
- **`a`**: `unknown` - 비교할 첫 번째 값.
- **`b`**: `unknown` - 비교할 두 번째 값.
## Returns
- **`boolean`** - 두 값이 동일하면 `true`, 그렇지 않으면 `false`를 반환해요.
## Examples
### Example 1: 원시 타입 값 비교
```javascript
isEqual(1, 1); // true
isEqual('hello', 'hello'); // true
isEqual(true, true); // true
isEqual(1, 2); // false
isEqual('hello', 'world'); // false
isEqual(true, false); // false
```
### Example 2: 특수 경우 비교
```javascript
isEqual(NaN, NaN); // true
isEqual(+0, -0); // false
```
### Example 3: 날짜 객체 비교
```javascript
const date1 = new Date('2020-01-01');
const date2 = new Date('2020-01-01');
isEqual(date1, date2); // true
const date3 = new Date('2021-01-01');
isEqual(date1, date3); // false
```
### Example 4: 정규 표현식 객체 비교
```javascript
const regex1 = /hello/g;
const regex2 = /hello/g;
isEqual(regex1, regex2); // true
const regex3 = /hello/i;
isEqual(regex1, regex3); // false
```
### Example 5: 객체 비교
```javascript
const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { a: 1, b: { c: 2 } };
isEqual(obj1, obj2); // true
const obj3 = { a: 1, b: { c: 3 } };
isEqual(obj1, obj3); // false
const obj4 = { a: 1, b: 2 };
const obj5 = { a: 1, c: 2 };
isEqual(obj4, obj5); // false
```
### Example 6: 배열 비교
```javascript
const arr1 = [1, 2, 3];
const arr2 = [1, 2, 3];
isEqual(arr1, arr2); // true
const arr3 = [1, 2, 4];
isEqual(arr1, arr3); // false
const arr4 = [1, 2];
isEqual(arr1, arr4); // false
```

View File

@ -3,19 +3,24 @@
The `isEqual` function checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison. The `isEqual` function checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.
## Signature ## Signature
```typescript ```typescript
export function isEqual(a: unknown, b: unknown): boolean; function isEqual(a: unknown, b: unknown): boolean;
``` ```
## Parameters ## Parameters
- **`a`**: `unknown` - The first value to compare. - **`a`**: `unknown` - The first value to compare.
- **`b`**: `unknown` - The second value to compare. - **`b`**: `unknown` - The second value to compare.
## Returns ## Returns
- **`boolean`** - Returns `true` if the values are equal, otherwise `false`. - **`boolean`** - Returns `true` if the values are equal, otherwise `false`.
## Examples ## Examples
### Example 1: Comparing Primitive Values ### Example 1: Comparing Primitive Values
```javascript ```javascript
isEqual(1, 1); // true isEqual(1, 1); // true
isEqual('hello', 'hello'); // true isEqual('hello', 'hello'); // true
@ -26,12 +31,14 @@ isEqual(true, false); // false
``` ```
### Example 2: Comparing Special Cases ### Example 2: Comparing Special Cases
```javascript ```javascript
isEqual(NaN, NaN); // true isEqual(NaN, NaN); // true
isEqual(+0, -0); // false isEqual(+0, -0); // false
``` ```
### Example 3: Comparing Date Objects ### Example 3: Comparing Date Objects
```javascript ```javascript
const date1 = new Date('2020-01-01'); const date1 = new Date('2020-01-01');
const date2 = new Date('2020-01-01'); const date2 = new Date('2020-01-01');
@ -42,6 +49,7 @@ isEqual(date1, date3); // false
``` ```
### Example 4: Comparing RegExp Objects ### Example 4: Comparing RegExp Objects
```javascript ```javascript
const regex1 = /hello/g; const regex1 = /hello/g;
const regex2 = /hello/g; const regex2 = /hello/g;
@ -52,6 +60,7 @@ isEqual(regex1, regex3); // false
``` ```
### Example 5: Comparing Objects ### Example 5: Comparing Objects
```javascript ```javascript
const obj1 = { a: 1, b: { c: 2 } }; const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { a: 1, b: { c: 2 } }; const obj2 = { a: 1, b: { c: 2 } };
@ -66,6 +75,7 @@ isEqual(obj4, obj5); // false
``` ```
### Example 6: Comparing Arrays ### Example 6: Comparing Arrays
```javascript ```javascript
const arr1 = [1, 2, 3]; const arr1 = [1, 2, 3];
const arr2 = [1, 2, 3]; const arr2 = [1, 2, 3];
@ -76,4 +86,4 @@ isEqual(arr1, arr3); // false
const arr4 = [1, 2]; const arr4 = [1, 2];
isEqual(arr1, arr4); // false isEqual(arr1, arr4); // false
``` ```