Skip to content

Commit

Permalink
9.2.1 (#732)
Browse files Browse the repository at this point in the history
* chore@small

* log

* fix: view.or typings

* fix lensSatisfies

* chore@small

* feat@fix issue

* fix dtslint issue

* feat@pin dep
  • Loading branch information
selfrefactor authored May 29, 2024
1 parent 4b77a89 commit 53a0dc6
Show file tree
Hide file tree
Showing 14 changed files with 1,388 additions and 1,983 deletions.
6 changes: 5 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18530,7 +18530,11 @@ describe('R.zipWith', () => {

## ❯ CHANGELOG

9.1.2
9.2.1

- Broken `Deno` build - [Issue #731](https://github.com/selfrefactor/rambda/issues/731)

9.2.0

- `R.once` TS type definition miss to context argument and its type - [Issue #728](https://github.com/selfrefactor/rambda/issues/728)

Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
9.1.2
9.2.1

- Broken `Deno` build - [Issue #731](https://github.com/selfrefactor/rambda/issues/731)

9.2.0

- `R.once` TS type definition miss to context argument and its type - [Issue #728](https://github.com/selfrefactor/rambda/issues/728)

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17220,7 +17220,11 @@ describe('R.zipWith', () => {

## ❯ CHANGELOG

9.1.2
9.2.1

- Broken `Deno` build - [Issue #731](https://github.com/selfrefactor/rambda/issues/731)

9.2.0

- `R.once` TS type definition miss to context argument and its type - [Issue #728](https://github.com/selfrefactor/rambda/issues/728)

Expand Down
28 changes: 14 additions & 14 deletions dist/rambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,20 @@ function _objectSpread2(e) {
}
return e;
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Expand All @@ -869,20 +883,6 @@ function _defineProperty(obj, key, value) {
}
return obj;
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}

function compare(a, b) {
return String(a) === String(b);
Expand Down
2 changes: 1 addition & 1 deletion dist/rambda.umd.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17220,7 +17220,11 @@ describe('R.zipWith', () => {

## ❯ CHANGELOG

9.1.2
9.2.1

- Broken `Deno` build - [Issue #731](https://github.com/selfrefactor/rambda/issues/731)

9.2.0

- `R.once` TS type definition miss to context argument and its type - [Issue #728](https://github.com/selfrefactor/rambda/issues/728)

Expand Down
42 changes: 42 additions & 0 deletions files/NEXT_VERSION_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,46 @@
---
viewor
lenssatisfies
lensor
---
run immutable script
---
warning package.json: No license field
$ tsc --lib esnext,dom consume-typings.ts&&node consume-typings.js
node_modules/rambdax/index.d.ts:1221:73 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

1221 export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens, input: U): boolean;
~~~~

node_modules/rambdax/index.d.ts:1222:73 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

1222 export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens): (input: U) => boolean;
~~~~

node_modules/rambdax/index.d.ts:1223:70 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

1223 export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens, input: T[]): boolean;
~~~~

node_modules/rambdax/index.d.ts:1224:70 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

1224 export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens): (input: T[]) => boolean;
~~~~

node_modules/rambdax/index.d.ts:2461:63 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

2461 export function viewOr<Input, Output>(fallback: Output, lens: Lens, input: Input): Output;
~~~~

node_modules/rambdax/index.d.ts:2462:63 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

2462 export function viewOr<Input, Output>(fallback: Output, lens: Lens): (input: Input) => Output;
~~~~

node_modules/rambdax/index.d.ts:2463:65 - error TS2314: Generic type 'Lens' requires 2 type argument(s).

2463 export function viewOr<Input, Output>(fallback: Output): (lens: Lens) => (input: Input) => Output;

---
https://developer.mozilla.org/en-US/docs/Web/API/structuredClone
---
Expand Down
13 changes: 6 additions & 7 deletions files/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7758,10 +7758,10 @@ Notes: Idea for this method comes from `ramda-adjunct` library
*/
// @SINGLE_MARKER
export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens, input: U): boolean;
export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens): (input: U) => boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens, input: T[]): boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens): (input: T[]) => boolean;
export function lensSatisfies<PredicateInput, Input>(predicate: (x: PredicateInput) => boolean, lens: Lens<PredicateInput, Input>, input: Input): boolean;
export function lensSatisfies<PredicateInput, Input>(predicate: (x: PredicateInput) => boolean, lens: Lens<PredicateInput, Input>): (input: Input) => boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens<T[], T>, input: T[]): boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens<T[], T>): (input: T[]) => boolean;

/*
Method: viewOr
Expand Down Expand Up @@ -7789,9 +7789,8 @@ Notes: Idea for this method comes from `@meltwater/phi` library
*/
// @SINGLE_MARKER
export function viewOr<Input, Output>(fallback: Output, lens: Lens, input: Input): Output;
export function viewOr<Input, Output>(fallback: Output, lens: Lens): (input: Input) => Output;
export function viewOr<Input, Output>(fallback: Output): (lens: Lens) => (input: Input) => Output;
export function viewOr<Input, Output>(fallback: Output, lens: Lens<Input, Output>, input: Input): Output;
export function viewOr<Input, Output>(fallback: Output, lens: Lens<Input, Output>): (input: Input) => Output;

/*
Method: sortByPath
Expand Down
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "rambda",
"version": "9.2.0",
"scripts": {
"before": "yarn out && yarn docs",
"benchmark": "cd ../rambda-scripts && RAMBDA_RUN_ALL=ON RAMBDA_RUN_INDEXES=ON yarn benchmark",
"benchmark:all": "yarn build:step && cd ../rambda-scripts && yarn benchmark:all",
"benchmark:check": "yarn build:step && METHOD=compose yarn benchmark:check:apply",
Expand All @@ -22,7 +23,6 @@
"lint:staged": "cd ../rambda-scripts && yarn lint:staged",
"new": "cd ../rambda-scripts && yarn new",
"out": "yarn populatedocs && yarn populatereadme && yarn immutable && yarn build",
"before": "yarn out && yarn docs",
"populatedocs": "cd ../rambda-scripts && yarn populate:docs",
"populatedocs:x": "cd ../rambda-scripts && yarn populate:docs:rambdax",
"populatereadme": "cd ../rambda-scripts && yarn populate:readme",
Expand All @@ -37,35 +37,38 @@
"usedby": "cd ../rambda-scripts && yarn usedby",
"x": "yarn populatedocs:x && yarn populatereadme:x && yarn immutable:x"
},
"depFn": [
"@definitelytyped/dtslint"
],
"dependencies": {

},
"devDependencies": {
"@babel/core": "7.24.4",
"@babel/core": "7.24.6",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/preset-env": "7.24.4",
"@definitelytyped/dtslint": "0.2.19",
"@babel/preset-env": "7.24.6",
"@definitelytyped/dtslint": "0.0.182",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-commonjs": "25.0.8",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.5",
"@types/jest": "29.5.12",
"combinate": "1.1.11",
"cross-env": "7.0.3",
"fast-check": "3.17.1",
"fast-check": "3.19.0",
"helpers-fn": "1.8.1",
"is-ci": "3.0.1",
"jest": "29.7.0",
"jest-extended": "4.0.2",
"lodash": "4.17.21",
"rambdax": "11.0.0",
"ramda": "0.29.1",
"rollup": "4.14.0",
"rambdax": "11.1.1",
"ramda": "0.30.0",
"rollup": "4.18.0",
"rollup-plugin-cleanup": "3.2.1",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-uglify": "6.0.4",
"types-ramda": "0.29.10",
"typescript": "5.4.4"
"types-ramda": "0.30.0",
"typescript": "5.4.5"
},
"jest": {
"testEnvironment": "node",
Expand Down
12 changes: 6 additions & 6 deletions source/hasIn.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { propFn } from "./prop";
import { propFn } from './prop.js';

export function hasIn(searchProperty, obj) {
if (arguments.length === 1){
return (_obj) => hasIn(searchProperty, _obj);
}
if (arguments.length === 1) {
return (_obj) => hasIn(searchProperty, _obj);
}

return propFn(searchProperty, obj) !== undefined
}
return propFn(searchProperty, obj) !== undefined;
}
6 changes: 3 additions & 3 deletions source/lensSatisfies-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {lensSatisfies, lensIndex, lensPath} from 'rambda'
describe('R.lensSatisfies', () => {
it('with list', () => {
const list = [1, 2, 3]
const lens = lensIndex(0)
const lens = lensIndex<number>(0)
const predicate = (x: number) => x > 2
const result = lensSatisfies<number>(predicate, lens, list)
const result = lensSatisfies(predicate, lens, list)
result // $ExpectType boolean

const curriedResult = lensSatisfies<number>(predicate, lens)(list)
const curriedResult = lensSatisfies(predicate, lens)(list)
curriedResult // $ExpectType boolean
})
it('with object', () => {
Expand Down
26 changes: 17 additions & 9 deletions source/viewOr-spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
import {viewOr, lensProp} from 'rambda'

const input = {a: 1}
const input = {a: 1, b:2}
interface Input {
a: number,
b?: number,
b: number,
}
const lens = lensProp<Input, 'b'>('b')

describe('R.viewOr', () => {
it('require explicit types', () => {
const result = viewOr<Input, number>(4, lens, input)
describe('R.viewOr - no explicit types', () => {
it('no curried inputs', () => {
const result = viewOr(4, lens, input)

result // $ExpectType number
})
it('curry 1', () => {
const result = viewOr<Input, number>(4, lens)(input)
it('curried inputs', () => {
const result = viewOr(4, lens)(input)

result // $ExpectType number
})
it('curry 2', () => {
const result = viewOr<Input, number>(4)(lens)(input)
})

describe('R.viewOr - explicit types', () => {
it('no curried inputs', () => {
const result = viewOr<Input, number>(4, lens, input)

result // $ExpectType number
})
it('curried inputs', () => {
const result = viewOr<Input, number>(4, lens)(input)

result // $ExpectType number
})
Expand Down
12 changes: 6 additions & 6 deletions src/hasIn.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { propFn } from "./prop";
import { propFn } from './prop.js';

export function hasIn(searchProperty, obj) {
if (arguments.length === 1){
return (_obj) => hasIn(searchProperty, _obj);
}
if (arguments.length === 1) {
return (_obj) => hasIn(searchProperty, _obj);
}

return propFn(searchProperty, obj) !== undefined
}
return propFn(searchProperty, obj) !== undefined;
}
Loading

0 comments on commit 53a0dc6

Please sign in to comment.