Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit 33120cb

Browse files
committed
Added commit
1 parent 517af5a commit 33120cb

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

LICENSE.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
MIT License
2-
Copyright (c) 2018 YOUR NAME
2+
3+
Copyright (c) 2022 Truoc Phan
4+
35
Permission is hereby granted, free of charge, to any person obtaining a copy
46
of this software and associated documentation files (the "Software"), to deal
57
in the Software without restriction, including without limitation the rights
68
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
79
copies of the Software, and to permit persons to whom the Software is
810
furnished to do so, subject to the following conditions:
11+
912
The above copyright notice and this permission notice shall be included in all
1013
copies or substantial portions of the Software.
14+
1115
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1216
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1317
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
## Reporting a Vulnerability
1111

12-
Please report security issues related to the json_duplicate_keys project to the following email address: [email protected]
12+
Please report security issues related to the `json_duplicate_keys` project to the following email address: [email protected]

json_duplicate_keys/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ def normalize_key(name, dupSign_start="{{{", dupSign_end="}}}"):
88
if type(dupSign_start) != str: dupSign_start = "{{{"
99
if type(dupSign_end) != str: dupSign_end = "}}}"
1010

11-
if type(name) == str:
12-
return re.sub('{dupSign_start}_\d+_{dupSign_end}$'.format(dupSign_start=re.escape(dupSign_start), dupSign_end=re.escape(dupSign_end)), "", name)
13-
return name
11+
return re.sub('{dupSign_start}_\d+_{dupSign_end}$'.format(dupSign_start=re.escape(dupSign_start), dupSign_end=re.escape(dupSign_end)), "", str(name))
1412
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
1513
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
1614
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -179,7 +177,7 @@ def get(self, name, separator="||", parse_index="$", _isDebug_=False):
179177
if type(name) != str: name = str(name)
180178
if type(separator) != str: separator = "||"
181179
if type(parse_index) != str: parse_index = "$"
182-
if type(_isDebug_) != bool: _isDebug_ = False
180+
if type(_isDebug_) != bool: _isDebug_ = False
183181

184182
if type(self.getObject()) in [list, dict, OrderedDict]:
185183
try:

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import setuptools
22
import datetime
33

4-
with open("README.md", "r") as fh:
5-
long_description = fh.read()
6-
74
setuptools.setup(
85
name="json_duplicate_keys",
96
version=datetime.datetime.now().strftime("%Y.%m.%d"),
107
author="Truoc Phan",
118
license="MIT",
129
author_email="[email protected]",
1310
description="Flatten/ Unflatten and Load(s)/ Dump(s) JSON File/ Object with Duplicate Keys",
14-
long_description=long_description,
11+
long_description=open("README.md").read(),
1512
long_description_content_type="text/markdown",
1613
install_requires=open("requirements.txt").read().split(),
1714
url="https://github.com/truocphan/json_duplicate_keys",

0 commit comments

Comments
 (0)