@cabin-id/nextjs 1.0.3 → 1.0.5

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.
@@ -22,9 +22,9 @@ __export(path_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(path_exports);
24
24
  const SEPARATOR = "/";
25
- const MULTIPLE_SEPARATOR_REGEX = new RegExp("(?<!:)" + SEPARATOR + "{1,}", "g");
26
25
  function joinPaths(...args) {
27
- return args.filter((p) => p).join(SEPARATOR).replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);
26
+ const joined = args.filter((p) => p).join(SEPARATOR);
27
+ return joined.replace(/([^:])\/+/g, "$1/").replace(/^\/+/, "/");
28
28
  }
29
29
  // Annotate the CommonJS export names for ESM import in node:
30
30
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["const SEPARATOR = '/';\nconst MULTIPLE_SEPARATOR_REGEX = new RegExp('(?<!:)' + SEPARATOR + '{1,}', 'g');\n\ntype PathString = string | null | undefined;\n\nexport function joinPaths(...args: PathString[]): string {\n return args\n .filter(p => p)\n .join(SEPARATOR)\n .replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,YAAY;AAClB,MAAM,2BAA2B,IAAI,OAAO,WAAW,YAAY,QAAQ,GAAG;AAIvE,SAAS,aAAa,MAA4B;AACvD,SAAO,KACJ,OAAO,OAAK,CAAC,EACb,KAAK,SAAS,EACd,QAAQ,0BAA0B,SAAS;AAChD;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["const SEPARATOR = '/'\n// Thay thế biểu thức chính quy sử dụng negative lookbehind bằng cách tiếp cận tương thích hơn\n// const MULTIPLE_SEPARATOR_REGEX = new RegExp('(?<!:)' + SEPARATOR + '{1,}', 'g');\n\ntype PathString = string | null | undefined\n\nexport function joinPaths(...args: PathString[]): string {\n const joined = args.filter((p) => p).join(SEPARATOR)\n\n // Xử lý các trường hợp có nhiều dấu phân cách liên tiếp, nhưng bảo vệ URL protocol (http://, https://)\n return joined.replace(/([^:])\\/+/g, '$1/').replace(/^\\/+/, '/')\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,YAAY;AAMX,SAAS,aAAa,MAA4B;AACvD,QAAM,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,SAAS;AAGnD,SAAO,OAAO,QAAQ,cAAc,KAAK,EAAE,QAAQ,QAAQ,GAAG;AAChE;","names":[]}
@@ -1,7 +1,7 @@
1
1
  const SEPARATOR = "/";
2
- const MULTIPLE_SEPARATOR_REGEX = new RegExp("(?<!:)" + SEPARATOR + "{1,}", "g");
3
2
  function joinPaths(...args) {
4
- return args.filter((p) => p).join(SEPARATOR).replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);
3
+ const joined = args.filter((p) => p).join(SEPARATOR);
4
+ return joined.replace(/([^:])\/+/g, "$1/").replace(/^\/+/, "/");
5
5
  }
6
6
  export {
7
7
  joinPaths
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["const SEPARATOR = '/';\nconst MULTIPLE_SEPARATOR_REGEX = new RegExp('(?<!:)' + SEPARATOR + '{1,}', 'g');\n\ntype PathString = string | null | undefined;\n\nexport function joinPaths(...args: PathString[]): string {\n return args\n .filter(p => p)\n .join(SEPARATOR)\n .replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);\n}\n"],"mappings":"AAAA,MAAM,YAAY;AAClB,MAAM,2BAA2B,IAAI,OAAO,WAAW,YAAY,QAAQ,GAAG;AAIvE,SAAS,aAAa,MAA4B;AACvD,SAAO,KACJ,OAAO,OAAK,CAAC,EACb,KAAK,SAAS,EACd,QAAQ,0BAA0B,SAAS;AAChD;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["const SEPARATOR = '/'\n// Thay thế biểu thức chính quy sử dụng negative lookbehind bằng cách tiếp cận tương thích hơn\n// const MULTIPLE_SEPARATOR_REGEX = new RegExp('(?<!:)' + SEPARATOR + '{1,}', 'g');\n\ntype PathString = string | null | undefined\n\nexport function joinPaths(...args: PathString[]): string {\n const joined = args.filter((p) => p).join(SEPARATOR)\n\n // Xử lý các trường hợp có nhiều dấu phân cách liên tiếp, nhưng bảo vệ URL protocol (http://, https://)\n return joined.replace(/([^:])\\/+/g, '$1/').replace(/^\\/+/, '/')\n}\n"],"mappings":"AAAA,MAAM,YAAY;AAMX,SAAS,aAAa,MAA4B;AACvD,QAAM,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,SAAS;AAGnD,SAAO,OAAO,QAAQ,cAAc,KAAK,EAAE,QAAQ,QAAQ,GAAG;AAChE;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/utils/path.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAE5C,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAKvD"}
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/utils/path.ts"],"names":[],"mappings":"AAIA,KAAK,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE3C,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAKvD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cabin-id/nextjs",
3
3
  "description": "NextJS SDK for CabinID",
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "author": "CabinVN",
@@ -45,6 +45,7 @@
45
45
  "dependencies": {
46
46
  "cookie": "^0.6.0",
47
47
  "cookies-next": "^4.1.1",
48
+ "core-js": "3",
48
49
  "next": "^14.1.1",
49
50
  "path-to-regexp": "^6.2.2",
50
51
  "react": "^18.2.0",