@cyberskill/shared 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/commitlint/index.js +1 -0
- package/dist/config/commitlint/index.js.map +1 -0
- package/dist/config/config.type.js +1 -0
- package/dist/config/config.type.js.map +1 -0
- package/dist/config/config.util.js +4 -2
- package/dist/config/config.util.js.map +1 -0
- package/dist/config/env/env.constant.js +1 -0
- package/dist/config/env/env.constant.js.map +1 -0
- package/dist/config/env/env.util.js +1 -0
- package/dist/config/env/env.util.js.map +1 -0
- package/dist/config/env/index.js +1 -0
- package/dist/config/env/index.js.map +1 -0
- package/dist/config/eslint/index.js +1 -0
- package/dist/config/eslint/index.js.map +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js.map +1 -0
- package/dist/config/graphql-codegen/index.js +1 -0
- package/dist/config/graphql-codegen/index.js.map +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/lint-staged/index.js +1 -0
- package/dist/config/lint-staged/index.js.map +1 -0
- package/dist/config/storybook/index.js +1 -0
- package/dist/config/storybook/index.js.map +1 -0
- package/dist/config/storybook/storybook.main.js +1 -0
- package/dist/config/storybook/storybook.main.js.map +1 -0
- package/dist/config/storybook/storybook.preview.d.ts +1 -1
- package/dist/config/storybook/storybook.preview.js +6 -4
- package/dist/config/storybook/storybook.preview.js.map +1 -0
- package/dist/config/vitest/index.js +1 -0
- package/dist/config/vitest/index.js.map +1 -0
- package/dist/config/vitest/vitest.e2e.d.ts +2 -0
- package/dist/config/vitest/vitest.e2e.js +12 -18
- package/dist/config/vitest/vitest.e2e.js.map +1 -0
- package/dist/config/vitest/vitest.unit.d.ts +2 -0
- package/dist/config/vitest/vitest.unit.js +8 -5
- package/dist/config/vitest/vitest.unit.js.map +1 -0
- package/dist/constant/common.js +1 -0
- package/dist/constant/common.js.map +1 -0
- package/dist/constant/index.js +1 -0
- package/dist/constant/index.js.map +1 -0
- package/dist/constant/response-status.js +1 -0
- package/dist/constant/response-status.js.map +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +1 -0
- package/dist/node/apollo-server/apollo-server.util.js.map +1 -0
- package/dist/node/apollo-server/index.js +1 -0
- package/dist/node/apollo-server/index.js.map +1 -0
- package/dist/node/cli/index.js +56 -45
- package/dist/node/cli/index.js.map +1 -0
- package/dist/node/command/command.type.js +1 -0
- package/dist/node/command/command.type.js.map +1 -0
- package/dist/node/command/command.util.js +107 -99
- package/dist/node/command/command.util.js.map +1 -0
- package/dist/node/command/index.js +1 -0
- package/dist/node/command/index.js.map +1 -0
- package/dist/node/express/express.type.d.ts +4 -0
- package/dist/node/express/express.util.js +49 -31
- package/dist/node/express/express.util.js.map +1 -0
- package/dist/node/express/index.js +1 -0
- package/dist/node/express/index.js.map +1 -0
- package/dist/node/fs/fs.util.js +1 -0
- package/dist/node/fs/fs.util.js.map +1 -0
- package/dist/node/fs/index.js +1 -0
- package/dist/node/fs/index.js.map +1 -0
- package/dist/node/log/index.js +1 -0
- package/dist/node/log/index.js.map +1 -0
- package/dist/node/log/log.type.js +1 -0
- package/dist/node/log/log.type.js.map +1 -0
- package/dist/node/log/log.util.js +1 -0
- package/dist/node/log/log.util.js.map +1 -0
- package/dist/node/mongo/index.d.ts +2 -0
- package/dist/node/mongo/index.js +21 -12
- package/dist/node/mongo/index.js.map +1 -0
- package/dist/node/mongo/mongo.constant.js +1 -0
- package/dist/node/mongo/mongo.constant.js.map +1 -0
- package/dist/node/mongo/mongo.controller.d.ts +5 -315
- package/dist/node/mongo/mongo.controller.mongoose.d.ts +234 -0
- package/dist/node/mongo/mongo.controller.mongoose.js +468 -0
- package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -0
- package/dist/node/mongo/mongo.controller.native.d.ts +84 -0
- package/dist/node/mongo/mongo.controller.native.js +214 -0
- package/dist/node/mongo/mongo.controller.native.js.map +1 -0
- package/dist/node/mongo/mongo.dynamic-populate.d.ts +61 -0
- package/dist/node/mongo/mongo.dynamic-populate.js +197 -0
- package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -0
- package/dist/node/mongo/mongo.populate.d.ts +15 -0
- package/dist/node/mongo/mongo.populate.js +269 -0
- package/dist/node/mongo/mongo.populate.js.map +1 -0
- package/dist/node/mongo/mongo.type.js +1 -0
- package/dist/node/mongo/mongo.type.js.map +1 -0
- package/dist/node/mongo/mongo.util.d.ts +52 -0
- package/dist/node/mongo/mongo.util.js +106 -363
- package/dist/node/mongo/mongo.util.js.map +1 -0
- package/dist/node/package/index.js +1 -0
- package/dist/node/package/index.js.map +1 -0
- package/dist/node/package/package.type.js +1 -0
- package/dist/node/package/package.type.js.map +1 -0
- package/dist/node/package/package.util.js +20 -20
- package/dist/node/package/package.util.js.map +1 -0
- package/dist/node/path/index.js +1 -0
- package/dist/node/path/index.js.map +1 -0
- package/dist/node/path/path.constant.js +10 -9
- package/dist/node/path/path.constant.js.map +1 -0
- package/dist/node/path/path.util.js +1 -0
- package/dist/node/path/path.util.js.map +1 -0
- package/dist/node/storage/index.js +1 -0
- package/dist/node/storage/index.js.map +1 -0
- package/dist/node/storage/storage.constant.js +1 -0
- package/dist/node/storage/storage.constant.js.map +1 -0
- package/dist/node/storage/storage.util.js +1 -0
- package/dist/node/storage/storage.util.js.map +1 -0
- package/dist/node/upload/index.js +1 -0
- package/dist/node/upload/index.js.map +1 -0
- package/dist/node/upload/upload.constant.js +1 -0
- package/dist/node/upload/upload.constant.js.map +1 -0
- package/dist/node/upload/upload.type.js +1 -0
- package/dist/node/upload/upload.type.js.map +1 -0
- package/dist/node/upload/upload.util.js +1 -0
- package/dist/node/upload/upload.util.js.map +1 -0
- package/dist/node/ws/index.d.ts +1 -1
- package/dist/node/ws/index.js +2 -1
- package/dist/node/ws/index.js.map +1 -0
- package/dist/node/ws/{ts.util.js → ws.util.js} +1 -0
- package/dist/node/ws/ws.util.js.map +1 -0
- package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +1 -0
- package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.component.js +1 -0
- package/dist/react/apollo-client/apollo-client.component.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.constant.js +1 -0
- package/dist/react/apollo-client/apollo-client.constant.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.context.js +1 -0
- package/dist/react/apollo-client/apollo-client.context.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.module.scss.js +1 -0
- package/dist/react/apollo-client/apollo-client.module.scss.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.util.js +14 -13
- package/dist/react/apollo-client/apollo-client.util.js.map +1 -0
- package/dist/react/apollo-client/index.js +1 -0
- package/dist/react/apollo-client/index.js.map +1 -0
- package/dist/react/apollo-client/links/index.js +1 -0
- package/dist/react/apollo-client/links/index.js.map +1 -0
- package/dist/react/apollo-client/links/upload.js +1 -0
- package/dist/react/apollo-client/links/upload.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js.map +1 -0
- package/dist/react/apollo-client-nextjs/index.js +1 -0
- package/dist/react/apollo-client-nextjs/index.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +23 -21
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.context.js +1 -0
- package/dist/react/apollo-error/apollo-error.context.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.js +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.provider.js +1 -0
- package/dist/react/apollo-error/apollo-error.provider.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +1 -0
- package/dist/react/apollo-error/apollo-error.util.js.map +1 -0
- package/dist/react/apollo-error/index.js +1 -0
- package/dist/react/apollo-error/index.js.map +1 -0
- package/dist/react/i18next/i18next.hook.js +1 -0
- package/dist/react/i18next/i18next.hook.js.map +1 -0
- package/dist/react/i18next/i18next.util.js +1 -0
- package/dist/react/i18next/i18next.util.js.map +1 -0
- package/dist/react/i18next/index.js +1 -0
- package/dist/react/i18next/index.js.map +1 -0
- package/dist/react/loading/index.js +1 -0
- package/dist/react/loading/index.js.map +1 -0
- package/dist/react/loading/loading.component.js +1 -0
- package/dist/react/loading/loading.component.js.map +1 -0
- package/dist/react/loading/loading.context.js +1 -0
- package/dist/react/loading/loading.context.js.map +1 -0
- package/dist/react/loading/loading.hook.js +1 -0
- package/dist/react/loading/loading.hook.js.map +1 -0
- package/dist/react/loading/loading.module.scss.js +1 -0
- package/dist/react/loading/loading.module.scss.js.map +1 -0
- package/dist/react/loading/loading.provider.js +1 -0
- package/dist/react/loading/loading.provider.js.map +1 -0
- package/dist/react/log/index.js +1 -0
- package/dist/react/log/index.js.map +1 -0
- package/dist/react/log/log.util.js +1 -0
- package/dist/react/log/log.util.js.map +1 -0
- package/dist/react/next-intl/index.js +1 -0
- package/dist/react/next-intl/index.js.map +1 -0
- package/dist/react/next-intl/next-intl.constant.js +1 -0
- package/dist/react/next-intl/next-intl.constant.js.map +1 -0
- package/dist/react/next-intl/next-intl.context.js +1 -0
- package/dist/react/next-intl/next-intl.context.js.map +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +1 -0
- package/dist/react/next-intl/next-intl.hoc.js.map +1 -0
- package/dist/react/next-intl/next-intl.hook.js +1 -0
- package/dist/react/next-intl/next-intl.hook.js.map +1 -0
- package/dist/react/next-intl/next-intl.provider.js +1 -0
- package/dist/react/next-intl/next-intl.provider.js.map +1 -0
- package/dist/react/storage/index.js +1 -0
- package/dist/react/storage/index.js.map +1 -0
- package/dist/react/storage/storage.hook.js +1 -0
- package/dist/react/storage/storage.hook.js.map +1 -0
- package/dist/react/storage/storage.util.js +1 -0
- package/dist/react/storage/storage.util.js.map +1 -0
- package/dist/react/toast/index.js +1 -0
- package/dist/react/toast/index.js.map +1 -0
- package/dist/react/userback/index.js +1 -0
- package/dist/react/userback/index.js.map +1 -0
- package/dist/react/userback/userback.component.js +1 -0
- package/dist/react/userback/userback.component.js.map +1 -0
- package/dist/typescript/common.type.js +1 -0
- package/dist/typescript/common.type.js.map +1 -0
- package/dist/typescript/index.js +1 -0
- package/dist/typescript/index.js.map +1 -0
- package/dist/util/common/common.util.js +27 -25
- package/dist/util/common/common.util.js.map +1 -0
- package/dist/util/common/index.js +1 -0
- package/dist/util/common/index.js.map +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/object/index.js +1 -0
- package/dist/util/object/index.js.map +1 -0
- package/dist/util/object/object.util.js +50 -49
- package/dist/util/object/object.util.js.map +1 -0
- package/dist/util/serializer/index.js +1 -0
- package/dist/util/serializer/index.js.map +1 -0
- package/dist/util/serializer/serializer.util.js +13 -12
- package/dist/util/serializer/serializer.util.js.map +1 -0
- package/dist/util/string/index.js +1 -0
- package/dist/util/string/index.js.map +1 -0
- package/dist/util/string/string.util.js +30 -28
- package/dist/util/string/string.util.js.map +1 -0
- package/dist/util/validate/index.js +1 -0
- package/dist/util/validate/index.js.map +1 -0
- package/dist/util/validate/validate.util.d.ts +0 -4
- package/dist/util/validate/validate.util.js +4 -3
- package/dist/util/validate/validate.util.js.map +1 -0
- package/package.json +68 -95
- package/public/tsconfig.base.json +1 -1
- package/dist/config/commitlint/index.cjs +0 -1
- package/dist/config/config.type.cjs +0 -1
- package/dist/config/config.util.cjs +0 -1
- package/dist/config/env/env.constant.cjs +0 -1
- package/dist/config/env/env.util.cjs +0 -1
- package/dist/config/env/index.cjs +0 -1
- package/dist/config/eslint/index.cjs +0 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
- package/dist/config/graphql-codegen/index.cjs +0 -1
- package/dist/config/index.cjs +0 -1
- package/dist/config/lint-staged/index.cjs +0 -1
- package/dist/config/storybook/index.cjs +0 -1
- package/dist/config/storybook/storybook.main.cjs +0 -1
- package/dist/config/storybook/storybook.preview.cjs +0 -1
- package/dist/config/vitest/index.cjs +0 -1
- package/dist/config/vitest/vitest.e2e.cjs +0 -1
- package/dist/config/vitest/vitest.unit.cjs +0 -1
- package/dist/constant/common.cjs +0 -1
- package/dist/constant/index.cjs +0 -1
- package/dist/constant/response-status.cjs +0 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +0 -1
- package/dist/node/apollo-server/index.cjs +0 -1
- package/dist/node/cli/index.cjs +0 -3
- package/dist/node/command/command.type.cjs +0 -1
- package/dist/node/command/command.util.cjs +0 -2
- package/dist/node/command/index.cjs +0 -1
- package/dist/node/express/express.util.cjs +0 -1
- package/dist/node/express/index.cjs +0 -1
- package/dist/node/fs/fs.util.cjs +0 -4
- package/dist/node/fs/index.cjs +0 -1
- package/dist/node/log/index.cjs +0 -1
- package/dist/node/log/log.type.cjs +0 -1
- package/dist/node/log/log.util.cjs +0 -1
- package/dist/node/mongo/index.cjs +0 -1
- package/dist/node/mongo/mongo.constant.cjs +0 -1
- package/dist/node/mongo/mongo.controller.cjs +0 -1
- package/dist/node/mongo/mongo.controller.js +0 -858
- package/dist/node/mongo/mongo.controller.test.unit.d.ts +0 -1
- package/dist/node/mongo/mongo.type.cjs +0 -1
- package/dist/node/mongo/mongo.util.cjs +0 -2
- package/dist/node/mongo/mongo.util.test.unit.d.ts +0 -1
- package/dist/node/package/index.cjs +0 -1
- package/dist/node/package/package.type.cjs +0 -1
- package/dist/node/package/package.util.cjs +0 -1
- package/dist/node/path/index.cjs +0 -1
- package/dist/node/path/path.constant.cjs +0 -1
- package/dist/node/path/path.test.unit.d.ts +0 -1
- package/dist/node/path/path.util.cjs +0 -1
- package/dist/node/storage/index.cjs +0 -1
- package/dist/node/storage/storage.constant.cjs +0 -1
- package/dist/node/storage/storage.util.cjs +0 -1
- package/dist/node/upload/index.cjs +0 -1
- package/dist/node/upload/upload.constant.cjs +0 -1
- package/dist/node/upload/upload.type.cjs +0 -1
- package/dist/node/upload/upload.util.cjs +0 -1
- package/dist/node/ws/index.cjs +0 -1
- package/dist/node/ws/ts.util.cjs +0 -1
- package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.component.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.constant.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.context.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.module.scss.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.util.cjs +0 -1
- package/dist/react/apollo-client/index.cjs +0 -1
- package/dist/react/apollo-client/links/index.cjs +0 -1
- package/dist/react/apollo-client/links/upload.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
- package/dist/react/apollo-client-nextjs/index.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.component.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.context.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.hook.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.provider.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.test.unit.d.ts +0 -1
- package/dist/react/apollo-error/apollo-error.util.cjs +0 -1
- package/dist/react/apollo-error/index.cjs +0 -1
- package/dist/react/i18next/i18next.hook.cjs +0 -1
- package/dist/react/i18next/i18next.util.cjs +0 -1
- package/dist/react/i18next/index.cjs +0 -1
- package/dist/react/loading/index.cjs +0 -1
- package/dist/react/loading/loading.component.cjs +0 -6
- package/dist/react/loading/loading.context.cjs +0 -1
- package/dist/react/loading/loading.hook.cjs +0 -1
- package/dist/react/loading/loading.module.scss.cjs +0 -1
- package/dist/react/loading/loading.provider.cjs +0 -1
- package/dist/react/loading/loading.test.unit.d.ts +0 -1
- package/dist/react/log/index.cjs +0 -1
- package/dist/react/log/log.util.cjs +0 -1
- package/dist/react/next-intl/index.cjs +0 -1
- package/dist/react/next-intl/next-intl.constant.cjs +0 -1
- package/dist/react/next-intl/next-intl.context.cjs +0 -1
- package/dist/react/next-intl/next-intl.hoc.cjs +0 -1
- package/dist/react/next-intl/next-intl.hook.cjs +0 -1
- package/dist/react/next-intl/next-intl.provider.cjs +0 -1
- package/dist/react/storage/index.cjs +0 -1
- package/dist/react/storage/storage.hook.cjs +0 -1
- package/dist/react/storage/storage.util.cjs +0 -1
- package/dist/react/toast/index.cjs +0 -1
- package/dist/react/userback/index.cjs +0 -1
- package/dist/react/userback/userback.component.cjs +0 -1
- package/dist/typescript/common.type.cjs +0 -1
- package/dist/typescript/index.cjs +0 -1
- package/dist/util/common/common.test.unit.d.ts +0 -1
- package/dist/util/common/common.util.cjs +0 -1
- package/dist/util/common/index.cjs +0 -1
- package/dist/util/index.cjs +0 -1
- package/dist/util/object/index.cjs +0 -1
- package/dist/util/object/object.test.unit.d.ts +0 -1
- package/dist/util/object/object.util.cjs +0 -1
- package/dist/util/serializer/index.cjs +0 -1
- package/dist/util/serializer/serializer.test.unit.d.ts +0 -1
- package/dist/util/serializer/serializer.util.cjs +0 -1
- package/dist/util/string/index.cjs +0 -1
- package/dist/util/string/string.test.unit.d.ts +0 -1
- package/dist/util/string/string.util.cjs +0 -1
- package/dist/util/validate/index.cjs +0 -1
- package/dist/util/validate/validate.test.unit.d.ts +0 -1
- package/dist/util/validate/validate.util.cjs +0 -1
- /package/dist/node/ws/{ts.util.d.ts → ws.util.d.ts} +0 -0
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { removeAccent as
|
|
2
|
-
|
|
1
|
+
import { removeAccent as l } from "../common/common.util.js";
|
|
2
|
+
const u = /[^a-z0-9\s-]/gi, g = /[\s-]+/g, m = /^-+|-+$/g, h = /-/g, R = /[?#]/;
|
|
3
|
+
function d(e, n) {
|
|
3
4
|
let t = e.trim();
|
|
4
|
-
return t =
|
|
5
|
+
return t = l(t), n?.lower !== !1 && (t = t.toLowerCase()), t = t.replace(u, " "), t = t.replace(g, "-"), t = t.replace(m, ""), t;
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
const t = (r) =>
|
|
7
|
+
function E(e, n) {
|
|
8
|
+
const t = (r) => d(r ?? "", n);
|
|
8
9
|
if (typeof e == "object" && e !== null) {
|
|
9
10
|
const r = {};
|
|
10
|
-
for (const [o,
|
|
11
|
-
r[o] = t(
|
|
11
|
+
for (const [o, s] of Object.entries(e))
|
|
12
|
+
r[o] = t(s);
|
|
12
13
|
return r;
|
|
13
14
|
}
|
|
14
15
|
return t(e);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function _(e, n = 4) {
|
|
17
18
|
let t = 2166136261;
|
|
18
19
|
for (let o = 0; o < e.length; o++)
|
|
19
20
|
t ^= e.charCodeAt(o), t = Math.imul(t, 16777619);
|
|
20
21
|
const r = (t >>> 0).toString(16).padStart(8, "0");
|
|
21
|
-
return n > 8 ? e.replace(
|
|
22
|
+
return n > 8 ? e.replace(h, "").slice(0, n) : r.slice(0, n);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function c(e, n) {
|
|
24
25
|
const t = Math.floor(4294967296 / n.length) * n.length, r = [], o = 16384;
|
|
25
26
|
for (; r.length < e; ) {
|
|
26
|
-
const
|
|
27
|
-
crypto.getRandomValues(
|
|
28
|
-
for (const a of
|
|
27
|
+
const s = e - r.length, f = s > o ? o : s, i = new Uint32Array(f);
|
|
28
|
+
crypto.getRandomValues(i);
|
|
29
|
+
for (const a of i) {
|
|
29
30
|
if (r.length >= e)
|
|
30
31
|
break;
|
|
31
32
|
a < t && r.push(n[a % n.length]);
|
|
@@ -33,37 +34,38 @@ function f(e, n) {
|
|
|
33
34
|
}
|
|
34
35
|
return r.join("");
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function A(e = 8) {
|
|
37
38
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
38
39
|
throw new RangeError("length must be a non-negative safe integer");
|
|
39
|
-
return
|
|
40
|
+
return c(e, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?");
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function b(e = 8, n = "abcdefghijklmnopqrstuvwxyz0123456789") {
|
|
42
43
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
43
44
|
throw new RangeError("length must be a non-negative safe integer");
|
|
44
45
|
if (n.length === 0 || n.length > 2 ** 32)
|
|
45
46
|
throw new RangeError("charset.length must be between 1 and 2^32");
|
|
46
|
-
return
|
|
47
|
+
return c(e, n);
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
const t = e.split(
|
|
49
|
+
function N(e = "", n = !1) {
|
|
50
|
+
const t = e.split(R)[0] || "", r = t.substring(t.lastIndexOf("/") + 1);
|
|
50
51
|
if (n)
|
|
51
52
|
return r;
|
|
52
53
|
const o = r.lastIndexOf(".");
|
|
53
54
|
return o > 0 ? r.slice(0, o) : r;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function S(e, n, t) {
|
|
56
57
|
const r = e.indexOf(n);
|
|
57
58
|
if (r === -1)
|
|
58
59
|
return "";
|
|
59
|
-
const o = r + n.length,
|
|
60
|
-
return
|
|
60
|
+
const o = r + n.length, s = e.indexOf(t, o);
|
|
61
|
+
return s === -1 ? "" : e.slice(o, s);
|
|
61
62
|
}
|
|
62
63
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
A as generateRandomPassword,
|
|
65
|
+
b as generateRandomString,
|
|
66
|
+
_ as generateShortId,
|
|
67
|
+
E as generateSlug,
|
|
68
|
+
N as getFileName,
|
|
69
|
+
S as substringBetween
|
|
69
70
|
};
|
|
71
|
+
//# sourceMappingURL=string.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.util.js","sources":["../../../src/util/string/string.util.ts"],"sourcesContent":["import type { T_Object } from '#typescript/index.js';\n\nimport type { I_SlugifyOptions } from './string.type.js';\n\nimport { removeAccent } from '../common/common.util.js';\n\nconst RE_NON_ALNUM = /[^a-z0-9\\s-]/gi;\nconst RE_MULTI_SPACE_DASH = /[\\s-]+/g;\nconst RE_LEADING_TRAILING_DASH = /^-+|-+$/g;\nconst RE_HYPHEN = /-/g;\nconst RE_QUERY_FRAGMENT = /[?#]/;\n\n/**\n * Generates a slug from a string.\n * The slug is a URL-friendly version of the string, removing special characters\n * and converting spaces to hyphens.\n *\n * @param input - The string to be slugified.\n * @param options - Options for slugification.\n * @returns The slugified string.\n */\nfunction slugify(input: string, options?: I_SlugifyOptions): string {\n let slug = input.trim();\n\n // 1. Remove accents\n slug = removeAccent(slug);\n\n // 2. To lower case if requested (default true)\n if (options?.lower !== false) {\n slug = slug.toLowerCase();\n }\n\n // 3. Replace invalid characters with space (keeping alphanumeric, hyphens, and spaces)\n slug = slug.replace(RE_NON_ALNUM, ' ');\n\n // 4. Replace multiple spaces or hyphens with a single hyphen\n slug = slug.replace(RE_MULTI_SPACE_DASH, '-');\n\n // 5. Remove leading/trailing hyphens\n slug = slug.replace(RE_LEADING_TRAILING_DASH, '');\n\n return slug;\n}\n\n/**\n * Generates a slug from a string or an object containing strings.\n * The slug is a URL-friendly version of the string, removing special characters\n * and converting spaces to hyphens. This function can handle both single strings\n * and objects with string values.\n *\n * @param input - The string or object to be slugified.\n * @param options - Options for slugification including replacement character, case sensitivity, locale, etc.\n * @returns The slugified string or object with the same structure as the input.\n */\nexport function generateSlug<T = string>(\n input: T,\n options?: I_SlugifyOptions,\n): T {\n const slugifyWithOptions = (value: string) =>\n slugify(value ?? '', options);\n\n if (typeof input === 'object' && input !== null) {\n const result: T_Object = {};\n\n for (const [key, value] of Object.entries(input)) {\n result[key] = slugifyWithOptions(value as string);\n }\n\n return result as T;\n }\n\n return slugifyWithOptions(input as string) as T;\n}\n\n/**\n * Generates a short ID from a UUID.\n * The ID is a substring of the UUID, providing a shorter identifier.\n * Note: This is NOT cryptographically secure and collisions are possible,\n * but suitable for display purposes where uniqueness is handled elsewhere.\n *\n * @param uuid - The UUID to be converted to a short ID.\n * @param length - The desired length of the short ID (default: 4 characters).\n * @returns A short ID string of the specified length derived from the UUID.\n */\nexport function generateShortId(uuid: string, length = 4): string {\n // Simple hash function (FNV-1a variant) to generate a hex string from the UUID\n let hash = 0x811C9DC5;\n for (let i = 0; i < uuid.length; i++) {\n hash ^= uuid.charCodeAt(i);\n hash = Math.imul(hash, 0x01000193);\n }\n // Convert to unsigned 32-bit integer hex string\n const hex = (hash >>> 0).toString(16).padStart(8, '0');\n\n // If we need more than 8 chars, we can just append part of the original UUID (stripped of dashes)\n // or use a different strategy. For short IDs (usually < 8), the hash is fine.\n // If length > 8, we fallback to just slicing the clean UUID.\n if (length > 8) {\n return uuid.replace(RE_HYPHEN, '').slice(0, length);\n }\n\n return hex.slice(0, length);\n}\n\n/**\n * Internal helper that fills `length` characters from `charset` using\n * rejection-sampling over `crypto.getRandomValues` to avoid modulo bias.\n * Random values are requested in bounded chunks to keep allocations small.\n *\n * @param length - Number of characters to generate.\n * @param charset - The pool of characters to draw from.\n * @returns A randomly generated string of the requested length.\n */\nfunction generateRandomFromCharset(length: number, charset: string): string {\n const limit = Math.floor(2 ** 32 / charset.length) * charset.length;\n const result: string[] = [];\n const MAX_UINT32_VALUES_PER_CALL = 16384;\n\n while (result.length < length) {\n const remaining = length - result.length;\n const chunkSize = remaining > MAX_UINT32_VALUES_PER_CALL ? MAX_UINT32_VALUES_PER_CALL : remaining;\n const values = new Uint32Array(chunkSize);\n crypto.getRandomValues(values);\n\n for (const value of values) {\n if (result.length >= length) {\n break;\n }\n if (value < limit) {\n result.push(charset[value % charset.length] as string);\n }\n }\n }\n\n return result.join('');\n}\n\n/**\n * Generates a random password of a given length.\n * The password contains a mix of letters (both cases), numbers, and special characters\n * to ensure complexity and security.\n *\n * @param length - The desired length of the password (default: 8 characters).\n * @returns A randomly generated password string with the specified length.\n * @throws {RangeError} If `length` is not a non-negative safe integer.\n */\nexport function generateRandomPassword(length = 8): string {\n if (!Number.isSafeInteger(length) || length < 0) {\n throw new RangeError('length must be a non-negative safe integer');\n }\n\n const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?';\n\n return generateRandomFromCharset(length, charset);\n}\n\n/**\n * Generates a random string of a given length using a secure random number generator.\n * This function is a cryptographically secure alternative to Math.random().toString(36).\n *\n * @param length - The desired length of the string (default: 8 characters).\n * @param charset - The characters to use (default: lowercase alphanumeric).\n * @returns A randomly generated string.\n * @throws {RangeError} If `length` is not a non-negative safe integer.\n * @throws {RangeError} If `charset` is empty or exceeds 2^32 characters.\n */\nexport function generateRandomString(\n length = 8,\n charset = 'abcdefghijklmnopqrstuvwxyz0123456789',\n): string {\n if (!Number.isSafeInteger(length) || length < 0) {\n throw new RangeError('length must be a non-negative safe integer');\n }\n\n if (charset.length === 0 || charset.length > 2 ** 32) {\n throw new RangeError('charset.length must be between 1 and 2^32');\n }\n\n return generateRandomFromCharset(length, charset);\n}\n\n/**\n * Get the file name from a URL.\n * This function extracts the file name from a URL, optionally including or excluding\n * the file extension. It handles URLs with query parameters and fragments.\n *\n * @param url - The URL to extract the file name from (default: empty string).\n * @param getExtension - Whether to include the file extension in the result (default: false).\n * @returns The file name extracted from the URL, with or without the extension.\n */\nexport function getFileName(url = '', getExtension = false): string {\n const withoutQuery = url.split(RE_QUERY_FRAGMENT)[0] || '';\n const fileName = withoutQuery.substring(withoutQuery.lastIndexOf('/') + 1);\n\n if (getExtension) {\n return fileName;\n }\n\n const dotIndex = fileName.lastIndexOf('.');\n\n return dotIndex > 0 ? fileName.slice(0, dotIndex) : fileName;\n}\n\n/**\n * Extracts a substring between two strings.\n * This function finds the first occurrence of the starting string, then finds the first\n * occurrence of the ending string after the starting string, and returns the content between them.\n *\n * @param s - The original string to search within.\n * @param a - The starting string that marks the beginning of the desired substring.\n * @param b - The ending string that marks the end of the desired substring.\n * @returns The substring between the two specified strings, or an empty string if either string is not found.\n */\nexport function substringBetween(s: string, a: string, b: string): string {\n const start = s.indexOf(a);\n\n if (start === -1) {\n return '';\n }\n\n const from = start + a.length;\n const end = s.indexOf(b, from);\n\n if (end === -1) {\n return '';\n }\n\n return s.slice(from, end);\n}\n"],"names":["RE_NON_ALNUM","RE_MULTI_SPACE_DASH","RE_LEADING_TRAILING_DASH","RE_HYPHEN","RE_QUERY_FRAGMENT","slugify","input","options","slug","removeAccent","generateSlug","slugifyWithOptions","value","result","key","generateShortId","uuid","length","hash","i","hex","generateRandomFromCharset","charset","limit","MAX_UINT32_VALUES_PER_CALL","remaining","chunkSize","values","generateRandomPassword","generateRandomString","getFileName","url","getExtension","withoutQuery","fileName","dotIndex","substringBetween","s","a","b","start","from","end"],"mappings":";AAMA,MAAMA,IAAe,kBACfC,IAAsB,WACtBC,IAA2B,YAC3BC,IAAY,MACZC,IAAoB;AAW1B,SAASC,EAAQC,GAAeC,GAAoC;AAChE,MAAIC,IAAOF,EAAM,KAAA;AAGjB,SAAAE,IAAOC,EAAaD,CAAI,GAGpBD,GAAS,UAAU,OACnBC,IAAOA,EAAK,YAAA,IAIhBA,IAAOA,EAAK,QAAQR,GAAc,GAAG,GAGrCQ,IAAOA,EAAK,QAAQP,GAAqB,GAAG,GAG5CO,IAAOA,EAAK,QAAQN,GAA0B,EAAE,GAEzCM;AACX;AAYO,SAASE,EACZJ,GACAC,GACC;AACD,QAAMI,IAAqB,CAACC,MACxBP,EAAQO,KAAS,IAAIL,CAAO;AAEhC,MAAI,OAAOD,KAAU,YAAYA,MAAU,MAAM;AAC7C,UAAMO,IAAmB,CAAA;AAEzB,eAAW,CAACC,GAAKF,CAAK,KAAK,OAAO,QAAQN,CAAK;AAC3C,MAAAO,EAAOC,CAAG,IAAIH,EAAmBC,CAAe;AAGpD,WAAOC;AAAA,EACX;AAEA,SAAOF,EAAmBL,CAAe;AAC7C;AAYO,SAASS,EAAgBC,GAAcC,IAAS,GAAW;AAE9D,MAAIC,IAAO;AACX,WAASC,IAAI,GAAGA,IAAIH,EAAK,QAAQG;AAC7B,IAAAD,KAAQF,EAAK,WAAWG,CAAC,GACzBD,IAAO,KAAK,KAAKA,GAAM,QAAU;AAGrC,QAAME,KAAOF,MAAS,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAKrD,SAAID,IAAS,IACFD,EAAK,QAAQb,GAAW,EAAE,EAAE,MAAM,GAAGc,CAAM,IAG/CG,EAAI,MAAM,GAAGH,CAAM;AAC9B;AAWA,SAASI,EAA0BJ,GAAgBK,GAAyB;AACxE,QAAMC,IAAQ,KAAK,MAAM,aAAUD,EAAQ,MAAM,IAAIA,EAAQ,QACvDT,IAAmB,CAAA,GACnBW,IAA6B;AAEnC,SAAOX,EAAO,SAASI,KAAQ;AAC3B,UAAMQ,IAAYR,IAASJ,EAAO,QAC5Ba,IAAYD,IAAYD,IAA6BA,IAA6BC,GAClFE,IAAS,IAAI,YAAYD,CAAS;AACxC,WAAO,gBAAgBC,CAAM;AAE7B,eAAWf,KAASe,GAAQ;AACxB,UAAId,EAAO,UAAUI;AACjB;AAEJ,MAAIL,IAAQW,KACRV,EAAO,KAAKS,EAAQV,IAAQU,EAAQ,MAAM,CAAW;AAAA,IAE7D;AAAA,EACJ;AAEA,SAAOT,EAAO,KAAK,EAAE;AACzB;AAWO,SAASe,EAAuBX,IAAS,GAAW;AACvD,MAAI,CAAC,OAAO,cAAcA,CAAM,KAAKA,IAAS;AAC1C,UAAM,IAAI,WAAW,4CAA4C;AAKrE,SAAOI,EAA0BJ,GAFjB,wFAEgC;AACpD;AAYO,SAASY,EACZZ,IAAS,GACTK,IAAU,wCACJ;AACN,MAAI,CAAC,OAAO,cAAcL,CAAM,KAAKA,IAAS;AAC1C,UAAM,IAAI,WAAW,4CAA4C;AAGrE,MAAIK,EAAQ,WAAW,KAAKA,EAAQ,SAAS,KAAK;AAC9C,UAAM,IAAI,WAAW,2CAA2C;AAGpE,SAAOD,EAA0BJ,GAAQK,CAAO;AACpD;AAWO,SAASQ,EAAYC,IAAM,IAAIC,IAAe,IAAe;AAChE,QAAMC,IAAeF,EAAI,MAAM3B,CAAiB,EAAE,CAAC,KAAK,IAClD8B,IAAWD,EAAa,UAAUA,EAAa,YAAY,GAAG,IAAI,CAAC;AAEzE,MAAID;AACA,WAAOE;AAGX,QAAMC,IAAWD,EAAS,YAAY,GAAG;AAEzC,SAAOC,IAAW,IAAID,EAAS,MAAM,GAAGC,CAAQ,IAAID;AACxD;AAYO,SAASE,EAAiBC,GAAWC,GAAWC,GAAmB;AACtE,QAAMC,IAAQH,EAAE,QAAQC,CAAC;AAEzB,MAAIE,MAAU;AACV,WAAO;AAGX,QAAMC,IAAOD,IAAQF,EAAE,QACjBI,IAAML,EAAE,QAAQE,GAAGE,CAAI;AAE7B,SAAIC,MAAQ,KACD,KAGJL,EAAE,MAAMI,GAAMC,CAAG;AAC5B;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = {
|
|
1
|
+
const r = /^\d+$/, n = /^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4})?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|[a-f\d]{1,4}:(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|:(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:))(?:%[0-9a-z]+)?$/i, e = {
|
|
2
2
|
/**
|
|
3
3
|
* Checks if a value is empty.
|
|
4
4
|
* This function provides comprehensive empty checking for different data types:
|
|
@@ -30,10 +30,11 @@ const e = {
|
|
|
30
30
|
isValidIP(d) {
|
|
31
31
|
const f = d.split(".");
|
|
32
32
|
return f.length === 4 && f.every(
|
|
33
|
-
(t) =>
|
|
34
|
-
) ? !0 :
|
|
33
|
+
(t) => r.test(t) && Number(t) >= 0 && Number(t) <= 255
|
|
34
|
+
) ? !0 : n.test(d);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
38
|
e as validate
|
|
39
39
|
};
|
|
40
|
+
//# sourceMappingURL=validate.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.util.js","sources":["../../../src/util/validate/validate.util.ts"],"sourcesContent":["/**\n * A collection of validation utility functions for common data validation tasks.\n * This object provides methods to validate various data types and formats.\n */\nconst RE_DIGITS_ONLY = /^\\d+$/;\nconst RE_IPV6 = /^(?:(?:[a-f\\d]{1,4}:){7}(?:[a-f\\d]{1,4}|:)|(?:[a-f\\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|:[a-f\\d]{1,4}|:)|(?:[a-f\\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-f\\d]{1,4}){1,2}|:)|(?:[a-f\\d]{1,4}:){4}(?:(?::[a-f\\d]{1,4})?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-f\\d]{1,4}){1,3}|:)|(?:[a-f\\d]{1,4}:){3}(?:(?::[a-f\\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-f\\d]{1,4}){1,4}|:)|(?:[a-f\\d]{1,4}:){2}(?:(?::[a-f\\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-f\\d]{1,4}){1,5}|:)|[a-f\\d]{1,4}:(?:(?::[a-f\\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-f\\d]{1,4}){1,6}|:)|:(?:(?::[a-f\\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-f\\d]{1,4}){1,7}|:))(?:%[0-9a-z]+)?$/i;\n\nexport const validate = {\n /**\n * Checks if a value is empty.\n * This function provides comprehensive empty checking for different data types:\n * - For strings, it checks if the string is empty or contains only whitespace.\n * - For arrays, it checks if the array has no elements.\n * - For objects, it checks if the object has no own properties.\n * - For Maps and Sets, it checks if they are empty.\n * - For WeakMaps and WeakSets, it returns true (as they are not enumerable).\n * - For ArrayBuffer views, it checks if the byte length is 0.\n * - For Dates, it returns false.\n * - For null and undefined, it returns true.\n * - For all other types, it returns false.\n *\n * @param value - The value to check for emptiness.\n * @returns True if the value is empty, false otherwise.\n */\n isEmpty(value: unknown): boolean {\n if (value === null || value === undefined) {\n return true;\n }\n\n if (typeof value === 'string') {\n return value.trim().length === 0;\n }\n\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n\n if (typeof value === 'object') {\n if (value instanceof Date) {\n return false;\n }\n\n if (value instanceof Map || value instanceof Set) {\n return value.size === 0;\n }\n\n if (value instanceof WeakMap || value instanceof WeakSet) {\n return true;\n }\n\n if (ArrayBuffer.isView(value)) {\n return value.byteLength === 0;\n }\n\n return Object.keys(value).length === 0;\n }\n\n return false;\n },\n /**\n * Checks if a string is a valid IP address (IPv4 or IPv6).\n * This function validates IP addresses according to standard formats:\n * - IPv4: Four octets separated by dots, each between 0–255.\n * - IPv6: Eight groups of four hex digits, possibly compressed with `::`.\n *\n * @param ip - The IP address string to validate.\n * @returns True if the IP is valid IPv4 or IPv6, false otherwise.\n */\n isValidIP(ip: string): boolean {\n const ipv4Parts = ip.split('.');\n\n if (ipv4Parts.length === 4 && ipv4Parts.every(octet =>\n RE_DIGITS_ONLY.test(octet)\n && Number(octet) >= 0\n && Number(octet) <= 255,\n )) {\n return true;\n }\n\n return RE_IPV6.test(ip);\n },\n};\n"],"names":["RE_DIGITS_ONLY","RE_IPV6","validate","value","ip","ipv4Parts","octet"],"mappings":"AAIA,MAAMA,IAAiB,SACjBC,IAAU,gjCAEHC,IAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBpB,QAAQC,GAAyB;AAC7B,WAAIA,KAAU,OACH,KAGP,OAAOA,KAAU,WACVA,EAAM,OAAO,WAAW,IAG/B,MAAM,QAAQA,CAAK,IACZA,EAAM,WAAW,IAGxB,OAAOA,KAAU,WACbA,aAAiB,OACV,KAGPA,aAAiB,OAAOA,aAAiB,MAClCA,EAAM,SAAS,IAGtBA,aAAiB,WAAWA,aAAiB,UACtC,KAGP,YAAY,OAAOA,CAAK,IACjBA,EAAM,eAAe,IAGzB,OAAO,KAAKA,CAAK,EAAE,WAAW,IAGlC;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,UAAUC,GAAqB;AAC3B,UAAMC,IAAYD,EAAG,MAAM,GAAG;AAE9B,WAAIC,EAAU,WAAW,KAAKA,EAAU;AAAA,MAAM,CAAAC,MAC1CN,EAAe,KAAKM,CAAK,KACtB,OAAOA,CAAK,KAAK,KACjB,OAAOA,CAAK,KAAK;AAAA,IAAA,IAEb,KAGJL,EAAQ,KAAKG,CAAE;AAAA,EAC1B;AACJ;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberskill/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.2.0",
|
|
5
5
|
"description": "CyberSkill Shared",
|
|
6
6
|
"author": "Stephen Cheng",
|
|
7
7
|
"license": "MIT",
|
|
@@ -13,181 +13,148 @@
|
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/cyberskill-world/shared/issues"
|
|
15
15
|
},
|
|
16
|
-
"sideEffects":
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"./dist/style.css"
|
|
18
|
+
],
|
|
17
19
|
"exports": {
|
|
18
20
|
"./config": {
|
|
19
21
|
"types": "./dist/config/index.d.ts",
|
|
20
|
-
"import": "./dist/config/index.js"
|
|
21
|
-
"require": "./dist/config/index.cjs"
|
|
22
|
+
"import": "./dist/config/index.js"
|
|
22
23
|
},
|
|
23
24
|
"./config/commitlint": {
|
|
24
25
|
"types": "./dist/config/commitlint/index.d.ts",
|
|
25
|
-
"import": "./dist/config/commitlint/index.js"
|
|
26
|
-
"require": "./dist/config/commitlint/index.cjs"
|
|
26
|
+
"import": "./dist/config/commitlint/index.js"
|
|
27
27
|
},
|
|
28
28
|
"./config/env": {
|
|
29
29
|
"types": "./dist/config/env/index.d.ts",
|
|
30
|
-
"import": "./dist/config/env/index.js"
|
|
31
|
-
"require": "./dist/config/env/index.cjs"
|
|
30
|
+
"import": "./dist/config/env/index.js"
|
|
32
31
|
},
|
|
33
32
|
"./config/eslint": {
|
|
34
33
|
"types": "./dist/config/eslint/index.d.ts",
|
|
35
|
-
"import": "./dist/config/eslint/index.js"
|
|
36
|
-
"require": "./dist/config/eslint/index.cjs"
|
|
34
|
+
"import": "./dist/config/eslint/index.js"
|
|
37
35
|
},
|
|
38
36
|
"./config/graphql-codegen": {
|
|
39
37
|
"types": "./dist/config/graphql-codegen/index.d.ts",
|
|
40
|
-
"import": "./dist/config/graphql-codegen/index.js"
|
|
41
|
-
"require": "./dist/config/graphql-codegen/index.cjs"
|
|
38
|
+
"import": "./dist/config/graphql-codegen/index.js"
|
|
42
39
|
},
|
|
43
40
|
"./config/lint-staged": {
|
|
44
41
|
"types": "./dist/config/lint-staged/index.d.ts",
|
|
45
|
-
"import": "./dist/config/lint-staged/index.js"
|
|
46
|
-
"require": "./dist/config/lint-staged/index.cjs"
|
|
42
|
+
"import": "./dist/config/lint-staged/index.js"
|
|
47
43
|
},
|
|
48
44
|
"./config/vitest": {
|
|
49
45
|
"types": "./dist/config/vitest/index.d.ts",
|
|
50
|
-
"import": "./dist/config/vitest/index.js"
|
|
51
|
-
"require": "./dist/config/vitest/index.cjs"
|
|
46
|
+
"import": "./dist/config/vitest/index.js"
|
|
52
47
|
},
|
|
53
48
|
"./config/storybook": {
|
|
54
49
|
"types": "./dist/config/storybook/index.d.ts",
|
|
55
|
-
"import": "./dist/config/storybook/index.js"
|
|
56
|
-
"require": "./dist/config/storybook/index.cjs"
|
|
50
|
+
"import": "./dist/config/storybook/index.js"
|
|
57
51
|
},
|
|
58
52
|
"./constant": {
|
|
59
53
|
"types": "./dist/constant/index.d.ts",
|
|
60
|
-
"import": "./dist/constant/index.js"
|
|
61
|
-
"require": "./dist/constant/index.cjs"
|
|
54
|
+
"import": "./dist/constant/index.js"
|
|
62
55
|
},
|
|
63
56
|
"./node/apollo-server": {
|
|
64
57
|
"types": "./dist/node/apollo-server/index.d.ts",
|
|
65
|
-
"import": "./dist/node/apollo-server/index.js"
|
|
66
|
-
"require": "./dist/node/apollo-server/index.cjs"
|
|
58
|
+
"import": "./dist/node/apollo-server/index.js"
|
|
67
59
|
},
|
|
68
60
|
"./node/cli": {
|
|
69
61
|
"types": "./dist/node/cli/index.d.ts",
|
|
70
|
-
"import": "./dist/node/cli/index.js"
|
|
71
|
-
"require": "./dist/node/cli/index.cjs"
|
|
62
|
+
"import": "./dist/node/cli/index.js"
|
|
72
63
|
},
|
|
73
64
|
"./node/command": {
|
|
74
65
|
"types": "./dist/node/command/index.d.ts",
|
|
75
|
-
"import": "./dist/node/command/index.js"
|
|
76
|
-
"require": "./dist/node/command/index.cjs"
|
|
66
|
+
"import": "./dist/node/command/index.js"
|
|
77
67
|
},
|
|
78
68
|
"./node/express": {
|
|
79
69
|
"types": "./dist/node/express/index.d.ts",
|
|
80
|
-
"import": "./dist/node/express/index.js"
|
|
81
|
-
"require": "./dist/node/express/index.cjs"
|
|
70
|
+
"import": "./dist/node/express/index.js"
|
|
82
71
|
},
|
|
83
72
|
"./node/fs": {
|
|
84
73
|
"types": "./dist/node/fs/index.d.ts",
|
|
85
|
-
"import": "./dist/node/fs/index.js"
|
|
86
|
-
"require": "./dist/node/fs/index.cjs"
|
|
74
|
+
"import": "./dist/node/fs/index.js"
|
|
87
75
|
},
|
|
88
76
|
"./node/log": {
|
|
89
77
|
"types": "./dist/node/log/index.d.ts",
|
|
90
|
-
"import": "./dist/node/log/index.js"
|
|
91
|
-
"require": "./dist/node/log/index.cjs"
|
|
78
|
+
"import": "./dist/node/log/index.js"
|
|
92
79
|
},
|
|
93
80
|
"./node/mongo": {
|
|
94
81
|
"types": "./dist/node/mongo/index.d.ts",
|
|
95
|
-
"import": "./dist/node/mongo/index.js"
|
|
96
|
-
"require": "./dist/node/mongo/index.cjs"
|
|
82
|
+
"import": "./dist/node/mongo/index.js"
|
|
97
83
|
},
|
|
98
84
|
"./node/package": {
|
|
99
85
|
"types": "./dist/node/package/index.d.ts",
|
|
100
|
-
"import": "./dist/node/package/index.js"
|
|
101
|
-
"require": "./dist/node/package/index.cjs"
|
|
86
|
+
"import": "./dist/node/package/index.js"
|
|
102
87
|
},
|
|
103
88
|
"./node/path": {
|
|
104
89
|
"types": "./dist/node/path/index.d.ts",
|
|
105
|
-
"import": "./dist/node/path/index.js"
|
|
106
|
-
"require": "./dist/node/path/index.cjs"
|
|
90
|
+
"import": "./dist/node/path/index.js"
|
|
107
91
|
},
|
|
108
92
|
"./node/storage": {
|
|
109
93
|
"types": "./dist/node/storage/index.d.ts",
|
|
110
|
-
"import": "./dist/node/storage/index.js"
|
|
111
|
-
"require": "./dist/node/storage/index.cjs"
|
|
94
|
+
"import": "./dist/node/storage/index.js"
|
|
112
95
|
},
|
|
113
96
|
"./node/upload": {
|
|
114
97
|
"types": "./dist/node/upload/index.d.ts",
|
|
115
|
-
"import": "./dist/node/upload/index.js"
|
|
116
|
-
"require": "./dist/node/upload/index.cjs"
|
|
98
|
+
"import": "./dist/node/upload/index.js"
|
|
117
99
|
},
|
|
118
100
|
"./node/ws": {
|
|
119
101
|
"types": "./dist/node/ws/index.d.ts",
|
|
120
|
-
"import": "./dist/node/ws/index.js"
|
|
121
|
-
"require": "./dist/node/ws/index.cjs"
|
|
102
|
+
"import": "./dist/node/ws/index.js"
|
|
122
103
|
},
|
|
123
104
|
"./react/apollo-client": {
|
|
124
105
|
"types": "./dist/react/apollo-client/index.d.ts",
|
|
125
|
-
"import": "./dist/react/apollo-client/index.js"
|
|
126
|
-
"require": "./dist/react/apollo-client/index.cjs"
|
|
106
|
+
"import": "./dist/react/apollo-client/index.js"
|
|
127
107
|
},
|
|
128
108
|
"./react/apollo-client-nextjs": {
|
|
129
109
|
"types": "./dist/react/apollo-client-nextjs/index.d.ts",
|
|
130
|
-
"import": "./dist/react/apollo-client-nextjs/index.js"
|
|
131
|
-
"require": "./dist/react/apollo-client-nextjs/index.cjs"
|
|
110
|
+
"import": "./dist/react/apollo-client-nextjs/index.js"
|
|
132
111
|
},
|
|
133
112
|
"./react/apollo-client-nextjs/rsc": {
|
|
134
113
|
"types": "./dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts",
|
|
135
|
-
"import": "./dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js"
|
|
136
|
-
"require": "./dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs"
|
|
114
|
+
"import": "./dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js"
|
|
137
115
|
},
|
|
138
116
|
"./react/apollo-error": {
|
|
139
117
|
"types": "./dist/react/apollo-error/index.d.ts",
|
|
140
|
-
"import": "./dist/react/apollo-error/index.js"
|
|
141
|
-
"require": "./dist/react/apollo-error/index.cjs"
|
|
118
|
+
"import": "./dist/react/apollo-error/index.js"
|
|
142
119
|
},
|
|
143
120
|
"./react/i18next": {
|
|
144
121
|
"types": "./dist/react/i18next/index.d.ts",
|
|
145
|
-
"import": "./dist/react/i18next/index.js"
|
|
146
|
-
"require": "./dist/react/i18next/index.cjs"
|
|
122
|
+
"import": "./dist/react/i18next/index.js"
|
|
147
123
|
},
|
|
148
124
|
"./react/loading": {
|
|
149
125
|
"types": "./dist/react/loading/index.d.ts",
|
|
150
|
-
"import": "./dist/react/loading/index.js"
|
|
151
|
-
"require": "./dist/react/loading/index.cjs"
|
|
126
|
+
"import": "./dist/react/loading/index.js"
|
|
152
127
|
},
|
|
153
128
|
"./react/log": {
|
|
154
129
|
"types": "./dist/react/log/index.d.ts",
|
|
155
|
-
"import": "./dist/react/log/index.js"
|
|
156
|
-
"require": "./dist/react/log/index.cjs"
|
|
130
|
+
"import": "./dist/react/log/index.js"
|
|
157
131
|
},
|
|
158
132
|
"./react/next-intl": {
|
|
159
133
|
"types": "./dist/react/next-intl/index.d.ts",
|
|
160
|
-
"import": "./dist/react/next-intl/index.js"
|
|
161
|
-
"require": "./dist/react/next-intl/index.cjs"
|
|
134
|
+
"import": "./dist/react/next-intl/index.js"
|
|
162
135
|
},
|
|
163
136
|
"./react/storage": {
|
|
164
137
|
"types": "./dist/react/storage/index.d.ts",
|
|
165
|
-
"import": "./dist/react/storage/index.js"
|
|
166
|
-
"require": "./dist/react/storage/index.cjs"
|
|
138
|
+
"import": "./dist/react/storage/index.js"
|
|
167
139
|
},
|
|
168
140
|
"./react/toast": {
|
|
169
141
|
"types": "./dist/react/toast/index.d.ts",
|
|
170
|
-
"import": "./dist/react/toast/index.js"
|
|
171
|
-
"require": "./dist/react/toast/index.cjs"
|
|
142
|
+
"import": "./dist/react/toast/index.js"
|
|
172
143
|
},
|
|
173
144
|
"./react/userback": {
|
|
174
145
|
"types": "./dist/react/userback/index.d.ts",
|
|
175
|
-
"import": "./dist/react/userback/index.js"
|
|
176
|
-
"require": "./dist/react/userback/index.cjs"
|
|
146
|
+
"import": "./dist/react/userback/index.js"
|
|
177
147
|
},
|
|
178
148
|
"./typescript": {
|
|
179
149
|
"types": "./dist/typescript/index.d.ts",
|
|
180
|
-
"import": "./dist/typescript/index.js"
|
|
181
|
-
"require": "./dist/typescript/index.cjs"
|
|
150
|
+
"import": "./dist/typescript/index.js"
|
|
182
151
|
},
|
|
183
152
|
"./util": {
|
|
184
153
|
"types": "./dist/util/index.d.ts",
|
|
185
|
-
"import": "./dist/util/index.js"
|
|
186
|
-
"require": "./dist/util/index.cjs"
|
|
154
|
+
"import": "./dist/util/index.js"
|
|
187
155
|
},
|
|
188
156
|
"./style.css": {
|
|
189
|
-
"import": "./dist/style.css"
|
|
190
|
-
"require": "./dist/style.css"
|
|
157
|
+
"import": "./dist/style.css"
|
|
191
158
|
}
|
|
192
159
|
},
|
|
193
160
|
"bin": {
|
|
@@ -213,21 +180,22 @@
|
|
|
213
180
|
"reset": "tsx src/node/cli/index.ts reset",
|
|
214
181
|
"test": "run-s test:unit test:e2e",
|
|
215
182
|
"test:e2e": "tsx src/node/cli/index.ts test:e2e",
|
|
216
|
-
"test:unit": "tsx src/node/cli/index.ts test:unit"
|
|
183
|
+
"test:unit": "tsx src/node/cli/index.ts test:unit",
|
|
184
|
+
"typecheck": "tsc --noEmit"
|
|
217
185
|
},
|
|
218
186
|
"dependencies": {
|
|
219
|
-
"@antfu/eslint-config": "7.
|
|
187
|
+
"@antfu/eslint-config": "7.7.0",
|
|
220
188
|
"@apollo/client": "4.1.6",
|
|
221
189
|
"@apollo/client-integration-nextjs": "0.14.4",
|
|
222
190
|
"@apollo/server": "5.4.0",
|
|
223
191
|
"@as-integrations/express5": "1.1.2",
|
|
224
|
-
"@dotenvx/dotenvx": "1.
|
|
192
|
+
"@dotenvx/dotenvx": "1.53.0",
|
|
225
193
|
"@eddeee888/gcg-typescript-resolver-files": "0.15.0",
|
|
226
194
|
"@eslint-react/eslint-plugin": "2.13.0",
|
|
227
195
|
"@graphql-codegen/cli": "6.1.2",
|
|
228
196
|
"@graphql-codegen/client-preset": "5.2.3",
|
|
229
|
-
"@nestjs/common": "11.1.
|
|
230
|
-
"@nestjs/core": "11.1.
|
|
197
|
+
"@nestjs/common": "11.1.16",
|
|
198
|
+
"@nestjs/core": "11.1.16",
|
|
231
199
|
"@userback/widget": "0.3.12",
|
|
232
200
|
"@vitejs/plugin-react-swc": "4.2.3",
|
|
233
201
|
"body-parser": "2.2.2",
|
|
@@ -246,39 +214,40 @@
|
|
|
246
214
|
"express-session": "1.19.0",
|
|
247
215
|
"express-useragent": "2.1.0",
|
|
248
216
|
"extract-files": "13.0.0",
|
|
249
|
-
"fs-extra": "11.3.
|
|
217
|
+
"fs-extra": "11.3.4",
|
|
250
218
|
"globals": "17.4.0",
|
|
251
|
-
"graphql": "16.13.
|
|
219
|
+
"graphql": "16.13.1",
|
|
252
220
|
"graphql-upload": "17.0.0",
|
|
253
221
|
"graphql-ws": "6.0.7",
|
|
254
222
|
"helmet": "8.1.0",
|
|
255
|
-
"i18next": "25.8.
|
|
256
|
-
"jsdom": "28.1.0",
|
|
223
|
+
"i18next": "25.8.14",
|
|
257
224
|
"localforage": "1.10.0",
|
|
258
225
|
"migrate-mongo": "14.0.7",
|
|
259
226
|
"mongodb": "7.1.0",
|
|
260
|
-
"mongoose": "9.2.
|
|
227
|
+
"mongoose": "9.2.4",
|
|
261
228
|
"mongoose-aggregate-paginate-v2": "1.1.4",
|
|
262
229
|
"mongoose-paginate-v2": "1.9.1",
|
|
263
230
|
"next-intl": "4.8.3",
|
|
264
|
-
"node-fetch": "3.3.2",
|
|
265
231
|
"qs": "6.15.0",
|
|
266
232
|
"react": "19.2.4",
|
|
267
233
|
"react-dom": "19.2.4",
|
|
268
234
|
"react-hot-toast": "2.6.0",
|
|
269
|
-
"react-i18next": "16.5.
|
|
235
|
+
"react-i18next": "16.5.5",
|
|
270
236
|
"rxjs": "7.8.2",
|
|
271
237
|
"vite": "7.3.1",
|
|
272
238
|
"ws": "8.19.0",
|
|
273
239
|
"yargs": "18.0.0"
|
|
274
240
|
},
|
|
275
241
|
"devDependencies": {
|
|
276
|
-
"@commitlint/cli": "20.4.
|
|
277
|
-
"@commitlint/config-conventional": "20.4.
|
|
278
|
-
"@eslint/config-inspector": "1.
|
|
242
|
+
"@commitlint/cli": "20.4.3",
|
|
243
|
+
"@commitlint/config-conventional": "20.4.3",
|
|
244
|
+
"@eslint/config-inspector": "1.5.0",
|
|
279
245
|
"@next/eslint-plugin-next": "16.1.6",
|
|
280
|
-
"@
|
|
281
|
-
"@
|
|
246
|
+
"@semantic-release/changelog": "6.0.3",
|
|
247
|
+
"@semantic-release/git": "10.0.1",
|
|
248
|
+
"@semantic-release/github": "12.0.6",
|
|
249
|
+
"@storybook/react": "10.2.15",
|
|
250
|
+
"@storybook/react-vite": "10.2.15",
|
|
282
251
|
"@testing-library/jest-dom": "6.9.1",
|
|
283
252
|
"@testing-library/react": "16.3.2",
|
|
284
253
|
"@types/body-parser": "1.19.6",
|
|
@@ -292,19 +261,22 @@
|
|
|
292
261
|
"@types/fs-extra": "11.0.4",
|
|
293
262
|
"@types/graphql-upload": "17.0.0",
|
|
294
263
|
"@types/migrate-mongo": "10.0.6",
|
|
295
|
-
"@types/node": "25.3.
|
|
264
|
+
"@types/node": "25.3.5",
|
|
296
265
|
"@types/react": "19.2.14",
|
|
297
266
|
"@types/react-dom": "19.2.3",
|
|
298
267
|
"@types/ws": "8.18.1",
|
|
299
268
|
"@types/yargs": "17.0.35",
|
|
300
269
|
"@vitest/browser": "4.0.18",
|
|
270
|
+
"@vitest/coverage-istanbul": "4.0.18",
|
|
301
271
|
"eslint": "10.0.2",
|
|
302
272
|
"eslint-config-next": "16.1.6",
|
|
303
273
|
"glob": "13.0.6",
|
|
304
|
-
"
|
|
305
|
-
"
|
|
274
|
+
"jsdom": "28.1.0",
|
|
275
|
+
"lint-staged": "16.3.2",
|
|
276
|
+
"node-modules-inspector": "1.4.2",
|
|
306
277
|
"npm-run-all2": "8.0.4",
|
|
307
278
|
"sass": "1.97.3",
|
|
279
|
+
"semantic-release": "25.0.3",
|
|
308
280
|
"simple-git-hooks": "2.13.1",
|
|
309
281
|
"tsx": "4.21.0",
|
|
310
282
|
"typescript": "5.9.3",
|
|
@@ -314,12 +286,13 @@
|
|
|
314
286
|
},
|
|
315
287
|
"publishConfig": {
|
|
316
288
|
"access": "public",
|
|
317
|
-
"
|
|
318
|
-
"
|
|
289
|
+
"provenance": true,
|
|
290
|
+
"registry": "https://registry.npmjs.org/"
|
|
319
291
|
},
|
|
320
292
|
"pnpm": {
|
|
321
293
|
"overrides": {
|
|
322
|
-
"minimatch": ">=10.2.3"
|
|
294
|
+
"minimatch": ">=10.2.3",
|
|
295
|
+
"minimatch@__comment": "Pinned to fix transitive vulnerability CVE in older minimatch versions used by some deps"
|
|
323
296
|
}
|
|
324
297
|
}
|
|
325
298
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={extends:["@commitlint/config-conventional"],ignores:[e=>e.includes("[🚀 CI - Deploy]")]};exports.default=t;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.E_ConfigType=(t=>(t.ESLINT="eslint",t.COMMITLINT="commitlint",t.LINT_STAGED="lint-staged",t.VITEST_REACT_E2E="vitest-react-e2e",t.VITEST_REACT_UNIT="vitest-react-unit",t))(exports.E_ConfigType||{});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@antfu/eslint-config"),n=require("./config.type.cjs"),i=require("./eslint/index.cjs"),f=require("./vitest/vitest.e2e.cjs"),g=require("./vitest/vitest.unit.cjs"),o=require("../util/object/object.util.cjs"),T=(...e)=>{const t=o.deepMerge(...Array.isArray(i.default)?i.default:[i.default],...e),{ignores:r,...s}=t;return u({stylistic:{semi:!0,indent:4},formatters:!0,yaml:!1,react:!0},s,...Array.isArray(r)?[{ignores:r}]:[])},a={[n.E_ConfigType.ESLINT]:e=>T(e),[n.E_ConfigType.COMMITLINT]:e=>o.deepMerge(e),[n.E_ConfigType.LINT_STAGED]:e=>o.deepMerge(e),[n.E_ConfigType.VITEST_REACT_UNIT]:e=>g.vitestUnit(e),[n.E_ConfigType.VITEST_REACT_E2E]:e=>f.vitestE2E(e)};function E(e,...t){const r=a[e];if(!t||t.length===0)return r({});if(!r)throw new Error(`Unknown config type: ${e}`);return r(...t)}exports.mergeConfigs=E;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=".cyberskill-storage";exports.CYBERSKILL_STORAGE_DIRECTORY=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@dotenvx/dotenvx"),n=require("envalid"),i=require("node:os"),a=require("node:path"),r=require("node:process"),l=require("./env.constant.cjs"),u=require("../../typescript/common.type.cjs");let t=!1;const d=n.makeValidator(e=>typeof e=="boolean"?e:typeof e=="string");function o(){r.env.NODE_ENV!==u.E_Environment.PRODUCTION&&!t&&(E.config(),t=!0)}function s(){o();const e=n.cleanEnv(r.env,{CWD:n.str({default:r.cwd()}),DEBUG:d({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:n.str({default:a.join(i.homedir(),l.CYBERSKILL_STORAGE_DIRECTORY)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}exports.getEnv=s;exports.loadEnvFile=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./env.constant.cjs"),e=require("./env.util.cjs");exports.CYBERSKILL_STORAGE_DIRECTORY=t.CYBERSKILL_STORAGE_DIRECTORY;exports.getEnv=e.getEnv;exports.loadEnvFile=e.loadEnvFile;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("globals");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const r=s(l),a=[{languageOptions:{globals:{...r.node,...r.browser}},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["**/node_modules/**","**/.git/**","build","dist",".agent"]}];exports.default=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@eddeee888/gcg-typescript-resolver-files"),c=require("../env/env.util.cjs");c.loadEnvFile();function u({uri:t,from:i,to:e,target:n="client"}){const r=n==="client",o=n==="server";return{schema:t,ignoreNoDocuments:!0,overwrite:!0,...r&&{documents:[i]},generates:{...r&&{[e]:{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0,namingConvention:"keep"}}},...o&&{[e]:s.defineConfig()}}}}exports.createGraphqlCodegenConfig=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./graphql-codegen.util.cjs");exports.createGraphqlCodegenConfig=e.createGraphqlCodegenConfig;
|
package/dist/config/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./config.type.cjs"),r=require("./config.util.cjs");Object.defineProperty(exports,"E_ConfigType",{enumerable:!0,get:()=>e.E_ConfigType});exports.mergeConfigs=r.mergeConfigs;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"*.ts":()=>"tsc --noEmit","*":["eslint --fix --no-cache"]};exports.default=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./storybook.main.cjs"),e=require("./storybook.preview.cjs");exports.storybookMain=o.storybookMain;exports.storybookPreview=e.storybookPreview;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../util/object/object.util.cjs");function e(o){const t={stories:["../src/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx)"],addons:["@storybook/addon-essentials","@storybook/addon-interactions","@storybook/addon-links"],framework:{name:"@storybook/react-vite",options:{}}};return s.deepMerge(t,o)}exports.storybookMain=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(e){const r={parameters:{controls:{matchers:{color:/(background|color)$/i,date:/Date$/i}},backgrounds:{default:"light",values:[{name:"light",value:"#ffffff"},{name:"dark",value:"#333333"}]}}};return{...r,...e,parameters:{...r.parameters,...e?.parameters}}}exports.storybookPreview=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./vitest.e2e.cjs"),e=require("./vitest.unit.cjs");exports.vitestE2E=t.vitestE2E;exports.vitestUnit=e.vitestUnit;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs"),o=require("../../util/object/object.util.cjs");function n(e){const r={plugins:[t()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}};return i.defineConfig(o.deepMerge(r,e))}exports.vitestE2E=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs"),s=require("../../util/object/object.util.cjs");function n(e){const t={plugins:[r()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:["./vitest.unit.setup.ts"],coverage:{provider:"istanbul",reporter:["text","lcov"],reportsDirectory:"./coverage",thresholds:{statements:80,branches:80,functions:80,lines:80}}}};return i.defineConfig(s.deepMerge(t,e))}exports.vitestUnit=n;
|
package/dist/constant/common.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window<"u";exports.IS_BROWSER=e;
|