Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@psimk/typed-object

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@psimk/typed-object - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

10

lib/cjs/index.d.ts

@@ -1,7 +0,3 @@

import typedObjectKeys from "./typedObjectKeys";
import typedObjectValues from "./typedObjectValues";
import typedObjectEntries from "./typedObjectEntries";
export { typedObjectKeys, typedObjectValues, typedObjectEntries };
export * from "./typedObjectKeys";
export * from "./typedObjectValues";
export * from "./typedObjectEntries";
export { default as typedObjectKeys, ObjectKeys } from "./typedObjectKeys";
export { default as typedObjectValues, ObjectValues } from "./typedObjectValues";
export { default as typedObjectEntries, ObjectEntries } from "./typedObjectEntries";
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -17,10 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

exports.typedObjectEntries = exports.typedObjectValues = exports.typedObjectKeys = void 0;
var typedObjectKeys_1 = __importDefault(require("./typedObjectKeys"));
exports.typedObjectKeys = typedObjectKeys_1.default;
var typedObjectValues_1 = __importDefault(require("./typedObjectValues"));
exports.typedObjectValues = typedObjectValues_1.default;
var typedObjectEntries_1 = __importDefault(require("./typedObjectEntries"));
exports.typedObjectEntries = typedObjectEntries_1.default;
__exportStar(require("./typedObjectKeys"), exports);
__exportStar(require("./typedObjectValues"), exports);
__exportStar(require("./typedObjectEntries"), exports);
var typedObjectKeys_1 = require("./typedObjectKeys");
Object.defineProperty(exports, "typedObjectKeys", { enumerable: true, get: function () { return __importDefault(typedObjectKeys_1).default; } });
var typedObjectValues_1 = require("./typedObjectValues");
Object.defineProperty(exports, "typedObjectValues", { enumerable: true, get: function () { return __importDefault(typedObjectValues_1).default; } });
var typedObjectEntries_1 = require("./typedObjectEntries");
Object.defineProperty(exports, "typedObjectEntries", { enumerable: true, get: function () { return __importDefault(typedObjectEntries_1).default; } });

@@ -1,7 +0,3 @@

import typedObjectKeys from "./typedObjectKeys";
import typedObjectValues from "./typedObjectValues";
import typedObjectEntries from "./typedObjectEntries";
export { typedObjectKeys, typedObjectValues, typedObjectEntries };
export * from "./typedObjectKeys";
export * from "./typedObjectValues";
export * from "./typedObjectEntries";
export { default as typedObjectKeys, ObjectKeys } from "./typedObjectKeys";
export { default as typedObjectValues, ObjectValues } from "./typedObjectValues";
export { default as typedObjectEntries, ObjectEntries } from "./typedObjectEntries";

@@ -1,7 +0,3 @@

import typedObjectKeys from "./typedObjectKeys";
import typedObjectValues from "./typedObjectValues";
import typedObjectEntries from "./typedObjectEntries";
export { typedObjectKeys, typedObjectValues, typedObjectEntries };
export * from "./typedObjectKeys";
export * from "./typedObjectValues";
export * from "./typedObjectEntries";
export { default as typedObjectKeys } from "./typedObjectKeys";
export { default as typedObjectValues } from "./typedObjectValues";
export { default as typedObjectEntries } from "./typedObjectEntries";
{
"name": "@psimk/typed-object",
"version": "1.0.1",
"version": "1.0.2",
"description": "typed versions of `Object` property methods",

@@ -10,2 +10,6 @@ "repository": "https://github.com/psimk/typed-object",

"module": "lib/esm/index.js",
"types": "lib/esm/index.d.js",
"files": [
"lib"
],
"scripts": {

@@ -12,0 +16,0 @@ "build": "rm -rf lib && run-p build:*",

@@ -24,3 +24,3 @@ # typed-object

const foo = { a: 1, b: 2, c: 4 };
const foo = { a: 1, b: 2, c: 3 };

@@ -37,11 +37,58 @@ Object.keys(foo); // string[]

```ts
import type { TypedObjectKeys } from "@psimk/typed-object";
import type { ObjectKeys } from "@psimk/typed-object";
const foo = { a: 1, b: 2, c: 4 };
const foo = { a: 1, b: 2, c: 3 } as const;
Object.keys(foo); // string[]
(Object.keys as TypedObjectKeys)(foo); // Array<"a" | "b" | "c">
(Object.keys as ObjectKeys)(foo); // Array<"a" | "b" | "c">
```
## API
- **ObjectKeys**
```ts
import { typedObjectKeys } from "@psimk/typed-object";
import type { ObjectKeys } from "@psimk/typed-object";
const foo = { a: 1, b: 2, c: 3 } as const;
Object.keys(foo); // string[]
typedObjectKeys(foo); // Array<"a" | "b" | "c">
// OR
(Object.keys as ObjectKeys)(foo); // Array<"a" | "b" | "c">
```
- **ObjectValues**
```ts
import { typedObjectValues } from "@psimk/typed-object";
import type { ObjectValues } from "@psimk/typed-object";
const foo = { a: 1, b: 2, c: 3 } as const;
Object.values(foo); // number[]
typedObjectValues(foo); // Array<1 | 2 | 3>
// OR
(Object.keys as ObjectValues)(foo); // Array<1 | 2 | 3>
```
- **ObjectEntries**
```ts
import { typedObjectEntries } from "@psimk/typed-object";
import type { ObjectEntries } from "@psimk/typed-object";
const foo = { a: 1, b: 2, c: 3 } as const;
Object.entries(foo); // number[]
typedObjectEntries(foo); // Array<["a", 1] | ["b", 2] | ["c", 4]>
// OR
(Object.keys as ObjectEntries)(foo); // Array<["a", 1] | ["b", 2] | ["c", 4]>
```
## Why?

@@ -48,0 +95,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc