move some utils
parent
39733ae72a
commit
6af6797f2c
|
@ -15,7 +15,7 @@ import { isCssContext } from '../util/css'
|
||||||
import { findLast, findJsxStrings, arrFindLast } from '../util/find'
|
import { findLast, findJsxStrings, arrFindLast } from '../util/find'
|
||||||
import { stringifyConfigValue, stringifyCss } from '../util/stringify'
|
import { stringifyConfigValue, stringifyCss } from '../util/stringify'
|
||||||
import { stringifyScreen, Screen } from '../util/screens'
|
import { stringifyScreen, Screen } from '../util/screens'
|
||||||
import isObject from '../util/isObject'
|
import isObject from '../../util/isObject'
|
||||||
import * as emmetHelper from 'vscode-emmet-helper-bundled'
|
import * as emmetHelper from 'vscode-emmet-helper-bundled'
|
||||||
import { isValidLocationForEmmetAbbreviation } from '../util/isValidLocationForEmmetAbbreviation'
|
import { isValidLocationForEmmetAbbreviation } from '../util/isValidLocationForEmmetAbbreviation'
|
||||||
import { getDocumentSettings } from '../util/getDocumentSettings'
|
import { getDocumentSettings } from '../util/getDocumentSettings'
|
||||||
|
@ -23,7 +23,7 @@ import { isJsContext } from '../util/js'
|
||||||
import { naturalExpand } from '../util/naturalExpand'
|
import { naturalExpand } from '../util/naturalExpand'
|
||||||
import semver from 'semver'
|
import semver from 'semver'
|
||||||
import { docsUrl } from '../util/docsUrl'
|
import { docsUrl } from '../util/docsUrl'
|
||||||
import { ensureArray } from '../util/array'
|
import { ensureArray } from '../../util/array'
|
||||||
|
|
||||||
function completionsFromClassList(
|
function completionsFromClassList(
|
||||||
state: State,
|
state: State,
|
||||||
|
|
|
@ -2,7 +2,7 @@ const dlv = require('dlv')
|
||||||
import { State } from './state'
|
import { State } from './state'
|
||||||
import removeMeta from './removeMeta'
|
import removeMeta from './removeMeta'
|
||||||
import { TinyColor } from '@ctrl/tinycolor'
|
import { TinyColor } from '@ctrl/tinycolor'
|
||||||
import { ensureArray, dedupe, flatten } from './array'
|
import { ensureArray, dedupe, flatten } from '../../util/array'
|
||||||
|
|
||||||
const COLOR_PROPS = [
|
const COLOR_PROPS = [
|
||||||
'caret-color',
|
'caret-color',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import isObject from './isObject'
|
import isObject from '../../util/isObject'
|
||||||
|
|
||||||
export default function removeMeta(obj: any): any {
|
export default function removeMeta(obj: any): any {
|
||||||
let result = {}
|
let result = {}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import isObject from './isObject'
|
import isObject from '../../util/isObject'
|
||||||
|
|
||||||
export type MinMaxScreen = {
|
export type MinMaxScreen = {
|
||||||
min?: string
|
min?: string
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import removeMeta from './removeMeta'
|
import removeMeta from './removeMeta'
|
||||||
const dlv = require('dlv')
|
const dlv = require('dlv')
|
||||||
import escapeClassName from 'css.escape'
|
import escapeClassName from 'css.escape'
|
||||||
import { ensureArray } from './array'
|
import { ensureArray } from '../../util/array'
|
||||||
|
|
||||||
export function stringifyConfigValue(x: any): string {
|
export function stringifyConfigValue(x: any): string {
|
||||||
if (typeof x === 'string') return x
|
if (typeof x === 'string') return x
|
||||||
|
|
|
@ -9,3 +9,10 @@ export function ensureArray<T>(value: T | T[]): T[] {
|
||||||
export function flatten<T>(arrays: T[][]): T[] {
|
export function flatten<T>(arrays: T[][]): T[] {
|
||||||
return [].concat.apply([], arrays)
|
return [].concat.apply([], arrays)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function equal(arr1: any[], arr2: any[]): boolean {
|
||||||
|
return (
|
||||||
|
JSON.stringify(arr1.concat([]).sort()) ===
|
||||||
|
JSON.stringify(arr2.concat([]).sort())
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue