Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Deprecate "objectify" #2764

Merged
merged 1 commit into from May 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/utils.ts
Expand Up @@ -29,6 +29,7 @@ export function arrayify<T>(arg?: T | T[]): T[] {
}

/**
* @deprecated (no longer used)
* Enforces the invariant that the input is an object.
*/
export function objectify(arg: any): any {
Expand Down
10 changes: 1 addition & 9 deletions test/utilsTests.ts
Expand Up @@ -15,7 +15,7 @@
*/

import { assert } from "chai";
import {arrayify, dedent, escapeRegExp, objectify} from "../src/utils";
import {arrayify, dedent, escapeRegExp} from "../src/utils";

describe("Utils", () => {
it("arrayify", () => {
Expand All @@ -29,14 +29,6 @@ describe("Utils", () => {
assert.deepEqual(arrayify(["foo"]), ["foo"]);
});

it("objectify", () => {
assert.deepEqual(objectify(undefined), {});
assert.deepEqual(objectify(null), {});
assert.deepEqual(objectify("foo"), {});
assert.deepEqual(objectify(1), {});
assert.deepEqual(objectify({foo: 1, mar: {baz: 2}}), {foo: 1, mar: {baz: 2}});
});

it("dedent", () => {
assert.equal(dedent`
foo
Expand Down