Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 20, 2022
1 parent 87630a6 commit 472e736
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/config/normalize/lib/wild_wild_parser/tokens/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const equals = function (tokenA, tokenB) {
return Object.is(tokenA, tokenB)
}

export const ARRAY_TOKEN = {
export const INDEX_TOKEN = {
name: 'index',
testObject,
serialize,
Expand Down
4 changes: 2 additions & 2 deletions src/config/normalize/lib/wild_wild_parser/tokens/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ARRAY_TOKEN } from './array.js'
import { INDEX_TOKEN } from './array.js'
import { OTHER_TOKEN_TYPES } from './other.js'
import { PROP_TOKEN } from './prop.js'

Expand Down Expand Up @@ -30,4 +30,4 @@ export const getPathObjectTokenType = function (token) {
return PATH_TOKEN_TYPES.find((tokenType) => tokenType.testObject(token))
}

const PATH_TOKEN_TYPES = [ARRAY_TOKEN, PROP_TOKEN]
const PATH_TOKEN_TYPES = [INDEX_TOKEN, PROP_TOKEN]
4 changes: 2 additions & 2 deletions src/config/normalize/lib/wild_wild_parser/tokens/other.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ANY_TOKEN, ANY_DEEP_TOKEN } from './any.js'
import { ARRAY_TOKEN } from './array.js'
import { INDEX_TOKEN } from './array.js'
import { REGEXP_TOKEN } from './regexp.js'
import { SLICE_TOKEN } from './slice.js'

Expand All @@ -15,5 +15,5 @@ export const OTHER_TOKEN_TYPES = [
ANY_TOKEN,
REGEXP_TOKEN,
SLICE_TOKEN,
ARRAY_TOKEN,
INDEX_TOKEN,
]
8 changes: 4 additions & 4 deletions src/config/normalize/lib/wild_wild_parser/tokens/slice.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import isPlainObj from 'is-plain-obj'

import { ARRAY_TOKEN } from './array.js'
import { INDEX_TOKEN } from './array.js'

// Check the type of a parsed token.
const testObject = function (token) {
Expand All @@ -13,7 +13,7 @@ const testObject = function (token) {
}

const isEdge = function (edge) {
return edge === undefined || ARRAY_TOKEN.testObject(edge)
return edge === undefined || INDEX_TOKEN.testObject(edge)
}

// Serialize a token to a string
Expand All @@ -22,7 +22,7 @@ const serialize = function ({ from, to }) {
}

const serializeEdge = function (edge) {
return edge === undefined ? DEFAULT_EDGE_STRING : ARRAY_TOKEN.serialize(edge)
return edge === undefined ? DEFAULT_EDGE_STRING : INDEX_TOKEN.serialize(edge)
}

// Check the type of a serialized token
Expand All @@ -39,7 +39,7 @@ const parse = function (chars) {
}

const parseEdge = function (chars) {
return chars === DEFAULT_EDGE_STRING ? undefined : ARRAY_TOKEN.parse(chars)
return chars === DEFAULT_EDGE_STRING ? undefined : INDEX_TOKEN.parse(chars)
}

const DEFAULT_EDGE_STRING = ''
Expand Down
2 changes: 1 addition & 1 deletion src/config/normalize/lib/wild_wild_path/tokens/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getArrayIndex = function (value, token) {
: Math.max(value.length + token, 0)
}

export const ARRAY_TOKEN = {
export const INDEX_TOKEN = {
name: 'index',
array: true,
iterate,
Expand Down
4 changes: 2 additions & 2 deletions src/config/normalize/lib/wild_wild_path/tokens/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getTokenType as getTokenTypeName } from '../../wild_wild_parser/main.js

import { ANY_TOKEN } from './any.js'
import { ANY_DEEP_TOKEN } from './any_deep.js'
import { ARRAY_TOKEN } from './array.js'
import { INDEX_TOKEN } from './array.js'
import { PROP_TOKEN } from './prop.js'
import { REGEXP_TOKEN } from './regexp.js'
import { SLICE_TOKEN } from './slice.js'
Expand All @@ -16,7 +16,7 @@ export const getTokenType = function (token) {
const TOKEN_TYPES = {
[ANY_TOKEN.name]: ANY_TOKEN,
[ANY_DEEP_TOKEN.name]: ANY_DEEP_TOKEN,
[ARRAY_TOKEN.name]: ARRAY_TOKEN,
[INDEX_TOKEN.name]: INDEX_TOKEN,
[PROP_TOKEN.name]: PROP_TOKEN,
[REGEXP_TOKEN.name]: REGEXP_TOKEN,
[SLICE_TOKEN.name]: SLICE_TOKEN,
Expand Down

0 comments on commit 472e736

Please sign in to comment.