-
-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added String.truncate #4110
base: next-minor
Are you sure you want to change the base?
added String.truncate #4110
Conversation
🦋 Changeset detectedLatest commit: 70b6f09 The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
d2da73b
to
20f55ec
Compare
packages/effect/src/String.ts
Outdated
export const truncate: { | ||
( | ||
str: string, | ||
lengthOrOptions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just have an options object instead of a union. Also the member should be readonly
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
fe68352
to
7368257
Compare
cfe8926
to
1e2ee13
Compare
return str | ||
} | ||
|
||
let subString = str.slice(0, options.length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The omission length should be considered too.
37c2d0e
to
ce6e7df
Compare
f242776
to
e600b0a
Compare
e600b0a
to
8250215
Compare
23d5577
to
c992640
Compare
Closes #4103