diff --git a/libs/core/src/utils/identity.ts b/libs/core/src/utils/identity.ts new file mode 100644 index 0000000000..c38836ebf5 --- /dev/null +++ b/libs/core/src/utils/identity.ts @@ -0,0 +1,7 @@ +/** + * The unary identity function. + * Returns whatever is passed to it. + */ +export function identity(v: T): T { + return v; +} diff --git a/libs/core/src/utils/public_api.ts b/libs/core/src/utils/public_api.ts index 3346d7c3fe..20d8f96dcd 100644 --- a/libs/core/src/utils/public_api.ts +++ b/libs/core/src/utils/public_api.ts @@ -12,3 +12,4 @@ export { shallowCompare } from './shallow-compare'; export { shuffle } from './shuffle'; export { unique } from './unique'; export * from './long-arithmetic'; +export * from './identity';