Skip to content

Commit

Permalink
Retrict default type of Pair.key
Browse files Browse the repository at this point in the history
  • Loading branch information
David Mesquita-Morris committed Dec 7, 2021
1 parent 497befc commit 614d597
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/node/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { Constructor, Consumer, Function, Operator, Predicate, Supplier } from './functions';
export { Pair } from './pair';
export * from './functions';
export * from './pair';
14 changes: 14 additions & 0 deletions lib/node/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
"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);
};
Object.defineProperty(exports, "__esModule", { value: true });
// function prototypes
__exportStar(require("./functions"), exports);
// data structures
__exportStar(require("./pair"), exports);
2 changes: 1 addition & 1 deletion lib/node/pair.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** A key/value pair. */
export interface Pair<TValue = any, TKey = keyof TValue> {
export interface Pair<TValue = any, TKey = Exclude<keyof TValue, symbol>> {
/** The key. */
key: TKey;
/** The value. */
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@steelbreeze/types",
"version": "1.0.0-rc.1",
"version": "1.0.0-rc.2",
"description": "Common TypeScript types used in development of other projects.",
"main": "./lib/node/index.js",
"types": "./lib/node/index.d.ts",
"directories": {
"lib": "lib"
},
Expand Down
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { Constructor, Consumer, Function, Operator, Predicate, Supplier } from './functions';
// function prototypes
export * from './functions';

export { Pair } from './pair';
// data structures
export * from './pair';
2 changes: 1 addition & 1 deletion src/pair.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** A key/value pair. */
export interface Pair<TValue = any, TKey = keyof TValue> {
export interface Pair<TValue = any, TKey = Exclude<keyof TValue, symbol>> {
/** The key. */
key: TKey;

Expand Down

0 comments on commit 614d597

Please sign in to comment.