Skip to content

Commit

Permalink
refactor: rename objectTo1d to objTo1d
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed Nov 26, 2024
1 parent 1e08fb0 commit 4fa6664
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.5.1 (2024--)

- **BREAKING CHANGES**: The `objectTo1d` method have been renamed to `objTo1d`

## 1.5.0 (2024-10-24)

- **BREAKING CHANGES**: The `md5`, `sha1`, and `sha256` methods have been renamed to `md5Hash`, `sha1Hash`, and `sha256Hash`.
Expand Down
4 changes: 2 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ export default class Qsu {
return convertToArray(obj);
}

static objectTo1d(obj: AnyValueObject, separator = '.'): AnyValueObject {
static objTo1d(obj: AnyValueObject, separator = '.'): AnyValueObject {
if (!separator || separator.length < 1) {
throw new Error('`separator` must have value at least 1 character.');
}
Expand Down Expand Up @@ -1321,7 +1321,7 @@ export const {
objToPrettyStr,
objFindItemRecursiveByKey,
objToArray,
objectTo1d,
objTo1d,
objDeleteKeyByValue,
objUpdate,
objMergeNewKey,
Expand Down
14 changes: 7 additions & 7 deletions test/object.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert';
import { describe, it } from 'node:test';
import {
objectTo1d,
objTo1d,
objToQueryString,
objToPrettyStr,
objFindItemRecursiveByKey,
Expand Down Expand Up @@ -196,10 +196,10 @@ describe('Misc', () => {
);
});

it('objectTo1d', () => {
assert.deepStrictEqual(objectTo1d({}), {});
it('objTo1d', () => {
assert.deepStrictEqual(objTo1d({}), {});
assert.deepStrictEqual(
objectTo1d({
objTo1d({
a: 1,
b: 2,
c: 3
Expand All @@ -211,7 +211,7 @@ describe('Misc', () => {
}
);
assert.deepStrictEqual(
objectTo1d({
objTo1d({
a: 1,
b: {
aa: 1,
Expand All @@ -227,7 +227,7 @@ describe('Misc', () => {
}
);
assert.deepStrictEqual(
objectTo1d(
objTo1d(
{
a: 1,
b: {
Expand All @@ -246,7 +246,7 @@ describe('Misc', () => {
}
);
assert.deepStrictEqual(
objectTo1d({
objTo1d({
a: 1,
b: {
aa: {
Expand Down

0 comments on commit 4fa6664

Please sign in to comment.