@osdk/generator-utils 2.49.1-main-2b73ea70579db50c20be5e798199feca1801e35b → 2.50.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/CHANGELOG.md +5 -1
- package/build/browser/index.js +0 -1
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +0 -9
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +1 -16
- package/build/esm/index.js +0 -1
- package/build/esm/index.js.map +1 -1
- package/build/types/index.d.ts +0 -1
- package/build/types/index.d.ts.map +1 -1
- package/package.json +3 -4
- package/build/browser/lowercase.js +0 -36
- package/build/browser/lowercase.js.map +0 -1
- package/build/esm/lowercase.js +0 -36
- package/build/esm/lowercase.js.map +0 -1
- package/build/types/lowercase.d.ts +0 -14
- package/build/types/lowercase.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
package/build/browser/index.js
CHANGED
|
@@ -16,6 +16,5 @@
|
|
|
16
16
|
|
|
17
17
|
export { changeVersionPrefix } from "./changeVersionPrefix.js";
|
|
18
18
|
export { getDependencyVersionFromFindUpPackageJson } from "./getDependencyVersionFromFindUpPackageJson.js";
|
|
19
|
-
export { lowercase } from "./lowercase.js";
|
|
20
19
|
export { resolveDependenciesFromFindUp } from "./resolveDependenciesFromFindUp.js";
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["changeVersionPrefix","getDependencyVersionFromFindUpPackageJson","
|
|
1
|
+
{"version":3,"file":"index.js","names":["changeVersionPrefix","getDependencyVersionFromFindUpPackageJson","resolveDependenciesFromFindUp"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { changeVersionPrefix } from \"./changeVersionPrefix.js\";\nexport { getDependencyVersionFromFindUpPackageJson } from \"./getDependencyVersionFromFindUpPackageJson.js\";\nexport { resolveDependenciesFromFindUp } from \"./resolveDependenciesFromFindUp.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,yCAAyC,QAAQ,gDAAgD;AAC1G,SAASC,6BAA6B,QAAQ,oCAAoC","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -36,14 +36,6 @@ async function getDependencyVersionFromFindUpPackageJson(name, opts) {
|
|
|
36
36
|
return version;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// src/lowercase.ts
|
|
40
|
-
function lowercase(value) {
|
|
41
|
-
if (typeof value !== "string") {
|
|
42
|
-
throw new Error(`The "lowercase" template helper requires a string argument but received a value of type "${typeof value}". This usually means the token passed to it could not be resolved.`);
|
|
43
|
-
}
|
|
44
|
-
return value.toLowerCase();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
39
|
// src/resolveDependenciesFromFindUp.ts
|
|
48
40
|
async function resolveDependenciesFromFindUp(deps, cwd) {
|
|
49
41
|
return await Promise.all(Object.entries(deps).map(async ([dependencyName, dependencyVersion]) => {
|
|
@@ -58,7 +50,6 @@ async function resolveDependenciesFromFindUp(deps, cwd) {
|
|
|
58
50
|
|
|
59
51
|
exports.changeVersionPrefix = changeVersionPrefix;
|
|
60
52
|
exports.getDependencyVersionFromFindUpPackageJson = getDependencyVersionFromFindUpPackageJson;
|
|
61
|
-
exports.lowercase = lowercase;
|
|
62
53
|
exports.resolveDependenciesFromFindUp = resolveDependenciesFromFindUp;
|
|
63
54
|
//# sourceMappingURL=index.cjs.map
|
|
64
55
|
//# sourceMappingURL=index.cjs.map
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/changeVersionPrefix.ts","../../src/getDependencyVersionFromFindUpPackageJson.ts","../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/changeVersionPrefix.ts","../../src/getDependencyVersionFromFindUpPackageJson.ts","../../src/resolveDependenciesFromFindUp.ts"],"names":["invariant","readFile"],"mappings":";;;;;;;;;;AAgBO,SAAS,mBAAA,CAAoB,SAAS,MAAA,EAAQ;AACnD,EAAA,MAAM,mBAAA,GAAsB,OAAA,CAAQ,UAAA,CAAW,YAAY,CAAA;AAC3D,EAAA,IAAI,mBAAA,EAAqB;AACvB,IAAA,OAAA,GAAU,OAAA,CAAQ,KAAA,CAAM,YAAA,CAAa,MAAM,CAAA;AAAA,EAC7C;AACA,EAAA,IAAI,OAAA,CAAQ,CAAC,CAAA,KAAM,GAAA,IAAO,OAAA,CAAQ,CAAC,CAAA,KAAM,GAAA,IAAO,OAAA,CAAQ,CAAC,CAAA,KAAM,GAAA,EAAK;AAClE,IAAA,OAAA,GAAU,OAAA,CAAQ,MAAM,CAAC,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,GAAG,mBAAA,GAAsB,YAAA,GAAe,EAAE,CAAA,EAAG,MAAM,GAAG,OAAO,CAAA,CAAA;AACtE;ACPA,eAAsB,yCAAA,CAA0C,MAAM,IAAA,EAAM;AAC1E,EAAA,MAAM;AAAA,IACJ;AAAA,GACF,GAAI,MAAM,OAAO,SAAS,CAAA;AAC1B,EAAA,MAAM,eAAA,GAAkB,MAAM,MAAA,CAAO,cAAA,EAAgB,IAAI,CAAA;AACzD,EAAA,EAAE,eAAA,KAAoB,MAAA,CAAA,GAAa,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,GAAeA,0BAAA,CAAU,KAAA,EAAO,6BAA6B,CAAA,GAAIA,0BAAA,CAAU,KAAK,CAAA,GAAI,MAAA;AAChJ,EAAA,MAAM,WAAA,GAAc,MAAMC,iBAAA,CAAS,eAAA,EAAiB;AAAA,IAClD,QAAA,EAAU;AAAA,GACX,CAAA;AACD,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,0DAAA,EAA6D,OAAA,CAAQ,GAAA,EAAK,CAAA,CAAE,CAAA;AAAA,EAC9F;AACA,EAAA,MAAM,iBAAA,GAAoB,IAAA,CAAK,KAAA,CAAM,WAAW,CAAA;AAChD,EAAA,MAAM,OAAA,GAAU,iBAAA,CAAkB,YAAA,GAAe,IAAI,CAAA,IAAK,iBAAA,CAAkB,eAAA,GAAkB,IAAI,CAAA,IAAK,iBAAA,CAAkB,gBAAA,GAAmB,IAAI,CAAA;AAChJ,EAAA,EAAE,YAAY,MAAA,CAAA,GAAa,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,eAAeD,0BAAA,CAAU,KAAA,EAAO,CAAA,gCAAA,EAAmC,IAAI,OAAO,eAAe,CAAA,CAAE,CAAA,GAAIA,0BAAA,CAAU,KAAK,CAAA,GAAI,MAAA;AAC1K,EAAA,OAAO,OAAA;AACT;;;ACTA,eAAsB,6BAAA,CAA8B,MAAM,GAAA,EAAK;AAC7D,EAAA,OAAO,MAAM,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAA,CAAE,GAAA,CAAI,OAAO,CAAC,cAAA,EAAgB,iBAAiB,CAAA,KAAM;AAC/F,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,iBAAA,EAAmB,mBAAA,CAAoB,iBAAA,IAAsB,MAAM,0CAA0C,cAAA,EAAgB;AAAA,QAC3H;AAAA,OACD,GAAI,GAAG;AAAA,KACV;AAAA,EACF,CAAC,CAAC,CAAA;AACJ","file":"index.cjs","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function changeVersionPrefix(version, prefix) {\n const isWorkspaceProtocol = version.startsWith(\"workspace:\");\n if (isWorkspaceProtocol) {\n version = version.slice(\"workspace:\".length);\n }\n if (version[0] === \"^\" || version[0] === \"~\" || version[0] === \"*\") {\n version = version.slice(1);\n }\n return `${isWorkspaceProtocol ? \"workspace:\" : \"\"}${prefix}${version}`;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { readFile } from \"fs/promises\";\nimport invariant from \"tiny-invariant\";\nexport async function getDependencyVersionFromFindUpPackageJson(name, opts) {\n const {\n findUp\n } = await import(\"find-up\");\n const packageJsonPath = await findUp(\"package.json\", opts);\n !(packageJsonPath !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find package.json\") : invariant(false) : void 0;\n const packageJson = await readFile(packageJsonPath, {\n encoding: \"utf-8\"\n });\n if (!packageJson) {\n throw new Error(`Could not find package.json in current working directory: ${process.cwd()}`);\n }\n const parsedPackageJson = JSON.parse(packageJson);\n const version = parsedPackageJson.dependencies?.[name] ?? parsedPackageJson.devDependencies?.[name] ?? parsedPackageJson.peerDependencies?.[name];\n !(version !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Could not find a dependency for ${name} in ${packageJsonPath}`) : invariant(false) : void 0;\n return version;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { changeVersionPrefix } from \"./changeVersionPrefix.js\";\nimport { getDependencyVersionFromFindUpPackageJson } from \"./getDependencyVersionFromFindUpPackageJson.js\";\n\n/**\n * Resolves dependencies to their versions per our package.json if undefined.\n * Sets the prefix to `^` for the version specified or read from package.json.\n * @param deps\n * @returns\n */\nexport async function resolveDependenciesFromFindUp(deps, cwd) {\n return await Promise.all(Object.entries(deps).map(async ([dependencyName, dependencyVersion]) => {\n return {\n dependencyName,\n dependencyVersion: changeVersionPrefix(dependencyVersion ?? (await getDependencyVersionFromFindUpPackageJson(dependencyName, {\n cwd\n })), \"^\")\n };\n }));\n}"]}
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -4,21 +4,6 @@ declare function getDependencyVersionFromFindUpPackageJson(name: string, opts?:
|
|
|
4
4
|
cwd: string;
|
|
5
5
|
}): Promise<string>;
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Handlebars helper that lowercases a substituted token value.
|
|
9
|
-
*
|
|
10
|
-
* `npm publish` rejects package names containing uppercase characters, but a
|
|
11
|
-
* project name supplied when scaffolding a template can contain them, so
|
|
12
|
-
* template `package.json` `name` fields wrap their token as
|
|
13
|
-
* `{{lowercase project}}`.
|
|
14
|
-
*
|
|
15
|
-
* Throws when the argument is not a string. An unresolved or misspelled token
|
|
16
|
-
* is passed by Handlebars as `undefined`, so throwing surfaces the mistake as
|
|
17
|
-
* a template-rendering error instead of silently producing an invalid
|
|
18
|
-
* `package.json` name such as `"undefined"`.
|
|
19
|
-
*/
|
|
20
|
-
declare function lowercase(value: unknown): string;
|
|
21
|
-
|
|
22
7
|
/**
|
|
23
8
|
* Resolves dependencies to their versions per our package.json if undefined.
|
|
24
9
|
* Sets the prefix to `^` for the version specified or read from package.json.
|
|
@@ -32,4 +17,4 @@ declare function resolveDependenciesFromFindUp(deps: {
|
|
|
32
17
|
dependencyVersion: string;
|
|
33
18
|
}[]>;
|
|
34
19
|
|
|
35
|
-
export { changeVersionPrefix, getDependencyVersionFromFindUpPackageJson,
|
|
20
|
+
export { changeVersionPrefix, getDependencyVersionFromFindUpPackageJson, resolveDependenciesFromFindUp };
|
package/build/esm/index.js
CHANGED
|
@@ -16,6 +16,5 @@
|
|
|
16
16
|
|
|
17
17
|
export { changeVersionPrefix } from "./changeVersionPrefix.js";
|
|
18
18
|
export { getDependencyVersionFromFindUpPackageJson } from "./getDependencyVersionFromFindUpPackageJson.js";
|
|
19
|
-
export { lowercase } from "./lowercase.js";
|
|
20
19
|
export { resolveDependenciesFromFindUp } from "./resolveDependenciesFromFindUp.js";
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["changeVersionPrefix","getDependencyVersionFromFindUpPackageJson","
|
|
1
|
+
{"version":3,"file":"index.js","names":["changeVersionPrefix","getDependencyVersionFromFindUpPackageJson","resolveDependenciesFromFindUp"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { changeVersionPrefix } from \"./changeVersionPrefix.js\";\nexport { getDependencyVersionFromFindUpPackageJson } from \"./getDependencyVersionFromFindUpPackageJson.js\";\nexport { resolveDependenciesFromFindUp } from \"./resolveDependenciesFromFindUp.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,yCAAyC,QAAQ,gDAAgD;AAC1G,SAASC,6BAA6B,QAAQ,oCAAoC","ignoreList":[]}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { changeVersionPrefix } from "./changeVersionPrefix.js";
|
|
2
2
|
export { getDependencyVersionFromFindUpPackageJson } from "./getDependencyVersionFromFindUpPackageJson.js";
|
|
3
|
-
export { lowercase } from "./lowercase.js";
|
|
4
3
|
export { resolveDependenciesFromFindUp } from "./resolveDependenciesFromFindUp.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,SAAS,2BAA2B;AACpC,SAAS,iDAAiD;AAC1D,SAAS,
|
|
1
|
+
{"mappings":"AAgBA,SAAS,2BAA2B;AACpC,SAAS,iDAAiD;AAC1D,SAAS,qCAAqC","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/generator-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.50.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@types/tmp": "^0.2.6",
|
|
36
36
|
"tmp": "^0.2.5",
|
|
37
37
|
"typescript": "~5.5.4",
|
|
38
|
-
"@osdk/monorepo.
|
|
39
|
-
"@osdk/monorepo.
|
|
38
|
+
"@osdk/monorepo.tsconfig": "~0.7.0",
|
|
39
|
+
"@osdk/monorepo.api-extractor": "~0.7.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
|
|
62
62
|
"fix-lint": "eslint . --fix && dprint fmt",
|
|
63
63
|
"lint": "eslint . && dprint check",
|
|
64
|
-
"test": "vitest run",
|
|
65
64
|
"transpileBrowser": "monorepo.tool.transpile -f esm -m normal -t browser",
|
|
66
65
|
"transpileCjs": "monorepo.tool.transpile -f cjs -m bundle -t node",
|
|
67
66
|
"transpileEsm": "monorepo.tool.transpile -f esm -m normal -t node",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Handlebars helper that lowercases a substituted token value.
|
|
19
|
-
*
|
|
20
|
-
* `npm publish` rejects package names containing uppercase characters, but a
|
|
21
|
-
* project name supplied when scaffolding a template can contain them, so
|
|
22
|
-
* template `package.json` `name` fields wrap their token as
|
|
23
|
-
* `{{lowercase project}}`.
|
|
24
|
-
*
|
|
25
|
-
* Throws when the argument is not a string. An unresolved or misspelled token
|
|
26
|
-
* is passed by Handlebars as `undefined`, so throwing surfaces the mistake as
|
|
27
|
-
* a template-rendering error instead of silently producing an invalid
|
|
28
|
-
* `package.json` name such as `"undefined"`.
|
|
29
|
-
*/
|
|
30
|
-
export function lowercase(value) {
|
|
31
|
-
if (typeof value !== "string") {
|
|
32
|
-
throw new Error(`The "lowercase" template helper requires a string argument but received ` + `a value of type "${typeof value}". This usually means the token passed ` + `to it could not be resolved.`);
|
|
33
|
-
}
|
|
34
|
-
return value.toLowerCase();
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=lowercase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lowercase.js","names":["lowercase","value","Error","toLowerCase"],"sources":["lowercase.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Handlebars helper that lowercases a substituted token value.\n *\n * `npm publish` rejects package names containing uppercase characters, but a\n * project name supplied when scaffolding a template can contain them, so\n * template `package.json` `name` fields wrap their token as\n * `{{lowercase project}}`.\n *\n * Throws when the argument is not a string. An unresolved or misspelled token\n * is passed by Handlebars as `undefined`, so throwing surfaces the mistake as\n * a template-rendering error instead of silently producing an invalid\n * `package.json` name such as `\"undefined\"`.\n */\nexport function lowercase(value: unknown): string {\n if (typeof value !== \"string\") {\n throw new Error(\n `The \"lowercase\" template helper requires a string argument but received `\n + `a value of type \"${typeof value}\". This usually means the token passed `\n + `to it could not be resolved.`,\n );\n }\n return value.toLowerCase();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAACC,KAAc,EAAU;EAChD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAM,IAAIC,KAAK,CACb,0EAA0E,GACtE,oBAAoB,OAAOD,KAAK,yCAAyC,GACzE,8BACN,CAAC;EACH;EACA,OAAOA,KAAK,CAACE,WAAW,CAAC,CAAC;AAC5B","ignoreList":[]}
|
package/build/esm/lowercase.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Handlebars helper that lowercases a substituted token value.
|
|
19
|
-
*
|
|
20
|
-
* `npm publish` rejects package names containing uppercase characters, but a
|
|
21
|
-
* project name supplied when scaffolding a template can contain them, so
|
|
22
|
-
* template `package.json` `name` fields wrap their token as
|
|
23
|
-
* `{{lowercase project}}`.
|
|
24
|
-
*
|
|
25
|
-
* Throws when the argument is not a string. An unresolved or misspelled token
|
|
26
|
-
* is passed by Handlebars as `undefined`, so throwing surfaces the mistake as
|
|
27
|
-
* a template-rendering error instead of silently producing an invalid
|
|
28
|
-
* `package.json` name such as `"undefined"`.
|
|
29
|
-
*/
|
|
30
|
-
export function lowercase(value) {
|
|
31
|
-
if (typeof value !== "string") {
|
|
32
|
-
throw new Error(`The "lowercase" template helper requires a string argument but received ` + `a value of type "${typeof value}". This usually means the token passed ` + `to it could not be resolved.`);
|
|
33
|
-
}
|
|
34
|
-
return value.toLowerCase();
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=lowercase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lowercase.js","names":["lowercase","value","Error","toLowerCase"],"sources":["lowercase.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Handlebars helper that lowercases a substituted token value.\n *\n * `npm publish` rejects package names containing uppercase characters, but a\n * project name supplied when scaffolding a template can contain them, so\n * template `package.json` `name` fields wrap their token as\n * `{{lowercase project}}`.\n *\n * Throws when the argument is not a string. An unresolved or misspelled token\n * is passed by Handlebars as `undefined`, so throwing surfaces the mistake as\n * a template-rendering error instead of silently producing an invalid\n * `package.json` name such as `\"undefined\"`.\n */\nexport function lowercase(value: unknown): string {\n if (typeof value !== \"string\") {\n throw new Error(\n `The \"lowercase\" template helper requires a string argument but received `\n + `a value of type \"${typeof value}\". This usually means the token passed `\n + `to it could not be resolved.`,\n );\n }\n return value.toLowerCase();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAACC,KAAc,EAAU;EAChD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAM,IAAIC,KAAK,CACb,0EAA0E,GACtE,oBAAoB,OAAOD,KAAK,yCAAyC,GACzE,8BACN,CAAC;EACH;EACA,OAAOA,KAAK,CAACE,WAAW,CAAC,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handlebars helper that lowercases a substituted token value.
|
|
3
|
-
*
|
|
4
|
-
* `npm publish` rejects package names containing uppercase characters, but a
|
|
5
|
-
* project name supplied when scaffolding a template can contain them, so
|
|
6
|
-
* template `package.json` `name` fields wrap their token as
|
|
7
|
-
* `{{lowercase project}}`.
|
|
8
|
-
*
|
|
9
|
-
* Throws when the argument is not a string. An unresolved or misspelled token
|
|
10
|
-
* is passed by Handlebars as `undefined`, so throwing surfaces the mistake as
|
|
11
|
-
* a template-rendering error instead of silently producing an invalid
|
|
12
|
-
* `package.json` name such as `"undefined"`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function lowercase(value: unknown): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AA6BA,OAAO,iBAAS,UAAUA","names":["value: unknown"],"sources":["../../src/lowercase.ts"],"version":3,"file":"lowercase.d.ts"}
|