Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backup-restore/background/procedures/restore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export class BackupRestoreProcedure {

_blobFromPngString(s: string) {
const prefix = 'data:'
if (s.substr(0, prefix.length) !== prefix) {
if (s.slice(0, prefix.length) !== prefix) {
s = 'data:image/png;base64,' + s
}
return decodeBlob(s, {
Expand Down
10 changes: 5 additions & 5 deletions src/common-ui/components/TextInputControlled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export class SelectionModifiers {

static _lastWhitespace(current: SelectionState, cursorToMove: string) {
const lastWhitespaces: RegExpMatchArray = matchAll(
current.text.substr(0, current.selection[cursorToMove] - 1),
current.text.substring(0, current.selection[cursorToMove] - 1),
/(\s)/gm,
)
const lastWhitespaceArray = [...lastWhitespaces]
Expand All @@ -532,7 +532,7 @@ export class SelectionModifiers {

static _nextWhitespace(current: SelectionState, cursorToMove: string) {
const nextWhitespaces = matchAll(
current.text.substr(current.selection[cursorToMove] + 1),
current.text.slice(current.selection[cursorToMove] + 1),
/(\s)/gm,
)
const nextWhitespaceArray = [...nextWhitespaces] as RegExpMatchArray
Expand Down Expand Up @@ -617,7 +617,7 @@ export class SelectionModifiers {
static _distanceFromNewLine(current: SelectionState): number {
// find either a newline or the start if no prev newline
const lastNewline = current.text
.substr(0, current.selection.end)
.slice(0, current.selection.end)
.lastIndexOf('\n')
return lastNewline === -1
? current.selection.end
Expand All @@ -627,14 +627,14 @@ export class SelectionModifiers {
static _indexOfPreviousLine(current: SelectionState): number {
// find either a newline or the start if no prev newline
let previousNewLine = current.text
.substr(0, current.selection.end)
.slice(0, current.selection.end)
.lastIndexOf('\n')
if (previousNewLine === -1) {
return 0
} else {
// If we're on a newline boundary, actually find the one before
previousNewLine = current.text
.substr(0, previousNewLine)
.slice(0, previousNewLine)
.lastIndexOf('\n')
}

Expand Down
2 changes: 1 addition & 1 deletion src/common-ui/containers/IndexDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class IndexDropdownContainer extends Component<Props, State> {
const { hover, source } = this.props

// Make first letter capital
const sourceType = source.charAt(0).toUpperCase() + source.substr(1)
const sourceType = source.charAt(0).toUpperCase() + source.slice(1)
}
/**
* Selector for derived display tags state
Expand Down
2 changes: 1 addition & 1 deletion src/common-ui/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function uninsertTab({ el, tabStr = ' ' }: InsertTabProps) {
export function insertIndentedNewLine({ el }: InsertTabProps) {
const { value, selectionStart, selectionEnd } = el

let lineNo = value.substr(0, selectionStart).split(/\r?\n|\r/).length
let lineNo = value.slice(0, selectionStart).split(/\r?\n|\r/).length
let lineText = el.value.split(/\r?\n|\r/)[lineNo - 1]
let indentationCount = 0
let indentationString = ''
Expand Down
2 changes: 1 addition & 1 deletion src/page-analysis/extract-page-content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { transformPageHTML } from '@worldbrain/memex-stemmer/lib/transform-page-
describe('Extract page content', () => {
// beforeAll(() => {
// browser.extension = {
// getURL: rel => path.resolve('extension/lib', rel.substr(1)),
// getURL: rel => path.resolve('extension/lib', rel.slice(1)),
// }
// })

Expand Down
4 changes: 2 additions & 2 deletions src/search-injection/components/youtubeActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ export default class YoutubeButtonMenu extends React.Component<Props, State> {
const formatTimestamp = (seconds) => {
const date = new Date(0)
date.setSeconds(seconds)
const timeString = date.toISOString().substr(11, 8)
const timeString = date.toISOString().slice(11, 19)
return timeString.startsWith('00:')
? timeString.substr(3)
? timeString.slice(3)
: timeString
}

Expand Down