mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
remove unused files
This commit is contained in:
parent
f427b763b8
commit
64677c2fe9
@ -51,8 +51,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vercel/commerce": "^0.0.1",
|
"@vercel/commerce": "^0.0.1",
|
||||||
"@vercel/fetch": "^6.1.1",
|
"@vercel/fetch": "^6.1.1",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8"
|
||||||
"immutability-helper": "^3.1.1"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"next": "^12",
|
"next": "^12",
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
import update, { Context } from 'immutability-helper'
|
|
||||||
|
|
||||||
const c = new Context()
|
|
||||||
|
|
||||||
c.extend('$auto', function (value, object) {
|
|
||||||
return object ? c.update(object, value) : c.update({}, value)
|
|
||||||
})
|
|
||||||
|
|
||||||
c.extend('$autoArray', function (value, object) {
|
|
||||||
return object ? c.update(object, value) : c.update([], value)
|
|
||||||
})
|
|
||||||
|
|
||||||
export default c.update
|
|
@ -1,21 +1,7 @@
|
|||||||
import update from './immutability'
|
|
||||||
import getSlug from './get-slug'
|
|
||||||
import type { PrCategory, CustomerAccountInput, Document } from '../../schema'
|
import type { PrCategory, CustomerAccountInput, Document } from '../../schema'
|
||||||
import { Page } from '../types/page';
|
import { Page } from '../types/page';
|
||||||
import { Customer } from '../types/customer'
|
import { Customer } from '../types/customer'
|
||||||
|
|
||||||
function normalizeProductOption(productOption: any) {
|
|
||||||
const {
|
|
||||||
node: { entityId, values: { edges = [] } = {}, ...rest },
|
|
||||||
} = productOption
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: entityId,
|
|
||||||
values: edges?.map(({ node }: any) => node),
|
|
||||||
...rest,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function normalizeProduct(productNode: any, config: any): any {
|
export function normalizeProduct(productNode: any, config: any): any {
|
||||||
const product = {
|
const product = {
|
||||||
id: productNode.productCode,
|
id: productNode.productCode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user